broadinstitute / ichorCNA

Estimating tumor fraction in cell-free DNA from ultra-low-pass whole genome sequencing.
GNU General Public License v3.0
158 stars 88 forks source link

Error: could not find function "getSeqInfo" #76

Open heqisun opened 4 years ago

heqisun commented 4 years ago

Hi there, I run ichorCNA with command: Rscript /data/cephfs/punim0648/Projects/heqi/ichorCNA/scripts/runIchorCNA.R --id test \ --WIG /data/cephfs/punim0648/Projects/heqi/SFRC01073_ctDNA.wig \ --ploidy "c(2,3)" --normal "c(0.5,0.6,0.7,0.8,0.9)" --maxCN 5 \ --gcWig /data/cephfs/punim0648/Projects/heqi/ichorCNA/inst/extdata/gc_hg19_1000kb.wig \ --mapWig /data/cephfs/punim0648/Projects/heqi/ichorCNA/inst/extdata/map_hg19_1000kb.wig \ --centromere /data/cephfs/punim0648/Projects/heqi/ichorCNA/inst/extdata/GRCh37.p13_centromere_UCSC-gapTable.txt \ --includeHOMD False --chrs "c(1:22, \"X\")" --chrTrain "c(1:22)" \ --estimateNormal True --estimatePloidy True --estimateScPrevalence True \ --scStates "c(1,3)" --txnE 0.9999 --txnStrength 10000 --outDir .

And I get the error: Error in getSeqInfo(genomeBuild, genomeStyle) : could not find function "getSeqInfo"

gavinha commented 4 years ago

Hi @heqisun

Have you installed the ichorCNA package in R? Are you able to load it from within R?

Try

library(ichorCNA)
> getSeqInfo

It should print out the function

function (genomeBuild = "hg19", genomeStyle = "NCBI")
{
    bsg <- paste0("BSgenome.Hsapiens.UCSC.", genomeBuild)
    if (!require(bsg, character.only = TRUE, quietly = TRUE,
        warn.conflicts = FALSE)) {
        seqinfo <- Seqinfo(genome = genomeBuild)
    }
    else {
        seqinfo <- seqinfo(get(bsg))
    }
    seqlevelsStyle(seqinfo) <- genomeStyle
    seqinfo <- keepSeqlevels(seqinfo, value = chrs)
    return(seqinfo)
}
<bytecode: 0x8805498>
<environment: namespace:ichorCNA>
pawelqs commented 3 years ago

I had the same problem using Snakemake, with ichorCNA installed from conda. I think that conda has an older version of ichorCNA, where getSeqInfo does not exist or has a different name. For me the solution was simply to clone the repo and use libdir param to point the directory, where R directory with ichorCNA code exist.