Skip to content

Commit

Permalink
Merge pull request #249 from ernfrid/classifier_pos
Browse files Browse the repository at this point in the history
Update POS field in INFO when creating BNDs
  • Loading branch information
ernfrid committed Mar 9, 2018
2 parents a388644 + 8b5cd13 commit 8b054fe
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 19 deletions.
1 change: 1 addition & 0 deletions svtools/sv_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def to_bnd_strings(var, fixed_gts):
var.info['CIPOS95'] = old_ciend95
var.info['CIEND95'] = old_cipos95
var.pos = old_end
var.info['POS'] = old_end
var.info['SECONDARY'] = True
if old_type == 'DEL':
var.alt = ']%s:%s]N' % (var.chrom, old_pos)
Expand Down
28 changes: 9 additions & 19 deletions tests/reclassifier_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,10 @@ def test_integration_nb(self):
expected_lines[1] = '##fileDate=' + time.strftime('%Y%m%d') + '\n'
produced_lines = open(temp_output_path).readlines()
diff = difflib.unified_diff(produced_lines, expected_lines, fromfile=temp_output_path, tofile=expected_result)
os.remove(temp_output_path)
os.remove(diags_file)
result = ''.join(diff)
if result != '':
for line in result:
sys.stdout.write(line)
self.assertFalse(result)
os.remove(temp_output_path)
os.remove(diags_file)
self.assertEqual(result, '')

def test_integration_ls(self):
test_directory = os.path.dirname(os.path.abspath(__file__))
Expand All @@ -62,13 +59,10 @@ def test_integration_ls(self):
expected_lines[1] = '##fileDate=' + time.strftime('%Y%m%d') + '\n'
produced_lines = open(temp_output_path).readlines()
diff = difflib.unified_diff(produced_lines, expected_lines, fromfile=temp_output_path, tofile=expected_result)
os.remove(temp_output_path)
os.remove(diags_file)
result = ''.join(diff)
if result != '':
for line in result:
sys.stdout.write(line)
self.assertFalse(result)
os.remove(temp_output_path)
os.remove(diags_file)
self.assertEqual(result, '')



Expand All @@ -92,14 +86,10 @@ def test_integration_hyb(self):
expected_lines[1] = '##fileDate=' + time.strftime('%Y%m%d') + '\n'
produced_lines = open(temp_output_path).readlines()
diff = difflib.unified_diff(produced_lines, expected_lines, fromfile=temp_output_path, tofile=expected_result)
os.remove(temp_output_path)
os.remove(diags_file)
result = ''.join(diff)
if result != '':
for line in result:
sys.stdout.write(line)
self.assertFalse(result)
os.remove(temp_output_path)
os.remove(diags_file)

self.assertEqual(result, '')


if __name__ == "__main__":
Expand Down
Binary file modified tests/test_data/sv_classifier/output.hyb.vcf.gz
Binary file not shown.
Binary file modified tests/test_data/sv_classifier/output.ls.vcf.gz
Binary file not shown.
Binary file modified tests/test_data/sv_classifier/output.nb.vcf.gz
Binary file not shown.

0 comments on commit 8b054fe

Please sign in to comment.