Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

writeCompleteResults : Error in data.frame(..., check.names = FALSE) #53

Open
YanliangDou opened this issue Oct 29, 2020 · 0 comments
Open

Comments

@YanliangDou
Copy link

Hi ,

When I run

writeCompleteResults(jscs, outfile.prefix="./output_R/")

there is one error

Error in data.frame(..., check.names = FALSE) : arguments imply differing number of rows: 491717, 0

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/")`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant