QTLtools-ase(1)
๐ QTLtools-ase(1) ยท Bioinformatics tools ๐งฌ ยท part 1 of 2 ๐
โจ NAME โจ
okay bestie, the whole tool is QTLtools ase ๐งฌ, and it's the thing that measures allele specific expression (ASE) straight from RNA-seq data ๐
โจ
๐งฌ SYNOPSIS ๐งฌ
here's how you call it, no cap ๐
QTLtools ase --bam [sample.bam|sample.sam|sample.cram] --vcf
[in.vcf|in.bcf|in.vcf.gz] --sample sample_name_in_vcf --mapq integer
--out output_file_prefix [OPTIONS]
๐ DESCRIPTION ๐
okay so this mode measures ASE from RNA-seq for transcribed heterozygous SNPs ๐งฌ, following the method in <https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3918453/>. the vibe in short: for each of the 12 REF/ALT pairs, it works out a reference allele mapping bias separately, as long as there are at least --sites REF/ALT sites with a minimum of --cov-bias reads overlapping ๐. pairs that don't pass that check get their bias calculated from all sites instead ๐ซถ.
the reference allele mapping bias is basically the number of reads across lots of sites that carried the reference allele for that pair, divided by the total number of reads overlapping ๐. then --subsample decides which percentile of the highest covered sites gets subsampled ๐. this is necessary so the bias isn't estimated mostly from super high coverage sites, but from sites covering the whole genome ๐ธ.
last bit: each site's ASE p-value is a two-tailed binomial test ๐ง. it checks whether the observed reference allele reads are significantly different from random, given the total reads and the probability of seeing a reference allele (which is the reference allele mapping bias for that pair) โจ.
the defaults should slay for most RNAseq experiments ๐ ๐. but bestie, listen:
NOT advisable ๐: lowering--baseqbelow10, lowering--covand--cov-biasbelow8, or setting--subsampleto1.
NOT recommended ๐: using--keep-bans-for-bias,--keep-discordant-for-bias,--filter-duplicates,--ignore-orientation, or--legacy-options. also refrain from--auto-flip๐ โโ๏ธ, and instead just create correct VCF/BCF files.
we highly recommend a BCF file over a VCF for the performance boost ๐ฅ. also use --fasta to provide the genome sequence you used, --blacklist to filter out low mappability regions ๐ซ, and --gtf to annotate the SNPs ๐ท๏ธ. if you're working with unfiltered imputed genotypes, consider --imp-qual and --geno-prob ๐. for troubleshooting, --filtered will list why certain variants got filtered out of the analysis ๐. if you're I/O bound, try --group-by for better performance ๐. and if your blacklist file has lots of overlapping or contiguous regions, --merge-on-the-fly can decrease memory usage ๐ง ๐.
๐ OPTIONS ๐
--vcf,-v[in.vcf|in.bcf|in.vcf.gz]โ genotypes in VCF/BCF format, sorted by chromosome and then position ๐งฌ. it can hold multiple samples. REQUIRED, and a BCF is RECOMMENDED for performance ๐.--bam,-b[in.bam|in.sam|in.cram]โ sequence data in BAM/SAM/CRAM format, sorted by chromosome and then position ๐. one sample per BAM file. REQUIRED.--ind,-isample_nameโ the sample name in the VCF that matches your BAM file ๐ซถ. REQUIRED.--out,-ooutputโ the output prefix โจ. this generatesoutput.aseandoutput.ref_biasfiles. or if you giveoutput.gzoroutput.bz2, you getoutput.ase.gzetc. REQUIRED.--mapq,-qintegerโ the minimum mapping quality a read or read pair needs to be considered ๐ฏ. set this to only include uniquely mapped reads. REQUIRED.--fasta,-fgenome_sequence.faโ the genome sequence in FASTA format ๐งฌ. make sure it's the sequence for the correct genome build. RECOMMENDED.--blacklist,-Bpoor_mappability_regions.bedโ poor mappability regions in BED format ๐ซ. ASE estimates will be unreliable in regions with low mappability. RECOMMENDED.--merge-on-the-fly,-tโ merges the blacklisted regions on the fly ๐ง . this can reduce memory usage if there are many overlapping or contiguous regions in the blacklist.--gtf,-ggene_annotation.gtfโ gene annotations in GTF format ๐ท๏ธ. you can grab these from<https://www.gencodegenes.org/>. RECOMMENDED.--filtered,-lfilenameโ the file where filtered variants get written ๐. RECOMMENDED for troubleshooting, especially if you use--suppress-warnings.--reg,-rchr:start-endโ the genomic region to process ๐บ๏ธ. e.g.chr4:12334456-16334456, orchr5.--fix-chr,-Fโ tries to match chromosome names to the BAM file by adding or removingchr๐ช. this doesn't apply to--{include,exclude}-positionsoptions. those should use the chromosome names from the VCF.--fix-id,-Rโ converts missing VCF variant IDs tochr_pos_refalt๐ .--auto-flip,-xโ attempts to fix reference allele mismatches ๐. it requires a fasta file for the reference sequence, given with--fasta. NOT RECOMMENDED.--print-stats,-Pโ prints out stats for the filtered reads at ASE sites ๐. this will be slower, and if there are sites with more reads than--max-depth, it can potentially give different results.--suppress-warnings,-kโ suppresses the warnings about individual variants ๐คซ.--illumina13,-jโ the base quality is in the Illumina-1.3+ encoding ๐งช.--group-by,-Gintegerโ groups variants separated by this much into batches ๐ฆ. this lets you skip streaming the whole BAM file, and may improve running time ๐.--max-depth,-dintegerโ pileup max-depth,DEFAULT=1000000๐. set it to a more reasonable value if you experience memory or performance issues. it's set high by default since RNA-seq can have very high coverage sites. set to0for max.--baseq,-Qintegerโ minimum phred quality for a base to be considered,DEFAULT=10๐.--pvalue,-pfloatโ binomial p-value threshold for ASE output,DEFAULT=1.0๐ฏ.--cov,-cintegerโ minimum coverage for a genotype to be considered in ASE analysis,DEFAULT=16๐.--cov-bias,-Cintegerโ minimum coverage for a genotype to be considered in reference allele mapping bias analysis,DEFAULT=10๐.--sites,-sintegerโ minimum number of sites to calculate a reference allele mapping bias from for a specific REF/ALT pair,DEFAULT=200๐งฉ. pairs with fewer than this many sites will have their bias calculated from all sites instead.--imp-qual-id,-Istringโ the VCF INFO field ID of the imputation score in the VCF,DEFAULT=INFO๐ท๏ธ.--geno-prob-id,-Lstringโ the VCF FORMAT field ID of the genotype posterior probabilities for RR/RA/AA in the VCF,DEFAULT=GP๐.--imp-qual,-Wfloatโ minimum imputation score for a variant to be considered,DEFAULT=0.0โจ.--geno-prob,-Vfloatโ minimum posterior probability for a genotype to be considered,DEFAULT=0.0๐.
๐ฆ OUTPUT FILES โจ
Okay bestie, so QTLtools ase spits out a couple of files and I am about to walk you through every single column ๐ค๐
๐ .ase
This is the main ASE results file, so it's the one you'll be staring at ๐ It has the columns below. Heads up: anything after the 23rd column only shows up if you pass --print-stats ๐ซถ
1INDIVIDUALโ the sample ID ๐โโ๏ธ2RSIDโ the SNP ID, pulled straight from the VCF file ๐งฌ3CHRโ the chromosome the SNP lives on4POSโ the SNP's position5ALLELESโ the alleles the SNP carries6BOTH_ALLELES_SEENโ whether or not both of the SNP's alleles actually got spotted in the RNAseq reads7MIN_ALLELE_RATIOโ the minor allele ratio across the RNAseq reads8REF_COUNTโ how many reference alleles show up in the reads9NONREF_COUNTโ how many alternative alleles show up in the reads10TOTAL_COUNTโ how many reads overlap the SNP11WEIGHTED_REF_COUNTโREF_COUNT, adjusted for reference mapping bias โ๏ธ12WEIGHTED_NONREF_COUNTโNONREF_COUNT, adjusted for reference mapping bias โ๏ธ13WRC_MINUS_WNCโWEIGHTED_REF_COUNTminusWEIGHTED_NONREF_COUNT14ALLELES_SEENโ the alleles observed in the RNAseq reads15REF_ALLELEโ the reference allele16ALT_ALLELEโ the alternative allele17OTHER_COUNTโ how many discordant reads there are, meaning reads that are neither REF nor ALT18EXPECTED_DISCORDANTโ the expected number of discordant alleles. It's calculated by adding up all the base error probabilities at the RNAseq read positions that overlap the SNP ๐งฎ19DISCORDANT_PVALโ the p-value for the observed number of discordant reads being higher than expected. You can Bonferroni-correct these p-values and drop the significant ones from downstream analyses ๐งน20REF_RATIOโ reference allele mapping bias21PVALUEโ the ASE p-value ๐ฅ22CONCERNโ any concerns that could make this SNP unusable get coded here. Check the OUTPUT FILE CODES section below to decode them ๐ฉ23EXON_INFOโ exons overlapping this SNP get listed here if a GTF file is provided. Each exon name is made by joining the gene ID, transcript ID, exon position, and gene name with a colon, and the names are separated by semicolons ๐งฉ24SECONDARYโ the number of secondary alignments that got filtered out25SUPPLEMENTARYโ if--filter-suppis provided, the number of supplementary alignments that got filtered out26FAIL_MAPQโ the number of alignments filtered out for low mapping quality27FAILQCโ if--keep-failed-qcis not provided, the number of filtered reads that failed QC according to the sequencer28DUPLICATEโ if--filter-duplicatesis provided, the number of filtered reads the aligner labeled as duplicates29MATE_UNMAPPEDโ if--keep-orphan-readsis not provided, the number of reads filtered because one mate was unmapped30WRONG_ORIENTATIONโ if--ignore-orientationis not provided, the number of reads filtered for being in the wrong orientation31NOT_PROPER_PAIRโ if--check-proper-pairingis provided, the number of filtered reads the aligner didn't mark as properly paired32SKIPPEDโ the number of alignments filtered out because they had no actual bases overlapping the SNP33FAIL_BASEQโ the number of filtered reads where the base overlapping the SNP had a base quality below--baseq๐34INDELโ if--filter-indel-readsis provided, the number of filtered reads that contained indels35DEPTHโ the number of alignments overlapping the SNP position
๐งช .ref_bias
This one details the reference allele mapping bias results. It has these columns:
1INDIVIDUALโ the sample ID2ALLELESโ the reference/alternative allele pair3REF_ALLโ total reference alleles observed across all sites4NONREF_ALLโ total alternative alleles observed across all sites5SITESโ number of sites for this REF/ALT pair that pass the thresholds6SUBSAMPLED_SITESโ number of sites that got subsampled down toSUBSAMPLED_TObecause their coverage was too high ๐ซง7SUBSAMPLED_TOโ the coverage thatSUBSAMPLED_SITESwere subsampled to8PERCโ reference allele mapping bias9SOURCEโ whether the reference allele mapping bias was calculated from allele-specific sites or from all sites
๐ซ --filtered filename
This file is the tea on every variant that got left out of the analysis and why ๐ต The first column is the coded omission reason, then comes the variant ID. The codes are all explained in the next section.
๐๏ธ OUTPUT FILE CODES
๐ฉ .ase file codes for the CONCERN column
Real talk: you probably want to exclude SNPs with RM, NRA, MDTA, or MDTR concerns from your analyses, because these likely have wrong genotypes ๐ญ SNPs with other concerns may be OK ๐คทโโ๏ธ
RMโ the reference allele in the VCF mismatches the reference sequence. Requires--fastaDPโ multiple variants observed at the same position in the VCF fileNRAโ no reference or alternative allele observed in the RNAseq readsMDTAโ more discordant (not reference or alternative) alleles than alternative alleles in the RNAseq readsMDTRโ more discordant (not reference or alternative) alleles than reference alleles in the RNAseq readsBANSโ both alleles of the SNP were not observed in the RNAseq readsLMARโ among the RNAseq reads, the minor allele ratio was less than 2%PDโ pileup depth (--max-depth) was potentially exceeded around this SNP. This may stop some overlapping reads from being counted, so we recommend rerunning with a higher--max-depth๐
๐งน --filtered file codes
VMAโ multi-allelic variantVUโ variant position or ID is excluded by the userVCNIBโ variant chromosome is not in the BAM fileVBโ variant is in a blacklisted regionVIโ variant is an indelVMRAโ variant is missing either the reference or the alternative alleleVNIFโ variant is not in the reference genome. Only if--fastawas providedVSโ reference and alternative alleles were swapped (not excluded). Only if--auto-flipand--fastawere provided ๐VFโ reference and alternative alleles' strand was flipped (not excluded). Only if--auto-flipand--fastawere providedVWRโ reference allele does not match the reference sequence. Only if--auto-flipand--fastawere providedVBIโ variant failed the imputation quality filterVMGTโ variant with a missing GT field, or variant is not diploidVMGโ missing genotypeVHโ homozygous variantVBGโ variant failed the genotype probability filterVDโ duplicate variant positionVMIโ variant with a missing ID (not excluded). It gets renamed if--fix-idis provided ๐ท๏ธVDKโ heterozygous variant has another variant at the same position (not excluded)BCโ variant didn't have enough coverage for reference allele mapping bias calculationsBBANSโ both alleles were not observed for reference allele mapping bias calculationsBMDTRAโ variant had more discordant alleles than reference or alternative alleles, so it was excluded from reference allele mapping bias calculationsACโ variant didn't have enough coverage for ASE calculationsABANSโ both alleles were not observed for ASE calculations
๐ EXAMPLES
ASE analysis of a sample mapped with STAR ๐:
QTLtools ase --vcf multi_sample.bcf --bam sample1.bam --ind sample1 --mapq 255 --out sample1 --filtered sample1.filtered.gz --gtf gencode.v19.annotation.gtf.gz --blacklist poor_mappability_regions.bed --fasta hg19.fa --fix-chr --fix-id
๐ SEE ALSO
QTLtools(1) ๐
QTLtools website: https://qtltools.github.io/qtltools ๐
๐ BUGS
Found a bug? Submit it here: https://github.com/qtltools/qtltools ๐ชฒ
๐ 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
Halit Ongen (halitongen@gmail.com), Olivier Delaneau (olivier.delaneau@gmail.com) ๐ซถ
And that's the whole page, bestie! โจ This one is from QTLtools v1.3, dated 06 May 2020, and it's the QTLtools-ase(1) page. ๐ฆ Go forth and run some ASE analysis, you absolutely slay ๐ ๐ธ
๐ฆ 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