def extract_forward_and_reverse_complement(<EOL>self, forward_reads_to_extract, reverse_reads_to_extract, database_fasta_file,<EOL>output_file):
self.extract(forward_reads_to_extract, database_fasta_file, output_file)<EOL>cmd_rev = "<STR_LIT>" % database_fasta_file<EOL>output = extern.run(cmd_rev, stdin='<STR_LIT:\n>'.join(reverse_reads_to_extract))<EOL>with open(output_file, '<STR_LIT:a>') as f:<EOL><INDENT>for record in SeqIO.parse(StringIO(output), '<STR_LIT>'):<EOL><INDENT>record.seq = record.reverse_complement().seq<EOL>SeqIO.write(record, f, '<STR_LIT>')<EOL><DEDENT><DEDENT>
As per extract except also reverse complement the sequences.