[BioPython] SwissProt.SProt parser improvement

Jeffrey Chang jchang at jeffchang.com
Fri Jun 20 12:18:58 EDT 2003


Hi Andreas,

Thanks for the patch!  I've committed it, and the changes will be 
available in the CVS soon.  I made some small fixes to a couple of the 
diff-lets:

529,530c528,529
<         if string.find(uprline, 'CREATED') >= 0:
<             cols = string.split(line)
---
 >         cols = line.split()
 >         if uprline.find(uprline) >= 0:

uprline.find('CREATED')


594,595c591,592
<             ids = string.split(line, ',')
<         self.data.taxonomy_id.extend(map(string.strip, ids))
---
 >             ids = line.split(',')
 >         self.data.taxonomy_id.extend([id.strip for id in ids])

self.data.taxonomy_id.extend([id.strip() for id in ids])



728,731c724,726
<         cols = string.split(self._chomp(string.rstrip(line[5:])), ';')
<         for col in cols:
<             self.data.keywords.append(string.lstrip(col))
<
---
 >         cols = self._chomp(line[5:].rstrip()).split(';')
 >         self.data.keywords.extend([c.lstrip for c in cols])
 >

self.data.keywords.extend([c.lstrip() for c in cols])


Jeff



On Friday, June 20, 2003, at 07:26  AM, Andreas Kuntzagk wrote:

> Hi,
>
> I have added code to the parser to get the FeatureId (FTId) where it
> exists. Also replaced all occurences of the module string whith the
> functions for the string type. Makes for more readable code.
>
> Feel free to use or throw away
>
> Andreas
>
>
>
> _______________________________________________
> BioPython mailing list  -  BioPython at biopython.org
> http://biopython.org/mailman/listinfo/biopython



More information about the BioPython mailing list