PyVCF icon indicating copy to clipboard operation
PyVCF copied to clipboard

Bug in _SingleBreakEnd handling

Open seandavi opened this issue 11 years ago • 1 comments

The VCF line of interest is:

chr8    145739175   .   C   CCTGTGCG    .   QSI_ref IC=1;IHP=5;NT=ref;QSI=8;QSI_NT=8;RC=0;RU=CTGTGCG;SGT=ref->het;SOMATIC;TQSI=1;TQSI_NT=1  DP:DP2:TAR:TIR:TOR:DP50:FDP50:SUBDP50   11:11:9,10:0,0:3,4:16.68:0.63:0.00  27:27:18,21:4,9:7,4:43.9:1.77:0.00

The stack trace is:

  File "/gpfs/gsfs2/users/sdavis2/Documents/git/PyVCF/build/lib.linux-x86_64-3.3/vcf/parser.py", line 504, in __next__
    alt = self._map(self._parse_alt, row[4].split(','))
  File "/gpfs/gsfs2/users/sdavis2/Documents/git/PyVCF/build/lib.linux-x86_64-3.3/vcf/parser.py", line 312, in _map
    for x in iterable]
  File "/gpfs/gsfs2/users/sdavis2/Documents/git/PyVCF/build/lib.linux-x86_64-3.3/vcf/parser.py", line 312, in <listcomp>
    for x in iterable]
  File "/gpfs/gsfs2/users/sdavis2/Documents/git/PyVCF/build/lib.linux-x86_64-3.3/vcf/parser.py", line 483, in _parse_alt
    return _SingleBreakend(False, str[:-1])
  File "/gpfs/gsfs2/users/sdavis2/Documents/git/PyVCF/build/lib.linux-x86_64-3.3/vcf/model.py", line 512, in __init__
    super(_SingleBreakend, self).__init__(None, None, orientation, None, connectingSequence, None, **kwargs)
  File "/gpfs/gsfs2/users/sdavis2/Documents/git/PyVCF/build/lib.linux-x86_64-3.3/vcf/model.py", line 467, in __init__
    self.pos = int(pos)
TypeError: int() argument must be a string or a number, not 'NoneType'

The issue seems to be that _SingleBreakend.init calls:

    super(_SingleBreakend, self).__init__(None, None, orientation, None, connectingSequence, None, **kwargs)

But _Breakend needs the chromosome and position as the first two arguments (that should be string and int, respectively). I'm not sure how this is supposed to be handled, though, so I am not sure what fix to make.

seandavi avatar Sep 06 '13 21:09 seandavi

Hi Sean,

I'm a bit confused since the VCF record you quote is not a breakend and as such is not modeled using _SingleBreakend.

Perhaps the error comes from another record in your file, but it might be fixed with #126. Could you check this?

(I've never really worked with SVs in VCF files, so I might be missing something here.)

martijnvermaat avatar Nov 06 '13 17:11 martijnvermaat