Flagstats and multiqc
1
0
Entering edit mode
3.5 years ago
Hippolyte • 0

Hi everyone,

I'm curently trying to use multiqc to collect flagstats .json outputs. Unfortunately it doesn't seem to work as expected.

Here's how I proceeded :

-How I made the flagstats json : samtools flagstat X.sam -O json -@ 2 > X_flagstat.json

-How I used multiqc : multiqc . -c ./multiqc_config.yaml

My multiqc_config.yaml :

sp:
  samtools/flagstat:
    contents: >
      in total (QC-passed reads + QC-failed
      reads)
    shared: true
    fn: '*flagstat*'

Thanks for the help.

multiqc samtools flagstat • 3.0k views
ADD COMMENT
2
Entering edit mode

Any specific reason you are creating a .json output using samtools? A general .txt file should be enough and multiqc will be able to easily collate those text files into a report.

ADD REPLY
0
Entering edit mode

it does work with a .txt but I need json format for various data storage reasons

ADD REPLY
3
Entering edit mode
3.5 years ago
Phil Ewels ★ 1.4k

MultiQC only knows how to parse the .txt output from samtools flagstat currently, so updating the search pattern won't help here. Even if MultiQC finds the files the module won't know what to do with them.

You're welcome to submit a pull-request to add JSON parsing capability to the module so that it can handle both file formats. The relevant code is here: https://github.com/ewels/MultiQC/blob/master/multiqc/modules/samtools/flagstat.py (or you can create an issue with some example files).

Note that MultiQC normalises and saves all data that it processes, and you can choose from csv, tsv, json and yaml for that. So another option would be to get samtools to generate .txt files and then use -k json with MultiQC and use the files in multiqc_data for your downstream work.

Phil

ADD COMMENT

Login before adding your answer.

Traffic: 2206 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6