Question: svtyper tool: ValueError: mate not found
gravatar for iraun
2.9 years ago by
iraun3.3k wrote:

Hi there,
I'm using svtyper ( in order to get the genotype of some structural variants called using Lumpy. Svtyper starts running and everything seems OK until it arrives to a specific variant of the input vcf file. At this record, svtyper crashes with the following error:

File "pysam/calignmentfile.pyx", line 836, in pysam.calignmentfile.AlignmentFile.mate (pysam/calignmentfile.c:10945)
ValueError: mate not found

svtyper calls pysam at some point to get the mate pairs. I've read the code of pysam, and this is what I've found:

Throws a ValueError if read is unpaired or the mate is unmapped.

So, I think that svtyper crashes due to the presence of a read with unmapped mate supporting the SV. If this is the true reason of the error, does this make sense? I mean, I'm interested also in those reads which their mate is unmapped, this is a good pointer about the presence of a SV in that position, isn't it?

Any ideas?


ADD COMMENTlink modified 2.5 years ago by wjar67180 • written 2.9 years ago by iraun3.3k
gravatar for iraun
2.8 years ago by
iraun3.3k wrote:

Well, I did not know where the problem comes from but I found a "temporary" solution just in case that anyone is struggling to get this.
Using samblaster tool (available here: with --addMateTags, mate tags (MC, MQ) are added to the bam file. Without them, svtyper must seek to the corresponding mate position in the bam file. Using this approach, svtyper and therefore pysam, works nice without any error, and also, faster.

ADD COMMENTlink written 2.8 years ago by iraun3.3k
gravatar for wjar6718
2.5 years ago by
wjar67180 wrote:

Now just add -M flag in svtyper!


ADD COMMENTlink written 2.5 years ago by wjar67180
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1604 users visited in the last hour