Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trimmomatic logs not parsed properly #864

Closed
cgirardot opened this issue Nov 26, 2018 · 5 comments
Closed

Trimmomatic logs not parsed properly #864

cgirardot opened this issue Nov 26, 2018 · 5 comments
Labels
bug: core Bug in the main MultiQC code

Comments

@cgirardot
Copy link

cgirardot commented Nov 26, 2018

Description of bug:
I try to assemble a report with Trimmomatic logs (amongst others). Trimmomatic was run in Galaxy, all the logs therefore refer to a fastq_r1 input file used to name the sample. To circumvent this, I am using the instruction:

extra_fn_clean_exts:
    - type: regex_keep
      pattern: '[0-9]+_mATAC_t[0-9]{1,2}'

to extract sample names from file names like 180518_mATAC_t1_1_trimmomatic.err.

Strangely this instruction is ignored for trimmomatic logs while the regex perfectly works for other modules ; so I end up with a single sample (i.e. fastq_r1) in the report section.

MultiQC Error log:

[INFO   ]         multiqc : This is MultiQC v1.6
[INFO   ]         multiqc : Template    : default
[INFO   ]         multiqc : Searching 'qc/trimmomatic/'
[INFO   ]     trimmomatic : Found 1 logs
[INFO   ]         multiqc : Compressing plot data
[INFO   ]         multiqc : Report      : trimmo_test.html
[INFO   ]         multiqc : Data        : trimmo_test_data
[INFO   ]         multiqc : MultiQC complete

File that triggers the error:
Attached is a zip with 10 logs and the config file

trimmomatic.zip

MultiQC run details (please complete the following):

  • Command used to run MultiQC:
    multiqc -c multiqc_ATAC_config.yaml -n trimmo_test qc/trimmomatic/

  • MultiQC Version: MultiQC v1.6

  • Operating System: CentOS Linux release 7.4.1708 (Core)

  • Python Version: Python 2.7.15

  • Method of MultiQC installation: conda

@ewels ewels added the bug: core Bug in the main MultiQC code label Nov 27, 2018
@ewels
Copy link
Member

ewels commented Nov 27, 2018

Thanks for the detailed issue 👍 I'll look into it as soon as I can.

Phil

ewels added a commit to MultiQC/test-data that referenced this issue Dec 21, 2018
@ewels ewels closed this as completed in 0db8eee Dec 21, 2018
@ewels
Copy link
Member

ewels commented Dec 21, 2018

Hi @cgirardot,

The problem here is that Trimmomatic gets it's sample names from the command line used. As you pointed out, this is the same for every file in your case. The extra_fn_clean_exts only works with the sample name that has been collected, so doesn't help in this case as the filename is not used at all.

To get around this, I've added a new option to the code which allows you to set a config flag to tell the module to use the filename instead of the file contents. To use it, add the following config option:

trimmomatic:
    s_name_filenames: true

Once you have this, everything should work as excepted.

Let me know how you get on!

Phil

ewels added a commit that referenced this issue Dec 21, 2018
@cgirardot
Copy link
Author

cgirardot commented Dec 21, 2018

right on time fro Christmas !

Thx

@cgirardot
Copy link
Author

this is working great , thanks again.

ewels added a commit that referenced this issue Jul 4, 2021
…i flag

Forces modules to use the log filename for the sample identifier, even if the module usually takes this from the file contents

See #949 #890 and #864
@ewels
Copy link
Member

ewels commented Jul 4, 2021

Hi all,

Old issue, but wanted to note that I have added this behaviour as a general feature for any module / file search pattern in fa84c47 and will be included in the MultiQC v1.11 release.

The documentation for this new feature is here: https://multiqc.info/docs/#using-log-filenames-as-sample-names

I haven't removed the Trimmomatic-specific config described above, so that should still work. But I would recommend switching to the new system if you can as it may be removed in the future.

Cheers,

Phil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: core Bug in the main MultiQC code
Projects
None yet
Development

No branches or pull requests

2 participants