QTLtools-fenrich(1)

โœจ NAME โœจ

Okay bestie, this page is for QTLtools-fenrich(1) ๐Ÿงฌ (filed under Bioinformatics tools). It covers QTLtools fenrich, which is all about functional enrichment of molecular QTLs ๐Ÿ’–

๐Ÿซถ SYNOPSIS ๐Ÿซถ

QTLtools fenrich --qtl significanty_genes.bed --tss gene_tss.bed --bed TFs.encode.bed.gz --out output.txt [OPTIONS]

๐Ÿ”ฎ DESCRIPTION ๐Ÿ”ฎ

Okay so this mode checks whether a set of QTLs lands inside functional annotations more often than chance would predict ๐Ÿ‘€ The full method is explained in <https://www.nature.com/articles/ncomms15452> ๐Ÿ“–

Here, "chance" doesn't mean a coin flip ๐Ÿช™. It means what you'd expect given how unevenly molQTLs and functional annotations are spread around the genomic positions of the molecular phenotypes. That's the fairness check, bestie ๐Ÿ’…

Here's the play. First, we list every functional annotation sitting nearby each molecular phenotype. So if X phenotypes were quantified, that's X lists of annotations ๐Ÿ“‹. Then, for the subset Y of phenotypes that have a significant molQTL, we count how often those Y molQTLs overlap the annotations in their matching lists. That gives us the observed overlap frequency, fobs(Y) ๐Ÿ”

Next comes the shuffle ๐Ÿ”€. We permute the annotation lists across phenotypes, so phenotype A might get the list that belongs to phenotype B. For every permuted dataset, we count how often the Y molQTLs overlap the newly assigned annotations. That gives the expected overlap frequency, fexp(Y) ๐ŸŽฒ

Why shuffle like this? Because it keeps the distribution of functional annotations and molQTLs around molecular phenotypes exactly as it was ๐Ÿงš

Finally, we run a Fisher test to see how fobs(Y) and fexp(Y) differ ๐Ÿ“Š. You get an odds ratio estimate and a two-sided p-value. The vibe check: the first part tells you whether there's enrichment or depletion, and the second part tells you how significant that is ๐Ÿ’œ


โœจ OPTIONS โœจ

  • --qtl in.bed โ€” Your list of QTLs of interest, in BED format. REQUIRED ๐Ÿ’–
  • --bed functional_annotation.bed.gz โ€” Your functional annotations, in BED format. REQUIRED ๐Ÿงฌ
  • --tss genes.bed โ€” Positions of all the phenotypes you mapped QTLs for, in BED format. REQUIRED ๐Ÿ“
  • --out output.txt โ€” The output file. REQUIRED ๐Ÿ“
  • --permute integer โ€” How many permutations to run. DEFAULT=1000 ๐Ÿ”€

๐Ÿ“‚ INPUT FILES ๐Ÿ“‚

--qtl file ๐ŸŽ€

The list of QTLs you care about. Here's an example:

1    15210     15211     1_15211   ENSG00000227232.4   -
1    735984    735985    1_735985  ENSG00000177757.1   +
1    735984    735985    1_735985  ENSG00000240453.1   -
1    739527    739528    1_739528  ENSG00000237491.4   +

The column breakdown:

  • 1 โ€” The variant chromosome
  • 2 โ€” The variant's start position (0-based)
  • 3 โ€” The variant's end position (1-based)
  • 4 โ€” The variant ID
  • 5 โ€” The phenotype ID
  • 6 โ€” The phenotype's strand. (not used) ๐Ÿ™ˆ

--bed file ๐Ÿฆ‹

The list of annotations in BED format. Here's an example:

1    254874    265487
1    730984    735985
1    734984    736585
1    739527    748528

The column breakdown:

  • 1 โ€” Chromosome
  • 2 โ€” Start position (0-based)
  • 3 โ€” End position (1-based)

--tss file ๐ŸŒธ

The list of positions for all the phenotypes you mapped QTLs for. Here's an example:

1    29369     29370     ENSG00000227232.4   1_15211   -
1    135894    135895    ENSG00000268903.1   1_985446  -
1    137964    137965    ENSG00000269981.1   1_1118728 -
1    317719    317720    ENSG00000237094.7   1_15211   +

The column breakdown:

  • 1 โ€” Phenotype's chromosome
  • 2 โ€” The start position of the phenotype (0-based)
  • 3 โ€” The end position of the phenotype (1-based)
  • 4 โ€” The phenotype ID
  • 5 โ€” Top variant (not used) ๐Ÿ™ˆ
  • 6 โ€” The phenotype's strand

๐Ÿ“ค OUTPUT FILE ๐Ÿ“ค

--out file ๐Ÿ’…

This is a space-separated results file that spills the enrichment tea, with these columns:

  1. The observed number of QTLs falling within the functional annotations
  2. The total number of QTLs
  3. The mean expected number of QTLs falling within the functional annotations (across multiple permutations)
  4. The standard deviation of the expected number of QTLs falling within the functional annotations (across multiple permutations)
  5. The empirical p-value
  6. Lower bound of the 95% confidence interval of the odds ratio
  7. The odds ratio
  8. Upper bound of the 95% confidence interval of the odds ratio

๐ŸŒŸ EXAMPLE ๐ŸŒŸ

  1. First, you need a BED file with the positions of the QTLs you're interested in. To do that, pull out all the significant hits at a given FDR threshold (e.g. 5%), then turn that significant QTL list into a BED file:
Rscript ./script/qtltools_runFDR_cis.R results.genes.full.txt.gz 0.05 results.genes
cat results.genes.significant.txt | awk '{ print $9, $10-1, $11, $8, $1, $5 }' | tr ' ' '\t' | sort -k1,1V -k2,2g > results.genes.significant.bed
  1. Next, prepare a BED file with the positions of all the phenotypes you mapped QTLs for:
zcat results.genes.full.txt.gz | awk '{ print $2, $3-1, $4, $1, $8, $5 }' | tr ' ' '\t' | sort -k1,1V -k2,2g > results.genes.quantified.bed
  1. Finally, run the enrichment analysis:
QTLtools fenrich --qtl results.genes.significant.bed --tss results.genes.quantified.bed --bed TFs.encode.bed.gz --out enrichment.QTL.in.TF.txt

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

๐Ÿ› BUGS ๐Ÿ›

๐Ÿ“š CITATION ๐Ÿ“š

Delaneau, O., Ongen, H., Brown, A. et al. A complete tool set for molecular QTL discovery and analysis. Nat Commun 8, 15452 (2017). <https://doi.org/10.1038/ncomms15452> ๐ŸŽ“

๐Ÿ‘‘ AUTHORS ๐Ÿ‘‘

Olivier Delaneau (olivier.delaneau@gmail.com), Halit Ongen (halitongen@gmail.com) ๐Ÿซถ


That's the whole tea, bestie! ๐Ÿ’– This page is stamped QTLtools-v1.3, dated 06 May 2020, and it's QTLtools-fenrich(1) forever ๐Ÿฆ‹โœจ