mskilab-org / JaBbA

MIP based joint inference of copy number and rearrangement state in cancer whole genome sequence data.
MIT License
56 stars 26 forks source link

JaBbA crashes when DNAcopy::segment returns reverse strand segments #19

Closed pwaltman closed 1 year ago

pwaltman commented 5 years ago

I suspect that this is a problem on the side of DNAcopy, and it's an issue I ran into when I was working on getting the fragCounter module going; but for whatever reason, DNAcopy::segment (called on line 690 in JaBbA.R) is returning segments where the $out$loc.end value is les than $out$loc.start. This, in turn, causes an error when seq2gr is called on line 696.

I don't understand why it is doing this as none of the ranges in my coverage object have negative lengths. It's just something that DNAcopy::CNA or DNAcopy::segment is doing. The quick workaround is something like this:

            if ( any ( seg$out$loc.end < seg$out$loc.start ) ) {
                whch <- which( seg$out$loc.end < seg$out$loc.start )
                whchBak <- seg$out$loc.start[ whch ]
                seg$out$loc.start[whch] <- seg$out$loc.end[ whch ]
                seg$out$loc.end[ whch ] <- whchBak
            }
xtYao commented 5 years ago

Could you provide partially your coverage input data, particularly the part where this negative width segment is produced? Maybe send me a Dropbox link. We've never seen this error before.

pwaltman commented 5 years ago

Sure. I'll post it to Dropbox, and will PM you a link

On Mon, Jan 21, 2019 at 6:05 PM Xiaotong Yao notifications@github.com wrote:

Could you provide partially your coverage input data, particularly the part where this negative width segment is produced? Maybe send me a Dropbox link. We've never seen this error before.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mskilab/JaBbA/issues/19#issuecomment-456220815, or mute the thread https://github.com/notifications/unsubscribe-auth/ABNw167hrNowJILEZcYlGZPmKVvjOkBLks5vFke-gaJpZM4aKGCG .

pwaltman commented 5 years ago

Done. I've sent you the link to a tar.bz2 file which contains the cov.rds, as well as the scripts I used to generate the files for fragCounter.