def _extract_orfs(self, input_path, orfm, hit_readnames, output_path, search_method, sequence_frame_info_list=None):
if search_method == "<STR_LIT>":<EOL><INDENT>orfm_cmd = orfm.command_line()<EOL>cmd = '<STR_LIT>' % (orfm_cmd, input_path, output_path)<EOL>process = subprocess.Popen(["<STR_LIT>", "<STR_LIT:-c>", cmd],<EOL>stdin=subprocess.PIPE,<EOL>stdout=subprocess.PIPE)<EOL>process.communicate('<STR_LIT:\n>'.join(hit_readnames))<EOL><DEDENT>elif search_method == "<STR_LIT>":<EOL><INDENT>sequence_frame_info_dict = {x[<NUM_LIT:0>]:[x[<NUM_LIT:1>], x[<NUM_LIT:2>], x[<NUM_LIT:3>]] for x in sequence_frame_info_list}<EOL>records = SeqIO.parse(input_path, "<STR_LIT>")<EOL>with open(output_path, '<STR_LIT:w>') as open_output_path:<EOL><INDENT>for record in records:<EOL><INDENT>entry=sequence_frame_info_dict[record.id]<EOL>indfrom=(min(entry[<NUM_LIT:2>], entry[<NUM_LIT:1>])-<NUM_LIT:1>)<EOL>indto=max(entry[<NUM_LIT:2>], entry[<NUM_LIT:1>])<EOL>if entry[<NUM_LIT:0>] == False:<EOL><INDENT>record.seq = max([x for x in record.seq[indfrom:indto].reverse_complement().translate().split("<STR_LIT:*>")], key=len)<EOL><DEDENT>else:<EOL><INDENT>record.seq = max([x for x in record.seq[indfrom:indto].translate().split("<STR_LIT:*>")], key=len)<EOL><DEDENT>SeqIO.write(record, open_output_path, "<STR_LIT>")<EOL><DEDENT>open_output_path.flush()<EOL><DEDENT><DEDENT>
Call ORFs on a file with nucleotide sequences and extract the proteins
whose name is in `hit_readnames`.

Parameters
----------
input_path : str
    Path to input nucleotide sequences in FASTA format.
orfm: obj
    graftm.OrfM object with parameters already set
hit_readnames : str
    path to a file containin the readnames of hits to the HMM, one per
    line.
output_path : str
    Path to output orfs into, in FASTA format.
search_method : str
    The method for searching, either 'hmmsearch' or 'diamond'
sequence_frame_info : list
    A dataframe (list of lists) containing readname, alignment direction
    and alignment start point information