Sums the reads over the samples and returns the fraction of reads on the reference allele, joined with the motif preference of the SNPs. This is the table behind a plot of binding preference against allelic accessibility.

ascPreferenceTable(refMat, altMat, sampleIds, prefDt, minReads = 4)

Arguments

refMat, altMat

reference and alternative count matrices (sites x samples).

sampleIds

samples to sum over.

prefDt

the output of ascMotifPreference, or any table with the columns snpId, tf and preference.

minReads

SNPs with fewer reads in the summed samples are dropped (default 4).

Value

A data.table with one row per SNP and motif: snpId, refFrac, total and the columns of prefDt.

Author

Irem B. GUNDUZ