Skip to main content

QC parser for SMaHT

Parses outputs of different QC tools and unifies them for the SMaHT portal

Installation

Simply run pip install qc-parser to install the package. You need at least Python 3.8.

To develop this package, clone this repo, make sure poetry is installed on your system and run make install.

Usage

After installation the following command can be run from the command line:

parse-qc \
    -n 'BAM Quality Metrics' \
    --metrics samtools /PATH/samtools.stats.txt \
    --metrics picard_CollectInsertSizeMetrics /PATH/picard_cis_metrics.txt \
    --additional-files /PATH/additional_output_1.pdf \
    --additional-files /PATH/additional_output_2.tsv \
    --output-zip metrics.zip
    --output-json qc_values.json

In this example, the tool will parse the Samtools output file /PATH/samtools.stats.txt and the Picard output file /PATH/picard_cis_metrics.txt. The values that are extracted from both files are specified in src/metrics_to_extract.py. All metrics are combined and stored in qc_values.json that is compatible with Tibanna_ff's generic QC functionality.

The metrics.zip will contain the following files:

samtools.stats.txt
picard_cis_metrics.txt
additional_output_1.pdf
additional_output_2.tsv

The currently supported QC tools are:

  • samtools_stats (Samtools stats)
  • picard_CollectAlignmentSummaryMetrics (Picard CollectAlignmentSummaryMetrics)
  • picard_CollectInsertSizeMetrics (Picard CollectInsertSizeMetrics)
  • picard_CollectWgsMetrics (Picard CollectWgsMetrics)
  • bamstats (bamStats.py)
  • fastqc (FastQC)
  • rnaseqc (RNA-SeQC)
  • nanoplot (NanoPlot)
  • verifybamid2 (VerifyBamID2)
  • kraken2 (Kraken2)
  • mosdepth (mosdepth)
  • somalier (Somalier)
  • tissue_classifier (internal tissue classification tool for RNA-Seq data)

Development

If you want to extract a new metric from an already supported QC tool, add the metric to the src/metrics_to_extract.py in the appropriate section.

If you want to add suuport for a new QC tool, you need to add a parser to src/MetricsParser.py and add the metrics you want to extract from the tool to src/metrics_to_extract.py.

Tests

The command make test will run local tests.

Metadata

Release files for qc-parser 0.8.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qc-parser 0.8.3
File Size Uploaded
qc_parser-0.8.3.tar.gz 15.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for qc-parser 0.8.3
File Interpreter ABI Platform
qc_parser-0.8.3-py3-none-any.whl Python 3 none any Details

Total release size: 31.1 kB

Release files / qc_parser-0.8.3.tar.gz

Download URL qc_parser-0.8.3.tar.gz
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0106d55b9e67c0bae0d87367b22fd4e5c066fe07fa8d2f993ccc08276c4df361
BLAKE2b-256 checksum
How to use checksums
4e7b34cb347cfd6849870b86ab7a4ebdf6b136c70202d9efabc69df8fc3642d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.13.2 Darwin/23.6.0

Release files / qc_parser-0.8.3-py3-none-any.whl

Download URL qc_parser-0.8.3-py3-none-any.whl
Size 16.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de1fc1570edab1fb7538b436d3faffcb5f6d97c88566fd9ab9fb5e577f90e840
BLAKE2b-256 checksum
How to use checksums
55fb5da5a3ce25a4396ae802ad76d0917f803313145d04841d119baea14af612
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.13.2 Darwin/23.6.0

Release history Release notifications | RSS feed

This release

0.8.3 This release

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page