Skip to main content

A nCoV package for parsing analysis files

Project description


License: MIT

The ncov_parser package provides a suite of tools to parse the files generated in the Nextflow workflow and provide a QC summary file. The package requires several files including:

  • <sample>.variants.tsv
  • <sample>.variants.norm.vcf
  • <sample>.pass.vcf
  • <sample>.per_base_coverage.bed
  • <sample>.primertrimmed.consensus.fa
  • <sample>.consensus.fasta
  • alleles.tsv

An optional metadata file with qPCR ct and collection date values can be included.

In addition, bedtools should be run to generate a <sample>.per_base_coverage.bed file to generate mean and median depth of coverage statistics.


After downloading the repository, the package can be installed using pip:

git clone
cd ncov-tools/parser
pip install .


The library consists of several functions that can be imported.

import ncov.parser

Several classes are available representing the different files that can be processed.


Similarly, wrapper scripts for creating a standard format output can be found in ncov.parser.qc

import ncov.parser.qc as qc

Top levels scripts

In the bin directory, several wrapper scripts exist to assist in generating QC metrics.

To create sample level summary qc files, use the script: --variants <sample>.variants.tsv or <sample>.pass.vcf
--coverage <sample>.per_base_coverage.bed --meta <metadata>.tsv
--consensus <sample>.primertrimmed.consensus.fa [--indel] --sample <samplename>
--platform <illumina or oxford-nanopore> --run_name <run_name> --alleles alleles.tsv
--indel --lineage <Pangolin lineage report> --aa_table <SNPEff annotation table>

Note the --indel flag should only be present if indels will be used in the calculation of variants.

Once this is complete, we can use the script to aggregate the sample level summary files into a single run tab-separate file. --path <path to sample.summary.qc.tsv files>

To create an amplicon BED file from a primer scheme BED file: --primers <path to primer scheme BED file>
--offset <number of bases to offset> --bed_type <full or no_primers or unique_amplicons>
--output <full path to file to write BED data to>

Credit and Acknowledgements

Note that this tool has been used in conjunction with the @jts ncov-tools suite of tools.

BED file importing and amplicon site merging obtained from the ARTIC pipeline:



Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ncov_parser-0.7.0.tar.gz (16.6 kB view hashes)

Uploaded source

Built Distribution

ncov_parser-0.7.0-py3-none-any.whl (21.7 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page