You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#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)
###########################################################################
Hi ,
When I run
there is one error
My whole script like below:
`BiocManager::install("JunctionSeq")
library(JunctionSeq)
library(JctSeqData)
######################
decoder <- read.table("decoder.bySample.txt",header=TRUE,stringsAsFactors=FALSE);
design <- data.frame(condition = factor(decoder$group.ID));
geneID.to.symbol.file <- read.table("ensid.2.symbol.txt",header=TRUE,stringsAsFactors=FALSE);
gff.file <- c("output_final/withNovel.forJunctionSeq.gff.gz");
#The count files:
countFiles <- paste0("./output_final/",decoder$sample.ID,"/QC.spliceJunctionAndExonCounts.withNovel.forJunctionSeq.txt.gz");
#######################################################################################
jscs = readJunctionSeqCounts(countfiles = countFiles,
samplenames = decoder$sample.ID,
design = design,
flat.gff.file = gff.file,
gene.names = geneID.to.symbol.file,
nCores = 1,
verbose=TRUE,
analysis.type = "junctionsAndExons"
);
######################################################################################
#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)
###########################################################################
writeSizeFactors(jscs, file = "sizeFactors.txt");
writeCompleteResults(jscs, outfile.prefix="./output_R/")`
The text was updated successfully, but these errors were encountered: