Pools reads across the requested samples, orients each ASC SNP toward its predicted stronger-binding allele using deltaDt, and computes the ascActivityStat per transcription factor. Only sites whose absolute PWM delta exceeds prefDelta (i.e. the motif is actually disrupted) and whose pooled coverage reaches minReads are used.

ascTFActivity(
  refMat,
  altMat,
  deltaDt,
  sampleIds,
  prefDelta = 1,
  minReads = 4L,
  minSites = 10L,
  nPerm = 2000L,
  seed = 42L,
  label = NA_character_
)

Arguments

refMat, altMat

count matrices [snp x sample] (e.g. from mergeDsASCArray).

deltaDt

data.table with columns snpId, tf, delta (PWM score alt - ref), as produced by the motif-scoring step of the driver script.

sampleIds

samples to pool over (a condition, lineage, etc.).

prefDelta

|delta| threshold to count a site as motif-disrupting (default 1.0, matching 03_tf_binding.R).

minReads

minimum pooled coverage (H+L) to keep a site (default 4).

minSites

minimum number of usable sites to report a TF (default 10).

nPerm

permutations for the null (default 2000).

seed

RNG seed (default 42).

label

optional context label copied into the output column context.

Value

data.table: tf, context, nSites, obs, z, p, fdr (BH over TFs), meanNull, sdNull.

Author

Irem B. GUNDUZ