SURVIVOR icon indicating copy to clipboard operation
SURVIVOR copied to clipboard

SVLEN incorrectly printed

Open pauline-ng opened this issue 2 years ago • 1 comments

Hi,

I'm using SURVIVOR merge. SVLEN is sometimes printed incorrectly. In the example below, SVLEN=-746471 becomes SVLEN=-46471; the first digit '7' is dropped.

I'm merging multiple files. In the example below, this SV was in one of the files. (SURVIVOR didn't have to merge it with another CNV, just needed to copy it directly).

In the input file 1 148771620 . T <DEL> . LowQual SVLEN=-746471;SVTYPE=DEL;END=149518091 GT:ABC:PE:REFCOUNTS 0/1:0,0,1:1:10,23

After survivor merge: 1 148771620 . T <DEL> . PASS SUPP=1;SUPP_VEC=000100;SVLEN=-46471;SVTYPE=DEL;SVMETHOD=SURVIVOR1.0.7;CHR2=1;END=149518091;CIPOS=0,0;CIEND=0,0;STRANDS=+- GT:PSV:LN:DR:ST:QV:TY:ID:RAL:AAL:CO ./.:NaN:0:0,0:--:NaN:NaN:NaN:NAN:NAN:NAN ./.:NaN:0:0,0:--:NaN:NaN:NaN:NAN:NAN:NAN./.:NaN:0:0,0:--:NaN:NaN:NaN:NAN:NAN:NAN 0/1:NA:46471:0,0:+-:.:DEL:.:NA:NA:1_148771620-1_149518091 ./.:NaN:0:0,0:--:NaN:NaN:NaN:NAN:NAN:NAN ./.:NaN:0:0,0:--:NaN:NaN:NaN:NAN:NAN:NAN

pauline-ng avatar Sep 07 '21 01:09 pauline-ng

I'm encountering the same issue. My VCF don't contain an END field, though. Survivor will calculate this based on the SVLEN, but since the SVLEN is incorrect it ends up getting the wrong END value as well. As a result the merging gets messed up as well.

Here's some examples. The ids here are made using the chr, start and end as determined by bcftools: original lines:

1       45557140        clever_1_45557140_45564557 [...] SVLEN=-7417;SVTYPE=DEL;GCF=0.407118;AC=2;AN=2 [...]
1       44876963        clever_1_44876963_44878120 [...] SVLEN=-1157;SVTYPE=DEL;GCF=0.378238;AC=2;AN=2 [...]

survivor output:

1       45557140        clever_1_45557140_45564557 [...] SUPP=1;SUPP_VEC=00100;SVLEN=-417;SVTYPE=DEL;SVMETHOD=SURVIVOR1.0.7;CHR2=1;END=45557557;CIPOS=0,0;CIEND=0,0;STRANDS=+- [...]
1       44876963        clever_1_44876963_44878120 [...] SUPP=1;SUPP_VEC=00100;SVLEN=-157;SVTYPE=DEL;SVMETHOD=SURVIVOR1.0.7;CHR2=1;END=44877120;CIPOS=0,0;CIEND=0,0;STRANDS=+- [...]

It looks like the issue arises out of this line of code: https://github.com/fritzsedlazeck/SURVIVOR/blob/a2b89593f4cb2ba865d79a601487765b71ce3b5d/src/vcfs/Merge_VCF.cpp#L798 The + 8 should be + 6 I think:

i:-10123456789
  \tSVLEN=-123
            -- # this gets passed to atoi now
          ---- # this should be getting passed to atoi

DavyCats avatar Sep 14 '22 15:09 DavyCats