Commits

Davide Cittaro committed f48b956

bugfix in markvcf when chromosomes are not in the annotation file

Comments (0)

Files changed (2)

   for record in vcf_file:
     chrom = record.CHROM
     this_snp = "%s:%d-%s-%s-%s" % (record.CHROM, record.POS, record.ID, record.REF, record.ALT)
-    if not gene_props[chrom]:
+    if not gene_props.has_key(chrom) or not gene_props[chrom]:
       # no need to process, just write
       vcf_out.write_record(record)
     else:
     return_effs.append(longest_gene_eff)
 
   # return the effect list, sorted by priority
-  return sorted(return_effs)
+  return return_effs
+  #return sorted(return_effs, reverse=True)