QTLtools-rtc(1)
Okay bestie, this is the manual page for QTLtools-rtc(1) 𧬠from the Bioinformatics tools crew, and this is Part 1 of 2 π
β¨ NAME β¨
QTLtools rtc is the Regulatory Trait Concordance score analysis tool π¦
π SYNOPSIS π
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]
π DESCRIPTION π
Okay so the RTC algorithm basically checks how likely it is that a GWAS variant and a molQTL share the same functional effect π It does this by measuring how much the significance of the molQTL changes after you correct the molQTL phenotype for the genetic effect of the GWAS variant, then comparing that correction to what happens with every other SNP in the interval. The full method is written up at https://www.nature.com/articles/ng.3981 π When you're checking tissue specificity of molQTLs, we use the same method, except the GWAS variant gets treated as a molQTL from a different tissue πΈ
Here's the RTC method. Say you've got a GWAS variant sitting in the same region flanked by recombination hotspots (that's the coldspot π§) as a molQTL, with N variants in that coldspot:
- Correct the phenotype for each variant in the region separately using linear regression. This gives you N pseudo-phenotypes (residuals) β¨
- Redo the molQTL variant association with all of those pseudo-phenotypes π
- Sort the resulting p-values in decreasing order, then find the rank of the molQTL-to-GWAS-pseudo-phenotype association among all the molQTL-to-pseudo-phenotype associations π
RTC = (N - Rank of GWAS) / N
So the RTC score ends up between 0 and 1, and higher numbers mean a more likely shared functional effect between the GWAS and molQTL variants π Anything greater than or equal to 0.9 counts as a shared functional effect π₯ If a phenotype has multiple independent molQTLs, the RTC for each one gets assessed after correcting the phenotype with all the other molQTL variants for that phenotype. That correction uses linear regression, and you take the residuals after regressing the phenotype on the other molQTLs π«Ά
Now, to turn an RTC score into a probability of sharing, we run two simulations per coldspot region, called H0 and H1 π
The H0 scenario is when two variants in a coldspot are tagging different functional effects π For a coldspot holding colocalized GWAS and molQTL variants, we pick two random hidden causal variants. Then we find two variants (one GWAS, one molQTL) that are linked to those hidden causal variants (default r-squared β₯ 0.5). We generate a pseudo phenotype for the molQTL using the slope and intercept of the observed molQTL, plus randomly distributed residuals of the observed molQTL. After that, we rerun the RTC analysis with this new pseudo-phenotype and the GWAS and molQTL variants π§
The H1 scenario is when the two variants are tagging the same functional variant π The setup is exactly the same as H0, except there's only one hidden causal variant, and both the GWAS and molQTL variants are randomly picked from variants linked to that same hidden causal variant π
β OPTIONS β
--vcf [in.vcf|in.bcf|in.vcf.gz|in.bed.gz]β Genotypes in VCF/BCF format, or another molecular phenotype in BED format. If a variant's genotype FORMAT has a DS field (the dosage calculated from genotype probabilities, like after imputation), that's what gets used as the genotype. If there's only a GT field, that gets used and converted to a dosage instead. REQUIRED. π₯--bed quantifications.bed.gzβ Molecular phenotype quantifications in BED format. REQUIRED.--out output.txtβ The output file. REQUIRED.--hotspots recombination_hotspots.bedβ Recombination hotspots in BED format. REQUIRED.--cov covariates.txtβ Covariates you want to correct the phenotype data with π§--stats-vcf [in.vcf|in.bcf|in.vcf.gz]β Calculate D' and r-squared from this file. It defaults to the--vcffile. You need phased genotypes for D' calculations π§¬--stats-vcf-include-samples samples.txtβ Samples to include from the--stats-vcffile. One sample ID per line π·--stats-vcf-exclude-samples samples.txtβ Samples to exclude from the--stats-vcffile. One sample ID per line π·--normalβ Rank normal transform the phenotype data so each phenotype comes out normally distributed. RECOMMENDED. β¨--conditionalβ molQTLs contain independent signals, so this runs the conditional analysis π¦--debugβ Prints debugging info to stderr. DON'T USE. π--warningsβ Prints all the individual warnings you run into to stdout β οΈ--headerβ Adds a header to the output file when--chunkor--regionis provided π--individual-Dprimeβ Calculates D' on an individual variant basis. If you don't provide this, D' won't be calculated after the first unphased genotype is encountered π--mem-estβ Estimates memory usage and then exits π§--mem [0|1|2|3]β Decides which calculation results that might get reused stay in memory. 0 = nothing in mem, 1 = only basic, 2 = all in mem but cleaned up once they're unlikely to be reused, 3 = all in mem with no cleaning. DEFAULT=0. RECOMMENDED=2. π--window integerβ Size of the cis window flanking each phenotype's start position. DEFAULT=1000000. RECOMMENDED=1000000. π--sample integerβ How many simulated RTC values to try to hit for each coldspot, so you can convert RTC into a probability. Each iteration tries to pick a unique combination of variants, so the real number of sample iterations can come in lower than this value because of how many variants are in a region. If you want to run this analysis, please provide at least 100. DEFAULT=0. π--max-sample integerβ The max number of sample iterations to try to reach--samplebefore quitting. Provide the actual number, not the multiplier. DEFAULT=--sample * 50. π«Ά--R2-threshold floatβ The minimum r-squared required when picking a variant linked to the hidden causal variant(s) during simulations run with--sample. DEFAULT=0.5. β¨--D-prime-threshold floatβ If a pair of variants falls into different coldspots and has a D' greater than this, the RTC calculation gets extended to multiple coldspot regions including both variants. Assumes D' can be calculated. DEFAULT=OFF. NOT RECOMMENDED. π--grp-bestβ Corrects for multiple phenotypes within a phenotype group π--pheno-col integerβ The 1-based phenotype id column number. DEFAULT=1 or 5 when--grp-bestπ§Ύ--geno-col integerβ The 1-based genotype id column number. DEFAULT=8 or 10 when--grp-bestπ§Ύ--grp-col integerβ The 1-based phenotype group id column number. Only matters if--grp-bestis in effect. DEFAULT=1 π§Ύ--rank-col integerβ The 1-based conditional analysis rank column number. Only matters if--conditionalis in effect. DEFAULT=12 or 14 when--grp-bestπ§Ύ--best-col integerβ The 1-based phenotype column number. Only matters if--conditionalis in effect. DEFAULT=21 or 23 when--grp-bestπ§Ύ
β¨ OUTPUT FILE β¨
--out output file π okay so this is where your results land! It's a space separated file, and each row has the columns below. Heads up: columns after the 22nd only show up if you pass --sample π. Also, bestie, please include chunk 0 so you get a header row. Trust me, future you will be so grateful π«Ά
- Column 1:
other_variantπ¦ β The variant ID from outside this dataset. It could be the GWAS variant or another molQTL. - Column 2:
our_variantπΈ β The molQTL variant ID that lives inside this dataset. - Column 3:
phenotypeβ The phenotype ID. - Column 4:
phenotype_groupβ The phenotype group ID. - Column 5:
other_variant_chrβ The external variant's chromosome. - Column 6:
other_variant_startβ The external variant's start position. - Column 7:
other_variant_rankπ β The rank of the external variant. It only matters if the external variants are part of a conditional analysis. - Column 8:
our_variant_chrβ The internal variant's chromosome. - Column 9:
our_variant_startβ The internal variant's start position. - Column 10:
our_variant_rankπ β The rank of the internal variant. It only matters if the internal variants are part of a conditional analysis. - Column 11:
phenotype_chrβ The phenotype's chromosome. - Column 12:
phenotype_startβ The start position of the phenotype. - Column 13:
distance_between_variantsβ The distance between the two variants. - Column 14:
distance_between_other_variant_and_phenoβ The distance between the external variant and the phenotype. - Column 15:
other_variant_region_indexβ The region index of the external variant. - Column 16:
our_variant_region_indexβ The region index of the internal variant. - Column 17:
region_startβ The start position of the region. - Column 18:
region_endβ The end position of the region. - Column 19:
variant_count_in_regionβ How many variants are in the region. - Column 20:
RTCβ β The RTC score. - Column 21:
D'β The D' of the two variants. Only calculated if there are phased genotypes. - Column 22:
r^2β The r squared of the two variants. - Column 22:
p_valueβ The p-value of the RTC score.
Yes, 22 shows up twice in the numbering. The page really said that π
- Column 23:
unique_picks_H0β The number of unique combinations of variants in the H0 simulations. - Column 24:
unique_picks_H1β The number of unique combinations of variants in the H1 simulations. - Column 25:
rtc_bin_startβ The lower bound of the RTC bin, based on the observed RTC score. - Column 26:
rtc_bin_endβ The upper bound of the RTC bin, based on the observed RTC score. - Column 27:
rtc_bin_H0_proportionβ The proportion of H0 simulated values that sit betweenrtc_bin_startandrtc_bin_end. - Column 28:
rtc_bin_H1_proportionβ The proportion of H1 simulated values that sit betweenrtc_bin_startandrtc_bin_end. - Column 29:
median_r^2β The median r-squared in the region. - Column 30:
median_H0β The median RTC score in the H0 simulations. - Column 31:
median_H1β The median RTC score in the H1 simulations. - Column 32:
H0β The RTC scores observed in the H0 simulations. - Column 33:
H1β The RTC scores observed in the H1 simulations.
π§ EXAMPLES π§
π Example 1: the basic glow-up
Run RTC with GWAS variants and cis-eQTLs. This one corrects for technical covariates and rank normal transforms the phenotype β¨
QTLtools rtc --vcf genotypes.chr22.vcf.gz --bed
genes.50percent.chr22.bed.gz --cov genes.covariates.pc50.txt.gz
--hotspot hotspots_b37_hg19.bed --gwas-cis GWAS.b37.txt
permutations_all.significant.txt --normal --out rtc_results.txt
π Example 2: the full main character run
Here we get RTC with GWAS variants and cis-eQTLs, plus simulations. It corrects for technical covariates, rank normal transforms the phenotype, runs a conditional analysis, and keeps the data in memory π§ To make parallelizing on a compute cluster easier, there's an option to run the analysis in chunks of molecular phenotypes. For example, to run chunk 12 when the example data set is split into 20 chunks, run:
QTLtools rtc --vcf genotypes.chr22.vcf.gz --bed
genes.50percent.chr22.bed.gz --cov genes.covariates.pc50.txt.gz
--hotspot hotspots_b37_hg19.bed --gwas-cis GWAS.b37.txt
conditional_all.significant.txt --normal --conditional --mem 2 --chunk
12 20 --sample 200 --out rtc_results_12_20.txt
π¦ Example 3: the whole squad on a cluster
Want to submit the whole analysis as 20 jobs on a compute cluster? Just run this. Heads up that qsub needs to be swapped for whatever job submission system you use (bsub, psub, etc...) π«Ά
for j in $(seq 0 20); do
echo "QTLtools rtc --vcf genotypes.chr22.vcf.gz --bed
genes.50percent.chr22.bed.gz --cov genes.covariates.pc50.txt.gz
--hotspot hotspots_b37_hg19.bed --gwas-cis GWAS.b37.txt
conditional_all.significant.txt --normal --conditional --mem 2
--chunk $j 20 --sample 200 --out rtc_results_$j_20.txt" | qsub
done
π SEE ALSO π
QTLtools(1) πΈ Go check out the parent page, it's iconic.
QTLtools website: https://qtltools.github.io/qtltools π
π BUGS π
Found something weird? Please submit bugs to https://github.com/qtltools/qtltools π
π CITATION π
Ongen H, Brown AA, 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 π
π AUTHORS π
Halit Ongen (halitongen@gmail.com), Olivier Delaneau (olivier.delaneau@gmail.com) π
Bestie, that's the whole glow-up! π This page is from QTLtools v1.3, last updated 06 May 2020, and it's still giving π β¨
π¦ 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