Skip to content
Snippets Groups Projects
Commit d094cf4d authored by Vermaat's avatar Vermaat
Browse files

Fix reverse complement of number parameter in position converter

git-svn-id: https://humgenprojects.lumc.nl/svn/mutalyzer/trunk@420 eb6bd6ab-9ccd-42b9-aceb-e2899b4a52f1
parent ad0860e5
No related branches found
No related tags found
No related merge requests found
......@@ -581,8 +581,14 @@ class Converter(object) :
if revc :
# todo: if var.Arg1 is unicode, this crashes
arg1 = reverse_complement(var.Arg1 or "") #imported from Bio.Seq
arg2 = reverse_complement(var.Arg2 or "")
try:
arg1 = str(int(var.Arg1))
except ValueError:
arg1 = reverse_complement(var.Arg1 or "")
try:
arg2 = str(int(var.Arg2))
except ValueError:
arg2 = reverse_complement(var.Arg2 or "")
#if
else :
arg1 = var.Arg1
......
......@@ -50,3 +50,13 @@ class TestConverter():
assert_equal(genomic, 'NC_000006.11:g.32006291C>T')
coding = converter.chrom2c(genomic, 'list')
assert 'NM_000500.5:c.92C>T' in coding
def test_converter_del_length_reverse(self):
"""
Position converter on deletion (denoted by length) on transcripts
located on the reverse strand.
"""
converter = self._converter('hg19')
coding = converter.chrom2c('NC_000022.10:g.51016285_51017117del123456789', 'list')
assert 'NM_001145134.1:c.-138-u21_60del123456789' in coding
assert 'NR_021492.1:c.1-u5170_1-u4338del123456789' in coding
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment