Calculate ArchR-compatible per-cell QC statistics
Arguments
- fragments
IterableFragments object
- genes
Gene coordinates given as GRanges, data.frame, or list. See
help("genomic-ranges-like")for details on format and coordinate systems. Required attributes:chr,start,end: genomic position
- blacklist
Blacklisted regions given as GRanges, data.frame, or list. See
help("genomic-ranges-like")for details on format and coordinate systems. Required attributes:chr,start,end: genomic position
Details
This implementation mimics ArchR's default parameters. For uses requiring more flexibility to tweak default parameters, the best option is to re-implement this function with required changes. Output columns of data.frame:
cellName: cell name for each cellnFrags: number of fragments per cellsubNucleosomal,monoNucleosomal,multiNucleosomal: number of fragments of size 1-146bp, 147-254bp, and 255bp + respectively. equivalent to ArchR's nMonoFrags, nDiFrags, nMultiFrags respectivelyTSSEnrichment:AvgInsertInTSS / max(AvgInsertFlankingTSS, 0.1), whereAvgInsertInTSSisReadsInTSS / 101(window size), andAvgInsertFlankingTSSisReadsFlankingTSS / (100*2)(window size). Themax(0.1)ensures that very low-read cells do not get assigned spuriously high TSSEnrichment.ReadsInPromoter: Number of reads from 2000bp upstream of TSS to 101bp downstream of TSSReadsInBlacklist: Number of reads in the provided blacklist regionReadsInTSS: Number of reads overlapping the 101bp centered around each TSSReadsFlankingTSS: Number of reads overlapping 1901-2000bp +/- each TSS
Differences from ArchR: Note that ArchR by default uses a different set of annotations to derive TSS sites and promoter sites. This function uses just one annotation for gene start+end sites, so must be called twice to exactly re-calculate the ArchR QC stats.
ArchR's PromoterRatio and BlacklistRatio are not included in the output, as they can be easily calculated
from ReadsInPromoter / nFrags and ReadsInBlacklist / nFrags. Similarly, ArchR's NucleosomeRatio can be calculated
as (monoNucleosomal + multiNucleosomal) / subNucleosomal.
