def write_16S_rRNA_fasta(self, org_list):
fasta = []<EOL>for org in org_list:<EOL><INDENT>handle = open(org.genome_path, "<STR_LIT>")<EOL>seq_record = SeqIO.read(handle, "<STR_LIT>")<EOL>for feat in seq_record.features:<EOL><INDENT>if feat.type == '<STR_LIT>':<EOL><INDENT>if '<STR_LIT>' in feat.qualifiers['<STR_LIT>'][<NUM_LIT:0>]:<EOL><INDENT>start = feat.location.start.position<EOL>end = feat.location.end.position<EOL>if ((end - start) > <NUM_LIT>) & ((end - start) < <NUM_LIT>) :<EOL><INDENT>print('<STR_LIT>', org.accession)<EOL>fasta.append('<STR_LIT:>>' + org.accession +<EOL>'<STR_LIT:\n>' + <EOL>str(feat.extract(seq_record.seq)) +<EOL>'<STR_LIT:\n>')<EOL>org.rRNA16S_sequence = str(feat.extract(seq_record.seq))<EOL>break<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>faastring = "<STR_LIT>".join(fasta)<EOL>filename = '<STR_LIT>'<EOL>write_fasta = open(filename, '<STR_LIT:w>')<EOL>write_fasta.write(faastring)<EOL>write_fasta.close()<EOL>
Writes a fasta file containing 16S rRNA sequences
for a list of Organism objects,

The first 16S sequence found in the seq record object is used,
since it looks like there are duplicates