diff defuse_results_to_vcf.py @ 34:3099cec648e7

Update tool_dependencies, add help
author Jim Johnson <jj@umn.edu>
date Tue, 15 Oct 2013 17:02:23 -0500
parents 8027fc53f3f9
children
line wrap: on
line diff
--- a/defuse_results_to_vcf.py	Fri Sep 06 08:20:41 2013 -0500
+++ b/defuse_results_to_vcf.py	Tue Oct 15 17:02:23 2013 -0500
@@ -97,6 +97,8 @@
 ##INFO=<ID=SVLEN,Number=.,Type=Integer,Description="Difference in length between REF and ALT alleles">
 ##INFO=<ID=SVTYPE,Number=1,Type=String,Description="Type of structural variant">
 ##INFO=<ID=MATEID,Number=1,Type=String,Description="ID of the BND mate">
+##INFO=<ID=MATELOC,Number=1,Type=String,Description="The chrom:position of the BND mate">
+##INFO=<ID=GENESTRAND,Number=2,Type=String,Description="Strands">
 ##INFO=<ID=DP,Number=1,Type=Integer,Description="Read Depth of segment containing breakend">
 ##INFO=<ID=SPLITCNT,Number=1,Type=Integer,Description="number of split reads supporting the prediction">
 ##INFO=<ID=SPANCNT,Number=1,Type=Integer,Description="number of spanning reads supporting the fusion">
@@ -255,8 +257,8 @@
         info.append('EVERSION')
       if inversion:
         info.append('INVERSION')
-      info1 = [svtype,'MATEID=%s' % mate_id2] + info
-      info2 = [svtype,'MATEID=%s' % mate_id1] + info
+      info1 = [svtype,'MATEID=%s;MATELOC=%s:%d' % (mate_id2,gene_chromosome2,genomic_break_pos2)] + info
+      info2 = [svtype,'MATEID=%s;MATELOC=%s:%d' % (mate_id1,gene_chromosome1,genomic_break_pos1)] + info
       qual = int(float(fields[columns.index('probability')]) * 255) if columns.index('probability') else '.'
       vcf1 = '%s\t%d\t%s\t%s\t%s\t%s\t%s\t%s'% (gene_chromosome1,genomic_break_pos1, mate_id1, ref1, alt1, qual, filt, ';'.join(info1) )
       vcf2 = '%s\t%d\t%s\t%s\t%s\t%s\t%s\t%s'% (gene_chromosome2,genomic_break_pos2, mate_id2, ref2, alt2, qual, filt, ';'.join(info2) )
@@ -265,7 +267,7 @@
     write_vcf()
   except Exception, e:
     print >> sys.stderr, "failed: %s" % e
-    exit(1)
+    sys.exit(1)
 
 if __name__ == "__main__" : __main__()