This function imports ASC data by counting reads at heterozygous SNP sites defined in donor-specific VCF files. It uses Rsamtools::pileup to quantify reference and alternative alleles.

DsASC.gatk(sampleAnnot, vcfDir, genome, diskDump = FALSE, masterGr = NULL)

Arguments

sampleAnnot

Data frame with sample annotation. Must contain 'sampleId', 'bamFilename', 'donor'.

vcfDir

Directory containing donor VCFs named {donor}_heterozygous.vcf.gz.

genome

Character string containing genome assembly (e.g. "hg38").

diskDump

Logical. If TRUE, matrices are realized as HDF5 arrays.

masterGr

Optional pre-built master SNP GRanges (from buildMasterSNPs). If supplied, the per-VCF master construction is skipped and counts are stored against this shared site set. Use this so per-cell-type objects built in separate jobs remain row-aligned for cross-cell-type comparison (Fig 4d). Must carry REF, ALT, snpId metadata and names() set to snpId (as buildMasterSNPs produces).

Value

A DsASC object.

Details

Counts are stored against a union ("master") SNP list spanning all donors, but each sample is counted ONLY at sites heterozygous in its own donor. Sites outside a sample's donor het set are set to NA so they are never tested (prevents homozygous genotypes from being mis-called as allele-specific).