# Buggy code
def parse_quast_log(self, f):
    lines = f["f"].splitlines()

    # Pull out the sample names from the first row
    s_names = lines[0].split("\t")
    # Prepend directory name(s) to sample names as configured
    s_names = [self.clean_s_name(s_name, f["root"]) for s_name in s_names]
    for s_name in s_names[1:]:
        if s_name in self.quast_data:
            log.debug("Duplicate sample name found! Overwriting: {}".format(s_name))
        self.add_data_source(f, s_name)
        self.quast_data[s_name] = dict()

    # Parse remaining stats for each sample
    for l in lines[1:]:
        s = l.split("\t")
        k = s[0]
        for i, v in enumerate(s[1:]):
            s_name = s_names[i + 1]
            partials = re.search("(\d+) \+ (\d+) part", v)
            if partials:
                whole = partials.group(1)
                partial = partials.group(2)
                try:
                    self.quast_data[s_name][k] = float(whole)
                    self.quast_data[s_name]["{}_partial".format(k)] = float(partial)
                except ValueError:
                    self.quast_data[s_name][k] = whole
                    self.quast_data[s_name]["{}_partial".format(k)] = partial
            else:
                try:
                    self.quast_data[s_name][k] = float(v)
                except ValueError:
                    self.quast_data[s_name][k] = v


# Traceback (ValueError)
[INFO   ]         multiqc : This is MultiQC v1.7
[INFO   ]         multiqc : Template    : default
[INFO   ]         multiqc : Prepending directory to sample names
[INFO   ]         multiqc : Searching 'outputs'
[INFO   ]         multiqc : Only using modules quast
[INFO   ]           quast : Found 16 reports
[ERROR  ]         multiqc : Oops! The 'quast' MultiQC module broke...
Please copy the following traceback and report it at https://github.com/ewels/MultiQC/issues
If possible, please include a log file that triggers the error - the last file found was:
outputs/NRS6065/quast/report.tsv
============================================================
Module quast raised an exception: Traceback (most recent call last):
File "/homes/jabbott/NSW_assembly/.snakemake/conda/a820f7a0/bin/multiqc", line 440, in multiqc
output = mod()
File "/homes/jabbott/NSW_assembly/.snakemake/conda/a820f7a0/lib/python3.6/site-packages/multiqc/modules/quast/quast.py", line 75, in __init__
ng_pdata = self.quast_predicted_genes_barplot()
File "/homes/jabbott/NSW_assembly/.snakemake/conda/a820f7a0/lib/python3.6/site-packages/multiqc/modules/quast/quast.py", line 305, in quast_predicted_genes_barplot
for _, d in self.quast_data.items()
File "/homes/jabbott/NSW_assembly/.snakemake/conda/a820f7a0/lib/python3.6/site-packages/multiqc/modules/quast/quast.py", line 307, in <listcomp>
if key.startswith(prefix)
ValueError: invalid literal for int() with base 10: '0 bp)_par'
============================================================

# Fixed code
def parse_quast_log(self, f):
    lines = f["f"].splitlines()

    # Pull out the sample names from the first row
    s_names = lines[0].split("\t")
    # Prepend directory name(s) to sample names as configured
    s_names = [self.clean_s_name(s_name, f["root"]) for s_name in s_names]
    for s_name in s_names[1:]:
        if s_name in self.quast_data:
            log.debug("Duplicate sample name found! Overwriting: {}".format(s_name))
        self.add_data_source(f, s_name)
        self.quast_data[s_name] = dict()

    # Parse remaining stats for each sample
    for l in lines[1:]:
        s = l.split("\t")
        k = s[0]
        for i, v in enumerate(s[1:]):
            s_name = s_names[i + 1]
            partials = re.search(r"(\d+) \+ (\d+) part", v)
            if partials:
                whole = partials.group(1)
                partial = partials.group(2)
                try:
                    self.quast_data[s_name][k] = float(whole)
                    self.quast_data[s_name]["{}_partial".format(k)] = float(partial)
                except ValueError:
                    self.quast_data[s_name][k] = whole
                    self.quast_data[s_name]["{}_partial".format(k)] = partial
            else:
                try:
                    self.quast_data[s_name][k] = float(v)
                except ValueError:
                    self.quast_data[s_name][k] = v