def add_protein_to_organisms(self, orgprot_list):
for org in self.organisms:<EOL><INDENT>handle = open(org.genome_path, "<STR_LIT>")<EOL>print('<STR_LIT>', org.accession)<EOL>try:<EOL><INDENT>seq_record = SeqIO.read(handle, "<STR_LIT>")<EOL>feature_list = []<EOL>for id in orgprot_list:<EOL><INDENT>org_id = id.split('<STR_LIT:U+002C>')[<NUM_LIT:0>]<EOL>prot_id = id.split('<STR_LIT:U+002C>')[<NUM_LIT:1>]<EOL>if org.accession == org_id:<EOL><INDENT>for feature in seq_record.features:<EOL><INDENT>if feature.type == '<STR_LIT>':<EOL><INDENT>feat_prot_acc = feature.qualifiers['<STR_LIT>'][<NUM_LIT:0>]<EOL>if feat_prot_acc == prot_id:<EOL><INDENT>org.proteins.append(Protein(feature))<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>del(seq_record)<EOL><DEDENT>except ValueError as e:<EOL><INDENT>print('<STR_LIT>', org.accession, str(e))<EOL><DEDENT>except AssertionError as e:<EOL><INDENT>print('<STR_LIT>', org.accession, str(e))<EOL><DEDENT>except UnboundLocalError as e:<EOL><INDENT>print('<STR_LIT>', org.accession, str(e))<EOL><DEDENT>except KeyError as e:<EOL><INDENT>print('<STR_LIT>', org.accession, str(e))<EOL><DEDENT>handle.close()<EOL><DEDENT>
Protein factory method.

Iterates through a list of SearchIO hit objects, matches
the accession against SeqRecord features for each organism.
If there is a match, the new Protein object is created and
stored in the protein list of that Organism.

Args
    orgprot_list: a list Biopython SearchIO hit objects (I think).