<div dir="ltr">hey guys<div><br></div><div>i have this file i wish to parse, the file looks something like bellow. there are only four entry here (AaaI, AacLI, AaeI, AagI). the complete file contains thousands of entries</div>
<div><br></div><div><div>    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=</div><div>    REBASE, The Restriction Enzyme Database   <a href="http://rebase.neb.com">http://rebase.neb.com</a></div><div>
    Copyright (c)  Dr. Richard J. Roberts, 2014.   All rights reserved.</div><div>    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=</div><div> </div><div>Rich Roberts                                                    Jan 30 2014</div>
<div> </div><div>AaaI (XmaIII)                     C^GGCCG</div><div>AacLI (BamHI)                     GGATCC</div><div>AaeI (BamHI)                      GGATCC</div><div>AagI (ClaI)                       AT^CGAT</div><div>
<br></div><div><br></div><div>the strategy was to mark the string 'Rich Roberts' as the start. i wrote the following function. but then i realized i couldn't do something like .next() to the var in_file which is a list. so i added a flag start = False in which will be turned to True upon 'Rich Roberts' found. is the any simpler way to move to the next element in the list. like built in method or something like that. </div>
<div><br></div><div><div>def read_bionet(bionetfile):</div><div>  res_enzime_dict = {}</div><div>  in_file = open(bionetfile, 'r').readlines()</div><div>  start = False</div><div>  for line in in_file:</div><div>    if line.startswith('Rich Roberts'):</div>
<div>      start = True</div><div>    if start and len(line) >= 10:</div><div>        line = line.split()</div><div>        res_enzime_dict[line[0]] = line[-1]</div><div>  return res_enzime_dict</div></div><div><br></div>
<div><br></div>-- <br><font face="'courier new', monospace">many thanks</font><div><font face="'courier new', monospace">mat</font></div>
</div></div>