[Bio] / Babel / bin / source2ach.py Repository:
ViewVC logotype

Diff of /Babel/bin/source2ach.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2, Wed Sep 22 15:04:24 2010 UTC revision 1.3, Thu Oct 7 19:27:00 2010 UTC
# Line 99  Line 99 
99              cdesc = rec.description.rstrip('.')              cdesc = rec.description.rstrip('.')
100              clen  = len(rec.seq)              clen  = len(rec.seq)
101              org   = rec.annotations['organism']              org   = rec.annotations['organism']
102                # only one entry on rec (first feat is source and is not a feature), use first real feature, no contig data
103                if len(rec.features) == 2:
104                    md5  = hashlib.md5(str(rec.seq)).hexdigest()
105                    func = ''
106                    if 'product' in rec.features[1].qualifiers:
107                        func = rec.features[1].qualifiers['product'][0]
108                    seq_f.write("%s\t%s\n" %(md5, rec.seq))
109                    data_f.write("\t".join([md5, rec.name, func, org, source]) + "\n")
110                    return
111                # multiple entries on rec, use CDS features, get contig data
112              for feat in rec.features:              for feat in rec.features:
113                  if feat.type == 'CDS':                  if feat.type == 'CDS':
114                      if ( (not feat.qualifiers) or (not feat.location) or                      if ( (not feat.qualifiers) or (not feat.location) or

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3