PapenfussLab / StructuralVariantAnnotation

R package designed to simplify structural variant analysis
GNU General Public License v3.0
69 stars 14 forks source link

Error: nrow of `region1` and `region2` differ. #27

Closed adbeggs closed 4 years ago

adbeggs commented 4 years ago

Hi

Great piece of software.. trying to follow the vignette but having lots of problems with my Manta derived SV calls.

candidateSV.zip

vcf1 <- VariantAnnotation::readVcf("candidateSV.vcf","hg19")
gr <- breakpointRanges(vcf1)
gr_chr <- gr
seqlevelsStyle(gr_chr) <- "UCSC"
pairs <- breakpointgr2pairs(gr_chr)
library(circlize)
circos.initializeWithIdeogram()
circos.genomicLink(as.data.frame(S4Vectors::first(pairs)), as.data.frame(S4Vectors::second(pairs)))

Then get the error:

"Error: nrow of 'region 1' and 'region 2' differ

I've done a sanity check and confirmed that the number of rows is the same so don't quite understand the error really - it might me something I'm missing.

Thank you!

Andrew

d-cameron commented 4 years ago

I got this error myself a while back and it was annoying to debug.

The error is with circlize and it crashs if you have a breakpoint between a contig it knows about and a contig it ignores. In your case, it's the 6 NUMT-like calls between MT and autosomes.

The workaround is to remove them:

gr_chr = gr_chr[seqnames(gr_chr) %in% c(1:22,"X","Y")]
gr_chr = gr_chr[names(gr_chr) %in% gr_chr$partner]

You should raise this issue with circlize.