def parse_log(log_file):
template = OrderedDict([<EOL>("<STR_LIT>", <NUM_LIT:0>),<EOL>("<STR_LIT>", <NUM_LIT:0>),<EOL>("<STR_LIT>", <NUM_LIT:0>),<EOL>("<STR_LIT>", <NUM_LIT:0>),<EOL>("<STR_LIT>", <NUM_LIT:0>),<EOL>("<STR_LIT>", <NUM_LIT:0>)<EOL>])<EOL>with open(log_file) as fh:<EOL><INDENT>for line in fh:<EOL><INDENT>fields = [int(x) for x in line.strip().split()[-<NUM_LIT:4>:]]<EOL>if not fields[<NUM_LIT:0>]:<EOL><INDENT>template["<STR_LIT>"] += <NUM_LIT:1><EOL><DEDENT>template["<STR_LIT>"] += fields[<NUM_LIT:1>]<EOL>template["<STR_LIT>"] += fields[<NUM_LIT:3>]<EOL>template["<STR_LIT>"] += fields[<NUM_LIT:1>] + fields[<NUM_LIT:3>]<EOL>template["<STR_LIT>"] += fields[<NUM_LIT:0>]<EOL><DEDENT>total_len = template["<STR_LIT>"] + template["<STR_LIT>"]<EOL>if total_len:<EOL><INDENT>template["<STR_LIT>"] = round(<EOL>(template["<STR_LIT>"] / total_len) * <NUM_LIT:100>, <NUM_LIT:2>)<EOL><DEDENT>else:<EOL><INDENT>template["<STR_LIT>"] = <NUM_LIT:0><EOL><DEDENT><DEDENT>return template<EOL>
Retrieves some statistics from a single Trimmomatic log file.

    This function parses Trimmomatic's log file and stores some trimming
    statistics in an :py:class:`OrderedDict` object. This object contains
    the following keys:

        - ``clean_len``: Total length after trimming.
        - ``total_trim``: Total trimmed base pairs.
        - ``total_trim_perc``: Total trimmed base pairs in percentage.
        - ``5trim``: Total base pairs trimmed at 5' end.
        - ``3trim``: Total base pairs trimmed at 3' end.

    Parameters
    ----------
    log_file : str
        Path to trimmomatic log file.

    Returns
    -------
    x : :py:class:`OrderedDict`
        Object storing the trimming statistics.