broadinstitute / ichorCNA

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

runIchorCNA.R failing when passing bed file #55

Open MUppal opened 5 years ago

MUppal commented 5 years ago

I'm running into an issue when passing a Haloplex bed file to runIchorCNA.R as part of the overall TitanCNA snakemake pipeline for WES. The following error arises: Error in (function (classes, fdef, mtable) : unable to find an inherited method for function 'seqinfo' for signature '"data.frame"' Calls: loadReadCountsFromWig ... seqlevels -> seqlevels -> seqlevels -> seqinfo -> Execution halted

I've traced the issue to current line 141 of utils.R: seqlevelsStyle(targetedSequences) <- genomeStyle

It appears that all other objects for which seqlevelsStyle is called are already converted to GRanges objects, such as tumor_read, gc, and map in runIchorCNA.r. This implies that the targetedSequences (representing the bed file) object must be converted to GRanges as well, prior to calling loadReadCountsFromWig on line 176 on runIchorCNA.r.

This error then goes away if targetedSequences object is converted to a GRanges object (as done in the filterByTargetedSequences method in utils.R) prior to passing it to loadReadCountsFromWig in runIchorCNA.R. This also necessitates removing the conversion of targetedSequences to a GRanges object on line 175 in the filterByTargetedSequences method in util.R.

Is this behavior of the script the product of an issue on my end requiring some lines of code be moved around?

gavinha commented 5 years ago

Hi @MUppal

Thanks for bringing this up and pointing out where the problem is. I forgot to run my unit test cases for targeted capture analysis. Hopefully this patch fixes this. Please let me know if there are additional problems.

Best, Gavin

blackbeerd commented 3 years ago

I am having the same issue using version 0.2.0-0 - is there a fix for this?

Thanks, Chris