Internal engine shared by run_methyltfr and
run_methylTFR_RnBeads. It validates the motif set, allocates
the on-disk sinks, iterates over samples, computes per-motif deviations in
chunks and assembles the resulting methylTFRdeviations object.
The only difference between the two public entry points is where the
per-sample methylation calls come from. That difference is isolated in the
msites_fun argument, so both entry points share identical numerical
behaviour.
Usage
methyltfr_core(
sample_ids,
msites_fun,
samples,
tf_bindsites,
gcfreqs,
gc_dist,
chunkSize = 20,
threads = 1,
enhancer = NULL,
ignoreStrand = TRUE
)Arguments
- sample_ids
A character vector of sample identifiers. Used for the column names of the resulting object and to size the sinks.
- msites_fun
A function of a single integer
ireturning aGRangesobject of methylation calls for samplei, with a numericscoremetadata column holding methylation levels in[0, 1].- samples
A
data.frameof sample annotation with one row per entry ofsample_ids, used ascolData.- tf_bindsites
a
GRangesListobject containing TF binding site positions.- gcfreqs
a
listof GC bin frequency tables.- gc_dist
a
GRangesobject containing the genome-wide GC distribution.- chunkSize
Chunk size for parallel processing of motifs.
- threads
Thread count for parallel processing.
- enhancer
a
GRangesobject restricting the analysis to a set of regions such as distal regulatory elements (optional).- ignoreStrand
if TRUE, strand information is ignored.