def trim_range(data_file):
logger.debug("<STR_LIT>")<EOL>target_nuc_bias = "<STR_LIT>"<EOL>logger.debug("<STR_LIT>"<EOL>"<STR_LIT:{}>".format(target_nuc_bias))<EOL>gather = False<EOL>biased = []<EOL>with open(data_file) as fh:<EOL><INDENT>for line in fh:<EOL><INDENT>if line.startswith(target_nuc_bias):<EOL><INDENT>logger.debug("<STR_LIT>".format(line))<EOL>next(fh)<EOL>gather = True<EOL><DEDENT>elif line.startswith("<STR_LIT>") and gather:<EOL><INDENT>logger.debug("<STR_LIT>".format(line))<EOL>break<EOL><DEDENT>elif gather:<EOL><INDENT>g, a, t, c = [float(x) for x in line.strip().split()[<NUM_LIT:1>:]]<EOL>gc = (g + <NUM_LIT:0.1>) / (c + <NUM_LIT:0.1>)<EOL>at = (a + <NUM_LIT:0.1>) / (t + <NUM_LIT:0.1>)<EOL>if <NUM_LIT> <= gc <= <NUM_LIT> and <NUM_LIT> <= at <= <NUM_LIT>:<EOL><INDENT>biased.append(False)<EOL><DEDENT>else:<EOL><INDENT>biased.append(True)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>logger.debug("<STR_LIT>".format(biased))<EOL>biased_5end, biased_3end = biased[:int(len(biased)/<NUM_LIT:2>)],biased[int(len(biased)/<NUM_LIT:2>):][::-<NUM_LIT:1>]<EOL>logger.debug("<STR_LIT>")<EOL>trim_nt = [<NUM_LIT:0>, <NUM_LIT:0>]<EOL>trim_nt[<NUM_LIT:0>] = get_trim_index(biased_5end)<EOL>logger.debug("<STR_LIT>".format(trim_nt[<NUM_LIT:0>]))<EOL>trim_nt[<NUM_LIT:1>] = len(biased) - get_trim_index(biased_3end)<EOL>logger.debug("<STR_LIT>".format(trim_nt[<NUM_LIT:1>]))<EOL>return trim_nt<EOL>
Assess the optimal trim range for a given FastQC data file.

    This function will parse a single FastQC data file, namely the
    *'Per base sequence content'* category. It will retrieve the A/T and G/C
    content for each nucleotide position in the reads, and check whether the
    G/C and A/T proportions are between 80% and 120%. If they are, that
    nucleotide position is marked as biased for future removal.

    Parameters
    ----------
    data_file: str
        Path to FastQC data file.

    Returns
    -------
    trim_nt: list
        List containing the range with the best trimming positions for the
        corresponding FastQ file. The first element is the 5' end trim index
        and the second element is the 3' end trim index.