def _extract_from_raw_reads(self, output_path, input_reads, raw_sequences_path, input_file_format, hits):
with tempfile.NamedTemporaryFile(prefix='<STR_LIT>') as tmp:<EOL><INDENT>fxtract_cmd = "<STR_LIT>" <EOL>if input_file_format == FORMAT_FASTA:<EOL><INDENT>cmd = "<STR_LIT>" % (fxtract_cmd, raw_sequences_path, tmp.name)<EOL><DEDENT>elif input_file_format == FORMAT_FASTQ_GZ:<EOL><INDENT>cmd = "<STR_LIT>" % (fxtract_cmd, raw_sequences_path, tmp.name)<EOL><DEDENT>elif input_file_format == FORMAT_FASTA_GZ:<EOL><INDENT>cmd = "<STR_LIT>" % (fxtract_cmd, raw_sequences_path, tmp.name)<EOL><DEDENT>elif input_file_format == FORMAT_FASTQ:<EOL><INDENT>cmd = "<STR_LIT>" % (fxtract_cmd, raw_sequences_path, tmp.name)<EOL><DEDENT>else:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>process = subprocess.Popen(["<STR_LIT>", "<STR_LIT:-c>", cmd], <EOL>stdin=subprocess.PIPE,<EOL>stdout=subprocess.PIPE)<EOL>process.communicate('<STR_LIT:\n>'.join(input_reads))<EOL>complement_info = self._extract_multiple_hits(hits, tmp.name, output_path)  <EOL><DEDENT>return output_path, complement_info<EOL>
_extract_from_raw_reads - call fxtract to extract the hit sequences
of the hmm/diamond search from the raw sequences file. Output into
specified file

Parameters
----------
output_path : str
    Path of the desired output file
input_reads : list
    list of read IDS to extract.
raw_sequences_path : str
    Path to the raw sequences
input_file_format : var
    Variable, either FORMAT_FASTA_GZ, FORMAT_FASTQ_GZ, FORMAT_FASTQ or
    FORMAT_FASTA, denoting the format of the input sequence
hits : dict
    A hash with the readnames as the keys and the spans as the values

Returns
-------
output_path: str
    Path to file containing extracted reads.

direction_information: dict

    {read_1: False
     ...
     read n: True}

    where True = Forward direction
    and False = Reverse direction