Package: DASC
Authors: Haidong Yi, Ayush T. Raman
Version: 0.99.11
Compiled date: 2017-05-07
License: MIT + file LICENSE
Prerequisites: NMF, cvxclustr, Biobase

1 Getting started

DASC is an R package distributed as part of the Bioconductor project. To install the package, start R and enter:

source("http://bioconductor.org/biocLite.R")
biocLite("DASC")

2 Introduction

DASC is used for identifying batches and classifying samples into different batches in a high dimensional gene expression dataset. The batch information can be further used as a covariate in conjunction with other variables of interest among standard bioinformatics analysis like differential expression analysis.

2.1 Citation info

If you use DASC for your analysis, please cite it as here below. To cite package ‘DASC’ in publications use:

    @Manual{, 
        title = {DASC: Detecting hidden batch factors through data adaptive 
            adjustment for biological effects.},
        author = {Haidong Yi, Ayush T. Raman, Han Zhang, Genevera I. Allen and 
            Zhandong Liu},
        year = {2017},
        note = {R package version 0.1.0},
    }

3 Quick Example

library(DASC)
data("esGolub")
samples <- c(20,21,28,30)
dat <- exprs(esGolub)[1:100,samples]
pdat <- pData(esGolub)[samples,]

## use nrun = 50 or more for better convergence of results
res <- DASC(edata = dat, pdata = pdat, factor = pdat$Cell, 
                        method = 'ama', type = 3, lambda = 1, 
                        rank = 2:3, nrun = 5, annotation='esGolub Dataset')
Compute NMF rank= 2  ... + measures ... OK
Compute NMF rank= 3  ... + measures ... OK

4 Setting up the data

The first step in using DASC package is to properly format the data. For example, in case of gene expression data, it should be a matrix with features (genes, transcripts) in the rows and samples in the columns. DASC then requires the information for the variable of interest to model the gene expression data effectively.Variable of interest could be a genotype or treatment information.

4.1 Stanford RNA-Seq Dataset

Below is an example of Stanford gene expression dataset (Chen et. al. PNAS, 2015; Gilad et. al. F1000 Research, 2015). It is a filtered raw counts dataset which was published by Gilad et al. F1000 Research. 30% of genes with the lowest expression & mitochondrial genes were removed (Gilad et al.F1000 Research).

## libraries
set.seed(99999)
library(DESeq2)
library(ggplot2)
library(pcaExplorer)

## dataset
rawCounts <- stanfordData$rawCounts
metadata <- stanfordData$metadata
## Using a smaller dataset
idx <- which(metadata$tissue %in% c("adipose", "adrenal", "sigmoid"))
rawCounts <- rawCounts[,idx]
metadata <- metadata[idx,]
head(rawCounts)
        adipose (h) adrenal (h) sigmoid (h) adipose (m) adrenal (m)
STAG2          1430        4707        4392        3223        8235
STAG1           835        2362        1687        2750        2732
GOSR2           142         891          97        1599        1430
C1orf43        1856        9591        2611         706         498
ART5              1           4           0           0           0
ART1              0           0           0           0           1
        sigmoid (m)
STAG2         10435
STAG1          2833
GOSR2           887
C1orf43         753
ART5              0
ART1              0
head(metadata)
                setname                 seqBatch species  tissue
adipose (h) adipose (h) D87PMJN1:253:D2GUAACXX:8   human adipose
adrenal (h) adrenal (h) D87PMJN1:253:D2GUAACXX:8   human adrenal
sigmoid (h) sigmoid (h) D87PMJN1:253:D2GUAACXX:8   human sigmoid
adipose (m) adipose (m) D4LHBFN1:276:C2HKJACXX:4   mouse adipose
adrenal (m) adrenal (m) D4LHBFN1:276:C2HKJACXX:4   mouse adrenal
sigmoid (m) sigmoid (m) D4LHBFN1:276:C2HKJACXX:4   mouse sigmoid

5 Batch detection using PCA Analysis

## Normalizing the dataset using DESeq2
dds <- DESeqDataSetFromMatrix(rawCounts, metadata, design = ~ species+tissue)
dds <- estimateSizeFactors(dds)
dat <- counts(dds, normalized = TRUE)
lognormalizedCounts <- log2(dat + 1)
## PCA plot using 
rld.dds <- rlog(dds)
pcaplot(rld.dds, intgroup=c("tissue","species"), ntop=1000, pcX=1, pcY=2)