piquelab / QuASAR

Quantitative Allele Specific Analysis of Reads. Joint genotyping & ASE inference for RNA-seq data
MIT License
26 stars 10 forks source link

Error in rep(0.1, ncol(ref)) : invalid 'times' argument #3

Open bdeonovic opened 9 years ago

bdeonovic commented 9 years ago

I get the following error:

> ase.dat <- UnionExtractFields(list("test_Quesar.txt.gz"),combine=TRUE)
Read 1 item
Processing: test_Quesar.txt.gz 
> ase.dat.gt <- PrepForGenotyping(ase.dat, min.coverage=5)
> sample.names <- colnames(ase.dat.gt$ref)
> ase.joint <- fitAseNullMulti(ase.dat.gt$ref, ase.dat.gt$alt, log.gmat=log(ase.dat.gt$gmat))
Error in rep(0.1, ncol(ref)) : invalid 'times' argument

Here is my ase.dat object that I tried to go through the tutorial with http://pastebin.com/KvSpjjSk

bdeonovic commented 9 years ago

I fixed this issue by using as.matrix

> ase.joint <- fitAseNullMulti(as.matrix(ase.dat.gt$ref), as.matrix(ase.dat.gt$alt), log.gmat=log(ase.dat.gt$gmat))
bdeonovic commented 9 years ago

The issue was your code expects multiple samples (i.e. files), but doesn't seem to handle the 1 file/sample case well.