Setup SCDE in R engine

From Array Suite Wiki

Jump to: navigation, search


Single Cell Differential Expression (SCDE)

Contents

Overview

SCDE is an R package that can be wrapped into Array Studio for users to identify differential expression within clusters generated from single-cell RNA-seq studies. Unlike the DESeq package, which has been implemented in ArrayStudio code, SCDE needs to be run with R scripts, through packages installed in ArrayStudio. SCDE has specific package dependencies that users have to utilize in R (https://bioconductor.org/packages/release/bioc/html/scde.html) - failure to utilize these packages will prevent proper operation of SCDE. This wiki demonstrates how users can setup SCDE in R engine to integrate into ArrayStudio. Before SCDE can used, users must install SCDE packages directly in their R environment (the R path they defined in R engine executable path)

Linux Machines

Install tools required for R installation

For Debian, Ubuntu:

sudo apt-get install build-essential
sudo apt-get install fort77
sudo apt-get install xorg-dev
sudo apt-get install liblzma-dev  libblas-dev gfortran
sudo apt-get install gcc-multilib
sudo apt-get install gobjc++
sudo apt-get install aptitude
sudo aptitude install libreadline-dev

For CentOS, Fedora, RedHat:

sudo yum install readline-devel 
sudo yum install openssl-devel
sudo yum install libcurl-devel
sudo yum install libXt libXtst.i686
sudo yum install libcairo2-dev

Install flexmix

SCDE requires a specific version of flexmix (2.3-13) to be installed with scde_1.99.4:

install.packages("devtools")  # this command install devtools first if you don’t have devtools installed
require(devtools)
install_version("flexmix", version = "2.3-13", repos = "http://cran.us.r-project.org")
  • devtools requires openssl-devel for installation.

Install SCDE

Once the proper version flexmix is installed, user can then obtain a specific version of SCDE and compile:

require(devtools)
devtools::install_github('hms-dbmi/scde', build_vignettes = FALSE)

Windows Machines

Install flexmix

SCDE requires a specific version of flexmix (2.3-13) to be installed with scde_1.99.4:

install.packages("devtools")  # this command install devtools first if you don’t have devtools installed
require(devtools)
install_version("flexmix", version = "2.3-13", repos = "http://cran.us.r-project.org")
  • devtools requires Rtools for installation. For Windows, this can be found here.

Install SCDE

Once the proper version flexmix is installed, user can then obtain a specific version of SCDE and compile:

require(devtools)
devtools::install_github('hms-dbmi/scde', build_vignettes = FALSE)


Download SCDE R scripts

Now SCDE can be run successfully in R. In order to run SCDE through ArrayStudio, we need to download a text file containing the SCDE script, and put this file into the RScript folder. This SCDE script can be downloaded from here.

RScript folder can be found accordingly for local runs or server runs:

When installation is complete, users will see:

R engine.png

Test code

Users could try the testing code (within R) below to verify if SCDE package has been correctly installed:

library(scde)
data(pollen)
cd <- clean.counts(pollen)
## change verbose to 1 to get immediate feedback
knn <- knn.error.models(cd, k = ncol(cd)/4, n.cores = 1, 
                       min.count.threshold = 2, min.nonfailed = 5, max.model.plots = 10, verbose=1)

A successful run would show iteration of Classification: weighted:

TestingSCDE.png

Troubleshooting

flexmix

Currently, the default installation of SCDE will have issue running in R since this error when build error model:

error info: Error in FUN(Xi, ...) :
trying to get slot "logLik" from an object of a basic class ("function") with no slots

This results from a new version of package flexmix - use the steps indicated above to install the proper version of flexmix


SOCKcluster

When running SCDE on Linux Machines, users may obtain an error when running parallel jobs:

Error in serialize(data, node$con, xdr = FALSE) :
error writing to connection
Calls: scde.error.models ... .send_EXEC -> <Anonymous> -> sendData.SOCK0node -> serialize
Error: failed to stop ‘SOCKcluster’ cluster: ignoring SIGPIPE signal
Execution halted
Error: failed to stop ‘SOCKcluster’ cluster: error writing to connection

This may be due an issue running parallel jobs on the machine. A workaround for this error would be to overwrite the cpuNumber parameter in the scde.txt file:

CfgCPU number.png

Related Articles

EnvelopeLarge2.png

[back to top]