changeset 3:402c3f0fe807

Uploaded revised vcf_gff.py from Github to fix bug
author john-mccallum
date Thu, 18 Oct 2012 17:54:38 -0400
parents ea2117a7b363
children be070a68521e
files vcf_gff.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/vcf_gff.py	Sun Sep 09 23:16:56 2012 -0400
+++ b/vcf_gff.py	Thu Oct 18 17:54:38 2012 -0400
@@ -110,7 +110,7 @@
                 gen = "HOM_ref"
         else:
             gen = "NA"
-        geno = ("%s:%s;" % (reads, gen))
+        geno = ("%s:%s " % (reads, gen))
         genos += geno
         sample_dict = {}
     return genos
@@ -120,6 +120,7 @@
 Get relevant info from vcf file and put to proper gff columns
 """
 
+out_gff_file.write("#gff-version 3\n")
 for line in in_vcf_file:
     if line.startswith("#") == False:
         info = line.split()
@@ -141,7 +142,7 @@
         gen = get_gen(info[8:], reference)
         out_gff_file.write(
             ("%s\t%s\t%s\t%d\t%d\t%s\t%s\t%s\tID=%s:%s:%d;Variant" +
-             "_seq=%s;Reference_seq=%s;Total_reads=%s:Zygosity=%s\n") %
+             "_seq=%s;Reference_seq=%s;Total_reads=%s;Zygosity=%s\n") %
             ( seqid, source,record_type, start, end, score, strand, phase,seqid, 
               record_type, start, variant, reference, reads, gen))