def parse_coverage_table(coverage_file):
<EOL>coverage_dict = OrderedDict()<EOL>total_cov = <NUM_LIT:0><EOL>with open(coverage_file) as fh:<EOL><INDENT>for line in fh:<EOL><INDENT>contig, cov = line.strip().split()<EOL>coverage_dict[contig] = {"<STR_LIT>": int(cov)}<EOL>total_cov += int(cov)<EOL>logger.debug("<STR_LIT>"<EOL>"<STR_LIT>".format(contig, cov))<EOL><DEDENT><DEDENT>return coverage_dict, total_cov<EOL>
Parses a file with coverage information into objects.

    This function parses a TSV file containing coverage results for
    all contigs in a given assembly and will build an ``OrderedDict``
    with the information about their coverage and length.  The length
    information is actually gathered from the contig header using a
    regular expression that assumes the usual header produced by Spades::

        contig_len = int(re.search("length_(.+?)_", line).group(1))

    Parameters
    ----------
    coverage_file : str
        Path to TSV file containing the coverage results.

    Returns
    -------
    coverage_dict : OrderedDict
        Contains the coverage and length information for each contig.
    total_size : int
        Total size of the assembly in base pairs.
    total_cov : int
        Sum of coverage values across all contigs.