comparison snpEff_cds_report.py @ 4:429a6b4df5e5

Restrict to info items that are key=value pairs
author Jim Johnson <jj@umn.edu>
date Wed, 24 Apr 2013 08:00:04 -0500
parents 15a54fa11ad7
children 85b933b7d231
comparison
equal deleted inserted replaced
3:57edf4d08816 4:429a6b4df5e5
741 if options.debug: print >> sys.stdout, "alt: %s from: %s" % (alt,alts) 741 if options.debug: print >> sys.stdout, "alt: %s from: %s" % (alt,alts)
742 if not re.match('^[ATCG]*$',alt): 742 if not re.match('^[ATCG]*$',alt):
743 print >> sys.stdout, "only simple variant currently supported, ignoring: %s:%s %s\n" % (chrom,pos,alt) 743 print >> sys.stdout, "only simple variant currently supported, ignoring: %s:%s %s\n" % (chrom,pos,alt)
744 for info_item in info.split(';'): 744 for info_item in info.split(';'):
745 try: 745 try:
746 if info_item.find('=') < 0:
747 continue
746 (key,val) = info_item.split('=',1) 748 (key,val) = info_item.split('=',1)
747 if key == 'SAF': # Usually a SAF for each variant: if A,AG then SAF=0.333333333333333,SAF=0.333333333333333; 749 if key == 'SAF': # Usually a SAF for each variant: if A,AG then SAF=0.333333333333333,SAF=0.333333333333333;
748 freqs = info_item.split(',') 750 freqs = info_item.split(',')
749 (k,v) = freqs[idx].split('=',1) 751 (k,v) = freqs[idx].split('=',1)
750 freq = v 752 freq = v