Open HeenaBioinfo opened 4 years ago
I am not able to generate the size factors, please guide..
This occurs commonly in large samples and/or single-cell data. It can also occur if the samples are extremely variable and very different from one another (like in single-cell data). The geometric size factor calculation used by DESeq simply fails in this situation.
I would recommend skipping the size factor calculation step and replacing it with your own. For large samples / single sample data the Upper Quartile method seems to be gaining traction as the industry standard.
I would use the step-by-step analysis pipeline from the manual, but replace the estimateJunctionSeqSizeFactors step with the following:
#replace the estimation function with a version that takes an external size factor.
# I Should have added this long ago...
estimateJunctionSeqSizeFactors.forced <- function( jscs , sizeFactors, verbose = FALSE){
stopifnot( is( jscs, "JunctionSeqCountSet") )
sizeFactors(jscs) <- sizeFactors
sizeFactors(jscs@DESeqDataSet) <- rep(sizeFactors(jscs),2)
fData(jscs)$baseMean <- rowMeans(counts(jscs, normalized= T))
fData(jscs)$baseVar <- rowVars(counts(jscs, normalized=T))
jscs@altSizeFactors <- data.frame()
return(jscs);
}
#Calculate size factors using your favorite method.
#I recommend the upper quartile method, shown below:
SF <- sapply(1:ncol(jscs@geneCountData),function(i){
quantile(jscs@geneCountData[,i],p=0.75);
})
#Now copy in those size factors:
jscs <- estimateJunctionSeqSizeFactors.forced(jscs,sizeFactors=SF)
For the future I'll fold this into the codebase with the next update.
Hi Can you please guide me through this error?