assignCellComp: Cluster cells to components based on their proximities to the...

View source: R/assignCellComp.R

assignCellCompR Documentation

Cluster cells to components based on their proximities to the distributions

Description

Cluster cells to components based on their proximities to the distributions

Usage

assignCellComp(iso.pair.names, dmix.list, nq.list, isoformLevel.data,
  geneLevel.data = NULL)

Arguments

iso.pair.names

A vector of names of isoform pairs in the format: gene.isoform1.isoform2

dmix.list

A list of mixture models obtained from doMixtureModelMatrix function

nq.list

A list of number of components of detected models

isoformLevel.data

A data matrix of isoform expression

geneLevel.data

A data matrix of gene expression

Value

Two lists of matrices cellCompMat.conf and cellCompMat.prob indicating confidence scores and probabilities of cells assigned to components

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)
iso.pair.names=names(model.res$nq.list)
res=assignCellComp(iso.pair.names,model.res$dmix.list,
    model.res$nq.list, isoformLevel.data=isoformDataSample)

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