QTLtools(1)
๐ QTLtools(1) ยท Bioinformatics tools ๐
okay bestie, this is the QTLtools(1) manual page and it is about to be SO good ๐ this is part 1 of 2, so the global options are coming next ๐ซถ
โจ NAME โจ
QTLtools โ a complete tool set for molecular QTL discovery and analysis ๐
๐ SYNOPSIS ๐
QTLtools [MODE] [OPTIONS]
๐ฆ DESCRIPTION ๐ฆ
okay so QTLtools is a complete tool set for molecular QTL discovery and analysis, and it's giving fast, user friendly AND cluster friendly ๐ฅ it does a whole bunch of key tasks: checking the quality of the sequence data, checking that sequence and genotype data actually match, quantifying and stratifying individuals using molecular phenotypes, discovering proximal or distal molQTLs and integrating them with functional annotations or GWAS data, and analyzing allele specific expression โจ
under the hood it uses HTSlib (http://www.htslib.org/) to quickly and efficiently handle common genomics file types like VCF, BCF, BAM, SAM, CRAM, BED, and GTF ๐ง and it also uses the Eigen C++ library (http://eigen.tuxfamily.org/) for fast linear algebra ๐
๐ MODES ๐
the modes are the main character energy of this tool, so let's go through every single one ๐
๐ธ bamstat
QTLtools bamstat --bam [in.sam|in.bam|in.cram] --bed
annotation.bed.gz --out output.txt [OPTIONS]
bamstat is your QC checker for BAM/SAM files, and it calculates basic QC metrics for them ๐
๐ธ mbv
QTLtools mbv --bam [in.sam|in.bam|in.cram] --vcf
[in.vcf|in.vcf.gz|in.bcf] --out output.txt [OPTIONS]
mbv is all about matching your BAM to your VCF ๐ฏ
๐ธ pca
QTLtools pca --vcf [in.vcf|in.vcf.gz|in.bcf] | --bed
in.bed.gz --out output.txt [OPTIONS]
pca calculates principal components for a BED/VCF/BCF/CRAM file ๐ฆ
๐ธ correct
QTLtools correct --vcf [in.vcf|in.vcf.gz|in.bcf] | --bed
in.bed.gz --cov covariates.txt | --normal --out output.txt
[OPTIONS]
correct does covariate correction on a BED or a VCF file ๐ซง
๐ธ cis
QTLtools cis --vcf [in.vcf|in.vcf.gz|in.bcf|in.bed.gz]
--bed quantifications.bed.gz [--nominal float | --permute
integer | --mapping in.txt] --out output.txt [OPTIONS]
cis QTL analysis, obsessed with this one ๐ญ
๐ธ trans
QTLtools trans --vcf [in.vcf|in.vcf.gz|in.bcf|in.bed.gz]
--bed quantifications.bed.gz [--nominal | --permute |
--sample integer | --adjust in.txt] --out output.txt
[OPTIONS]
trans QTL analysis, the other half of the QTL squad ๐
๐ธ fenrich
QTLtools fenrich --qtl significanty_genes.bed --tss
gene_tss.bed --bed TFs.encode.bed.gz --out output.txt
[OPTIONS]
fenrich does functional enrichment for QTLs ๐งช
๐ธ fdensity
QTLtools fdensity --qtl significanty_genes.bed --bed
TFs.encode.bed.gz --out output.txt [OPTIONS]
fdensity looks at the functional density around QTLs ๐
๐ธ genrich
QTLtools genrich --qtl significanty_genes.bed --tss
gene_tss.bed --vcf 1000kg.vcf --gwas gwas_hits.bed --out
output.txt [OPTIONS]
genrich does GWAS enrichment for QTLs ๐
โ ๏ธ bestie, this mode is deprecated and not supported. use rtc instead!! ๐
๐ธ rtc
QTLtools rtc --vcf [in.vcf|in.vcf.gz|in.bcf|in.bed.gz]
--bed quantifications.bed.gz --hotspots
hotspots_b37_hg19.bed [--gwas-cis | --gwas-trans |
--mergeQTL-cis | --mergeQTL-trans] variants_external.txt
qtls_in_this_dataset.txt --out output.txt [OPTIONS]
rtc is the Regulatory Trait Concordance score analysis, and it tests whether two colocalizing variants are due to the same functional effect ๐
๐ธ rtc-union
QTLtools rtc-union --vcf
[in.vcf|in.vcf.gz|in.bcf|in.bed.gz] ... --bed
quantifications.bed.gz ... --hotspots
hotspots_b37_hg19.bed --results qtl_results_files.txt ...
[OPTIONS]
rtc-union finds the union of QTLs from independent datasets ๐ค the vibe: if there was a QTL in a given recombination interval in one dataset, then it finds the best QTL (may or may not be genome-wide significant) in that same recombination interval in all the other datasets ๐ธ
๐ธ extract
QTLtools extract [--vcf --bed --cov] relevant_file --out
output_prefix [OPTIONS]
extract is data extraction mode ๐ง it pulls all the data from the provided files and drops it into one flat file, so everything is in one place โจ
๐ธ quan
QTLtools quan --bam [in.sam|in.bam|in.cram] --gtf
gene_annotation.gtf --out-prefix output [OPTIONS]
quan quantifies gene and exon expression from RNAseq ๐
๐ธ ase
QTLtools ase --bam [in.sam|in.bam|in.cram] --vcf
[in.vcf|in.vcf.gz|in.bcf] --ind sample_name_in_vcf --mapq
integer --out output.txt [OPTIONS]
ase measures allele specific expression from RNAseq at transcribed heterozygous SNPs ๐งฌ
๐ธ rep
QTLtools rep --bed quantifications.bed.gz --vcf
[in.vcf|in.vcf.gz|in.bcf] --qtl qtls_external.txt --out
output.txt [OPTIONS]
rep replicates QTL associations in an independent dataset ๐
๐ธ gwas
QTLtools gwas --vcf [in.vcf|in.vcf.gz|in.bcf|in.bed.gz]
--bed quantifications.bed.gz --out output.txt [OPTIONS]
gwas runs GWAS tests, correlating all genotypes with all phenotypes ๐
โจ FILE FORMATS โจ
okay so this section is literally the cheat sheet for every file QTLtools will eat ๐ bestie, read it before you hit enter or it will absolutely not vibe with you ๐
๐ .bcf|.vcf|.vcf.gz
These are your genotype data files ๐งฌ The official VCF spec lives at <https://samtools.github.io/hts-specs/VCFv4.2.pdf>, and your VCF/BCF files have to follow that spec's rules, no cap. BCF files must be indexed with bcftools index in.bcf (more info at <http://samtools.github.io/bcftools/bcftools.html>). VCF files should be compressed with bgzip (<http://www.htslib.org/doc/bgzip.html>) and indexed with tabix -p vcf in.vcf.gz (<http://www.htslib.org/doc/tabix.html>) ๐ซถ
๐ธ .bed|.bed.gz
These are the phenotype data files ๐ฆ In certain modes you can also pass them to the --vcf option, which is how you correlate two molecular phenotypes, iconic behavior ๐ The format is a custom UCSC BED format (<https://genome.ucsc.edu/FAQ/FAQformat.html#format1>) with 6 annotation columns followed by sample columns. The header line must exist, it must begin with a #, and the columns must be tab separated.
โ ๏ธ WARNING, this is a different file format from FASTQTL, so FASTQTL BED files are INCOMPATIBLE with QTLtools. Do not try to be slick about it ๐
Phenotype BED files must be compressed with bgzip (<http://www.htslib.org/doc/bgzip.html>) and indexed with tabix -p bed in.bed.gz (<http://www.htslib.org/doc/tabix.html>). Missing values must be coded as NA. Here is an example BED file, bestie ๐
#chr start end pid gid strand sample1 sample2
1 9999 10000 exon1 gene1 + 15 234
1 9999 10000 exon2 gene1 + 11 134
1 19999 20000 exon1 gene2 - 154 284
1 19999 20000 exon2 gene2 - 112 301
Here is what each of the annotation columns means ๐
- Phenotype chromosome [string]
- Start position of the phenotype [integer, 0-based]
- End position of the phenotype [integer, 1-based]
- Phenotype ID [string]
- Phenotype group ID or any type of info about the phenotype [string]
- Phenotype strand [+/-]
๐ง .bam|.sam|.cram
These are the sequence data files โจ The official SAM spec is at <https://samtools.github.io/hts-specs/SAMv1.pdf>, and your SAM/BAM/CRAM files must satisfy that spec's requirements. They must be indexed with samtools index in.bam (<http://www.htslib.org/doc/samtools.html>) ๐
๐ .gtf
These are for gene annotation ๐ฟ The file specification is at <https://www.ensembl.org/info/website/upload/gff.html>. Your GTF files must comply with that spec, and they should have the gene_id, transcript_id, gene_name, gene_type, and trnascript_type attributes. (Yes, trnascript_type is spelled exactly like that in the original, so match it as written ๐) We recommend using gene annotations from GENCODE (<https://www.gencodegenes.org/>) ๐ฅ
๐ covariate files
The covariate file holds your covariate data in simple text format ๐ Missing values should be encoded as NA. Both quantitative and qualitative covariates are supported. Quantitative covariates are assumed when only numeric values are provided, and qualitative covariates are assumed when only non-numeric values are provided. In practice, qualitative covariates with F factors get converted into F-1 binary covariates. Here is an example covariate file:
id sample1 sample2 sample3
PC1 -0.02 0.14 0.16
PC2 0.01 0.11 0.10
PC3 0.03 0.05 0.07
COV A B C
๐ include/exclude files
The various --{include,exclude}-{sites,samples,phenotypes,covariates} options need a simple text file listing the IDs of the type you want, one ID per line ๐ธ The include options run the analyses only on that subset of IDs, whereas the exclude options remove those IDs from the analyses. The IDs for --{include,exclude}-sites refer to the 3rd column in VCF/BCF files. The IDs for --{include,exclude}-covariates refer to the 1st column in COV files. The IDs for --{include,exclude}-phenotyps refer to the 4th column in BED files, and when the --grp-best option is used, they refer to the 5th column instead. The --include-positions and --exclude-positions options need a text file listing the chromosomes and positions (separated by a space) of the genotypes to be included or excluded, one position per line ๐ฆ
โจ IMPORTANT NOTES โจ
okay bestie, these are the big rules, so pay attention ๐
- BED files' start position is 0-based, but the end position is 1-based. Positions in all other files used in QTLtools are 1-based. All positions you give as option arguments and filters, even the ones referring to BED files, must be 1-based. 1-based means the first base of the sequence is position 1, whereas in 0-based the first position is 0. Math is giving main character energy ๐งฎ
- Make sure the chromosome names are the same across all files. If some files have
chr1and another has1as the chromosome name, QTLtools will treat them as different chromosomes. Not the vibe ๐ - BED files used for FastQTL (<http://fastqtl.sourceforge.net/>) are not directly compatible with QTLtools. To convert a FastQTL BED file to the QTLtools format, you need to add 2 columns after the 4th column ๐ ๏ธ
- The quan mode in version 1.2 and above is not compatible with quantifications generated by previous versions. This is due to bug fixes and slight adjustments to the way we quantify. Do not mix quantifications from earlier versions of QTLtools with quantifications from version 1.2 and above, because this will create a bias in your dataset ๐ญ
- Make sure you index all your genotype, phenotype, and sequence files ๐ฅ
- Use BCF and BAM files for the best performance โจ
โจ EXAMPLE FILES โจ
Here are the example files you can grab from the QTLtools examples site (<http://jungle.unige.ch/QTLtools_examples/>), each one linked below ๐ง
exons.50percent.chr22.bed.gzโ <http://jungle.unige.ch/QTLtools_examples/exons.50percent.chr22.bed.gz>exons.50percent.chr22.bed.gz.tbiโ <http://jungle.unige.ch/QTLtools_examples/exons.50percent.chr22.bed.gz.tbi>gencode.v19.annotation.chr22.gtf.gzโ <http://jungle.unige.ch/QTLtools_examples/gencode.v19.annotation.chr22.gtf.gz>gencode.v19.exon.chr22.bed.gzโ <http://jungle.unige.ch/QTLtools_examples/gencode.v19.exon.chr22.bed.gz>genes.50percent.chr22.bed.gzโ <http://jungle.unige.ch/QTLtools_examples/genes.50percent.chr22.bed.gz>genes.50percent.chr22.bed.gz.tbiโ <http://jungle.unige.ch/QTLtools_examples/genes.50percent.chr22.bed.gz.tbi>genes.covariates.pc50.txt.gzโ <http://jungle.unige.ch/QTLtools_examples/genes.covariates.pc50.txt.gz>genes.simulated.chr22.bed.gzโ <http://jungle.unige.ch/QTLtools_examples/genes.simulated.chr22.bed.gz>genes.simulated.chr22.bed.gz.tbiโ <http://jungle.unige.ch/QTLtools_examples/genes.simulated.chr22.bed.gz.tbi>genotypes.chr22.vcf.gzโ <http://jungle.unige.ch/QTLtools_examples/genotypes.chr22.vcf.gz>genotypes.chr22.vcf.gz.tbiโ <http://jungle.unige.ch/QTLtools_examples/genotypes.chr22.vcf.gz.tbi>GWAS.b37.txtโ <http://jungle.unige.ch/QTLtools_examples/GWAS.b37.txt>HG00381.chr22.bamโ <http://jungle.unige.ch/QTLtools_examples/HG00381.chr22.bam>HG00381.chr22.bam.baiโ <http://jungle.unige.ch/QTLtools_examples/HG00381.chr22.bam.bai>hotspots_b37_hg19.bedโ <http://jungle.unige.ch/QTLtools_examples/hotspots_b37_hg19.bed>results.genes.full.txt.gzโ <http://jungle.unige.ch/QTLtools_examples/results.genes.full.txt.gz>TFs.encode.bed.gzโ <http://jungle.unige.ch/QTLtools_examples/TFs.encode.bed.gz>
โจ SEE ALSO โจ
bestie, here are all the sibling pages you should check out next ๐
QTLtools-bamstat(1),QTLtools-mbv(1),QTLtools-pca(1),QTLtools-correct(1),QTLtools-cis(1),QTLtools-trans(1),QTLtools-fenrich(1),QTLtools-fdensity(1),QTLtools-rtc(1),QTLtools-rtc-union(1),QTLtools-extract(1),QTLtools-quan(1),QTLtools-ase(1),QTLtools-rep(1),QTLtools-gwas(1)- QTLtools website: <https://qtltools.github.io/qtltools>
โจ BUGS โจ
okay so there's one known bug and it's a lowkey big one, pls read ๐
- Versions up to and including 1.2 suffer from a bug in reading missing genotypes in VCF/BCF files. This bug affects variants with a
DSfield in their genotype'sFORMATthat have a missing genotype (DSfield is.) in one of the samples. In that case, the genotypes for all the samples get set to missing, which effectively removes this variant from the analyses ๐ Affected modes:cis,correct,gwas,pca,rep,trans,rtc-union
Please submit bugs to <https://github.com/qtltools/qtltools> ๐
โจ CITATIONS โจ
if you're writing it up, cite these ๐
Delaneau O., Ongen H., Brown A. A., et al. A complete tool set for molecular QTL discovery and analysis. Nat Commun 8, 15452 (2017). <https://doi.org/10.1038/ncomms15452>
Ongen H, Brown A. A., Delaneau O., et al. Estimating the causal tissues for complex traits and diseases. Nat Genet. 2017;49(12):1676-1683. doi:10.1038/ng.3981 <https://doi.org/10.1038/ng.3981>
Fort A., Panousis N. I., Garieri M., et al. MBV: a method to solve sample mislabeling and detect technical bias in large combined genotype and sequencing assay datasets, Bioinformatics 33(12), 1895 2017. <https://doi.org/10.1093/bioinformatics/btx074>
โจ AUTHORS โจ
the legends behind this tool ๐
Olivier Delaneau (olivier.delaneau@gmail.com), Halit Ongen (halitongen@gmail.com) ๐ซถ
bestie, that's the whole page ๐ Everything here is from QTLtools-v1.3, last updated 06 May 2020, so double-check your version and date before you trust anything too hard ๐ Stay iconic, stay curious, and go run some QTL analyses ๐ฆโจ
๐ฆ where this page comes from
- debian bookworm: qtltools 1.3.1+dfsg-4 ยท GPL-3.0-or-later
- debian trixie: qtltools 1.3.1+dfsg-4+b3 ยท GPL-3.0-or-later
- ubuntu jammy: qtltools 1.3.1+dfsg-2build2 ยท GPL-3.0-or-later
- ubuntu noble: qtltools 1.3.1+dfsg-4build3 ยท GPL-3.0-or-later
- ubuntu questing: qtltools 1.3.1+dfsg-4build6
- ubuntu resolute: qtltools 1.3.1+dfsg-4build7 ยท GPL-3.0-or-later
- ubuntu stonking: qtltools 1.3.1+dfsg-6 ยท GPL-3.0-or-later
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms