Skip to content
cazzlewazzle89Public

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

93 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Qontas

Quantification of Amplicon Sequences

QONTAS (Quantification of ONT Amplicon Sequences) is a tool designed to take amplicon sequencing reads and generate a clean table of unique variants, their counts, and relative abundances. It uses a "Cookie Cutter" approach to bin, clip, and denoise data based on specific genomic regions of interest.

Key Features

  • Per-Region Length Filtering: Filters reads based on their original length before clipping, allowing for diverse amplicon panels.
  • Direct Variant Calling: Extracts standard variant notation (insertions, deletions, and SNVs) directly from the CIGAR and MD tags of the alignments.
  • Fast One-Pass Parsing: Bypasses intermediate clustering algorithms and temporary file generation by tallying variants directly from the BAM file in memory.
  • Multi-Platform Support: Optimized alignment presets for Oxford Nanopore (ont), PacBio (pb), and Illumina (illumina) sequencing data.

SETUP

1. Clone the Repository

git clone https://github.com/cazzlewazzle89/Qontas.git ./QONTAS
chmod +x ./QONTAS/qontas.py

2. Create Conda Environment

mamba create -n qontas -c bioconda -c conda-forge minimap2 samtools pysam pandas
conda activate qontas

USAGE

QONTAS is run using the qontas.py script. It supports multi-region amplicon panels via a single BED file.

BED File Format

The BED file should be tab-separated. Columns 5 and 6 are used to define the expected length of the original read for that specific target. For example:

#Chrom   Start   End     Name    MinLen   MaxLen
chr1     1658    1717    geneA    600      650
chr1     2500    3100    geneB    1100     1250

Running the Script

python qontas.py -i sample.fastq.gz -r ref.fa -b regions.bed -s SampleName -p ont -o Qontas_Out

Command Line Arguments:

Flag Name Description Default
-i Input Sequencing reads in FASTQ format (can be gzipped) Required
-r Reference Reference sequence in FASTA format Required
-b BED BED file defining regions and length constraints Required
-s Sample Sample name used for subdirectory and file naming Required
-o Outdir Parent directory for results Qontas_Out
-c Mincount Minimum reads per variant to be retained 10
-t Threads Number of threads for Minimap2 mapping 4
-p Platform Sequencing platform (ont, pb, or illumina) ont

Special Note for Illumina Data

Because Qontas requires reads to fully span the target coordinates defined in your BED file, paired-end Illumina reads must be merged prior to running the pipeline.

We highly recommend using fastp for this preprocessing step, as it handles both adapter trimming and paired-end merging simultaneously.

Example fastp merging command:

fastp -i R1.fastq.gz -I R2.fastq.gz -m --merged_out sample_merged.fastq.gz

BED Region Length Constraint: When using the -p illumina flag, ensure that the genomic regions defined in your BED file are shorter than your expected merged read length. If the BED coordinates exceed the length of the merged read, the read will be successfully mapped but subsequently discarded by Qontas for failing to span the full target window.


OUTPUT STRUCTURE

For each sample, QONTAS generates a dedicated folder containing a TSV file for each region defined in the BED file:

Qontas_Out/
└── SampleName/
    ├── geneA.tsv   # TSV with Variant_Name, Count, and Relative Abundance
    └── geneB.tsv   # TSV with Variant_Name, Count, and Relative Abundance

UTILITIES

Merging Results

QONTAS includes a utility script qontas_merge.py to combine all individual sample/region TSVs into a single feature table.

Command Line Usage: Simply point the script at your main Qontas output directory (the folder you specified with -o in the main script):

python qontas_merge.py -d Qontas_Out/ -o qontas_table.tsv

Output Format: The script produces a Long Format (Tidy) table. This structure is ideal for downstream analysis and plotting.

Sample Region Variant_Name Count RelAbund
Sample1 geneA WT 500 95.0
Sample1 geneA A45G 25 4.75
Sample2 geneA WT 600 98.0

TO DO

  • Multi-Sample: Script to merge individual .tsv files into a single master feature table.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages