getDPIP: Compute differential patterns of isoform pairs from X2 test...

View source: R/getDPIP.R

getDPIPR Documentation

Compute differential patterns of isoform pairs from X2 test between group labels of cells and assignment of cells to components of the mixture models

Description

Compute differential patterns of isoform pairs from X2 test between group labels of cells and assignment of cells to components of the mixture models

Usage

getDPIP(cellCompMat.prob, group.label, usePermutation = TRUE,
  per.num = 10000, useParallel = TRUE)

Arguments

cellCompMat.prob

A results from assignCellComp function

group.label

A vector of group label of cells

usePermutation

An option to compute empirical p-values

per.num

The number of permutations when usePermutation=TRUE

useParallel

An option for using parallel (=TRUE)

Value

A list containing model-based theoretical p-values (t.VAL) and permutation-based empirical p-values (e.PVAL)

Examples

library("TxDb.Hsapiens.UCSC.hg19.knownGene")
library("AnnotationDbi")
txdb=TxDb.Hsapiens.UCSC.hg19.knownGene
#The txdb also can be imported from a gtf file by using package GenomicFeatures
data(isoformDataSample)
#preprocessing
isoformDataSample=ifelse(isoformDataSample <= 3,0,isoformDataSample)
isoformDataSample=isoformDataSample[which(rowSums(isoformDataSample)>0),]
#tranform read count dataset to log scale
isoformDataSample=ifelse(isoformDataSample==0,0,log2(isoformDataSample))
#now data is ready
tbreak=round(sqrt(ncol(isoformDataSample)))
model.res=doMixtureModelMatrix(isoformLevel.data=isoformDataSample,txdb=txdb,tbreak=tbreak)
#library(doParallel)
#registerDoParallel(cores=4)
set.seed(2015)
iso.pair.names=names(model.res$nq.list)
map.res=assignCellComp(iso.pair.names,model.res$dmix.list,
       model.res$nq.list, isoformLevel.data=isoformDataSample)
group.label=unlist(lapply(colnames(isoformDataSample),function(x) unlist(strsplit(x,"_"))[1]))
res=getDPIP(map.res$cellCompMat.prob,group.label,usePermutation=TRUE,per.num=100,useParallel=FALSE)
hist(res$e.PVAL, breaks=10)

nghiavtr/ISOP documentation built on April 21, 2023, 3:57 p.m.