$npx -y skills add GPTomics/bioSkills --skill allele-specific-accessibilityDetect allele-specific chromatin accessibility from ATAC-seq using WASP, GATK ASEReadCounter, or RASQUAL. Use when mapping cis-regulatory genetic variants from heterozygous SNPs, separating cis from trans regulation, building chromatin QTL (caQTL) maps, validating GWAS variant fu
| 1 | ## Version Compatibility |
| 2 | |
| 3 | Reference examples tested with: WASP 0.3.4+, GATK 4.4+, RASQUAL 1.1+, samtools 1.19+, bcftools 1.19+, vcftools 0.1.16+, plink 2.00+, MatrixEQTL 2.3+, QuASAR 0.1+, bowtie2 2.5+, bwa-mem2 2.2.1+, scipy 1.11+ (false_discovery_control), pandas 2+, pybedtools 0.10+. |
| 4 | |
| 5 | Verify before use: |
| 6 | - CLI: `<tool> --version` then `<tool> --help` to confirm flags |
| 7 | - Python: `pip show <package>` then `help(module.function)` to check signatures |
| 8 | - R: `packageVersion('<pkg>')` then `?function_name` to verify parameters |
| 9 | |
| 10 | If code throws unexpected errors, introspect the installed package and adapt rather than retrying. |
| 11 | |
| 12 | # Allele-Specific Accessibility |
| 13 | |
| 14 | **"Does this heterozygous SNP affect chromatin accessibility on its allele?"** -> Count ATAC reads supporting reference vs alternative allele at heterozygous sites in the same individual; significant deviation from 50:50 indicates cis-regulatory effect. Requires careful handling of reference-allele mapping bias (WASP filtering) and within-individual binomial testing. |
| 15 | |
| 16 | - CLI: `WASP` (Geijn 2015) for de-biased reference mapping |
| 17 | - CLI: `gatk ASEReadCounter` for allele-specific count tables |
| 18 | - CLI: `RASQUAL` (Kumasaka 2016) for joint cis-mapping with allelic counts |
| 19 | - R: `QuASAR` (Harvey 2015) for genotype + ASE inference simultaneously |
| 20 | |
| 21 | ASE/ASB analysis is fundamentally different from cohort-level differential. Statistical framework is binomial within-individual; sample size is the count of heterozygous SNPs in accessible regions, not the number of individuals. |
| 22 | |
| 23 | ## Algorithmic Taxonomy |
| 24 | |
| 25 | | Tool | Method | Input | Strength | Fails when | |
| 26 | |------|--------|-------|----------|------------| |
| 27 | | WASP (Geijn 2015) | Realign reads where alt allele swap could change mapping; filter mapping-bias affected sites | BAM + VCF + reference | Mandatory for any ASE/ASB analysis; controls reference-allele bias | Slow on deep coverage; requires re-alignment step | |
| 28 | | GATK ASEReadCounter | Count REF and ALT reads at known heterozygous sites | BAM + VCF | Mature; integrates with GATK ecosystem; standard counter | Doesn't fix mapping bias (needs WASP first); single-sample | |
| 29 | | RASQUAL (Kumasaka 2016) | Joint cis-eQTL/caQTL model: total counts + allelic imbalance | BAM + VCF + peak counts | Best statistical power for caQTL when sample size is moderate (N=20-100); models genotype uncertainty | Complex setup; per-feature regression (slow); requires LD computation | |
| 30 | | QuASAR (Harvey 2015) | Genotype + ASE inference from RNA-seq or ATAC alone | BAM (no VCF needed) | Useful when genotypes are limited; integrates phasing | Less accurate than WASP+GATK when genotypes are known | |
| 31 | | MatrixEQTL on per-feature counts | Linear model fit on accessibility per peak | Genotypes + peak counts | Standard cohort-level caQTL; well-supported | No allelic imbalance information; needs sample size N >= 50 | |
| 32 | | Allelic Imbalance from Bayesian models (MAJIQ-style) | Bayesian beta-binomial | BAM + VCF | Models overdispersion appropriately | Niche; less mature than WASP+GATK | |
| 33 | |
| 34 | Methodology evolves; verify against current Geijn 2015, Kumasaka 2016, Buchkovich 2015 before locking pipelines. Modern caQTL studies typically combine WASP + RASQUAL at modest N or WASP + GATK + linear caQTL at large N. |
| 35 | |
| 36 | ## Reference Allele Mapping Bias (The Single Most Important Issue) |
| 37 | |
| 38 | When aligning reads to the reference genome, reads carrying the reference allele align with 0 mismatches; reads carrying the alternative allele have 1 mismatch and may fail to align (especially with `bwa-mem` -k or `bowtie2 --very-sensitive` thresholds). This **inflates the apparent reference-allele frequency** at every SNP and confounds ASE. |
| 39 | |
| 40 | **Trigger:** Always (mapping bias is universal at heterozygous SNPs). |
| 41 | |
| 42 | **Mechanism:** Aligners are mismatch-penalized. Without correction, ALT reads systematically under-align. Effect size: 1-5% bias toward reference at typical mismatch penalties. |
| 43 | |
| 44 | **Symptom:** Per-SNP REF allele fraction skews above 50% even at sites without true allelic imbalance. |
| 45 | |
| 46 | **Fix:** WASP. Pseudo-alleles every read at heterozygous sites; re-aligns swapped reads; keeps only reads that map identically to both haplotypes. Mandatory for any ASE/ASB analysis. |
| 47 | |
| 48 | **Goal:** Remove reference-allele mapping bias before counting allele-specific ATAC reads. |
| 49 | |
| 50 | **Approach:** Identify reads overlapping heterozygous SNPs, re-align allele-swapped versions, keep only reads consistent across both haplotypes, then count REF/ALT with GATK ASEReadCounter. |
| 51 | |
| 52 | ```bash |
| 53 | # WASP read-correction pipeli |