Skip to content

nQuire

The nQuire program estimates the ploidy level of an individual from next-generation sequencing reads mapped to a reference genome. It distinguishes between diploids, triploids and tetraploids from the frequency distribution of bases at sites where only two bases are segregating.

License

Free to use and open source under the MIT License.

Available

  • Roihu-CPU: 2018.04.05, via the bio-apps module.

Usage

The nQuire program is part of the bio-apps collection on Roihu. Load the bio-apps module tree and then the nQuire module:

module load bio-apps/v202603
module load nquire/2018.04.05

The command is nQuire, with a capital Q. First extract the base frequencies at the biallelic sites from a BAM file into a .bin file:

nQuire create -b sample.bam -o sample -q 30

This writes sample.bin. By default, a site is included when its coverage is at least 10 (-c) and the minor base has a frequency of at least 0.2 (-f). A stringent mapping quality cutoff (-q, default 1) reduces noise from mismapped reads.

The denoise subcommand removes more of the background noise, and histo shows the base frequency histogram on the command line, so that you can compare it before and after denoising:

nQuire denoise -o sample_denoised sample.bin
nQuire histo sample_denoised.bin

Then compare the fit of the diploid, triploid and tetraploid models to the data:

nQuire lrdmodel -t 4 sample_denoised.bin

The lrdmodel command prints the log-likelihoods of the free model and the three fixed models, and the delta log-likelihood of each fixed model. The ploidy level whose model has the smallest delta log-likelihood has the strongest support. The lrdmodel command can take several .bin files and process them in parallel threads (-t).

Example batch script

This script processes all BAM files in the working directory and compares the models for all samples:

#!/bin/bash
#SBATCH --job-name=nquire
#SBATCH --account=<project>
#SBATCH --output=output_%j.txt
#SBATCH --error=errors_%j.txt
#SBATCH --partition=small
#SBATCH --time=02:00:00
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=4
#SBATCH --mem=8G

module load bio-apps/v202603
module load nquire/2018.04.05

for bam in *.bam; do
    name=$(basename $bam .bam)
    nQuire create -b $bam -o $name -q 30
    nQuire denoise -o ${name}_denoised $name.bin
done

nQuire lrdmodel -t $SLURM_CPUS_PER_TASK *_denoised.bin > lrdmodel.tsv

Replace <project> with your CSC project (for example project_2001234).

See creating a batch job script for Roihu for more information about running batch jobs.

Support

CSC Service Desk

More information

December 2, 2026