flowchart TD A["FASTQ"] --> B["fastp · bwa-meth<br/>MethylDackel"] B --> C["DSS / bsseq<br/>CpGs + DMRs"] B --> D["samtools · deepTools<br/>FrEIA benchmark"] C --> E["GenomicRanges<br/>clusterProfiler"] D --> F["Locked fragment<br/>feature table"] E --> G["Small pathway/DMR<br/>feature table"] H["sIgA + inflammation<br/>clinical data"] --> I["Participant-level<br/>analysis table"] F --> I G --> I I --> J["glmnet + tidymodels<br/>nested resampling"]
Packages for a methylation–fragmentomics disease fingerprint
software
statistics
reproducibility
A pragmatic open-source stack for EM-seq, fragment features, pathway analysis, integration, and future progression models
Best means fit for purpose
No single package fingerprints disease progression. The strongest stack separates read processing, methylation inference, fragment feature extraction, biological annotation, statistical modeling, and validation. For this project, transparent Bioconductor and workflow tools are preferable to a large black-box model.

Recommended core stack
| Job | Preferred tool | Why it fits | Important caution |
|---|---|---|---|
| Reproducible orchestration | Nextflow + containers | Records dependencies and scales from workstation to compute cluster | Pin container digests and reference files |
| Read QC | fastp + MultiQC | Adapter/quality processing plus cohort-wide QC review | Do not hide group- or batch-specific QC failures |
| EM-seq alignment | bwa-meth | Established bisulfite-aware alignment route used in the planned pipeline | Validate compatibility and conversion metrics for the exact EM-seq protocol |
| Methylation extraction | MethylDackel | Produces per-cytosine methylation calls from aligned reads | Review overlap, duplicate, strand, and bias handling |
| DML/DMR inference | DSS | Coverage-aware beta-binomial modeling and multi-factor designs | Small samples still limit covariate complexity |
| Methylation objects/QC | bsseq | Standard count/coverage representation, smoothing, and visualization | Smoothing choices affect region calls |
| Alternative exploratory methylation workflow | methylKit | Accessible filtering, QC, differential methylation, and tabix-backed data | Pre-specify why it is used alongside or instead of DSS |
| Fragment ends | FrEIA | Open pipeline for fragment-end sequence abundance and diversity | Built around cfDNA WGS; benchmark carefully on EM-seq |
| Generic BAM features | samtools + deepTools + R/Bioconductor | Transparent insert-size, coverage, window, and TSS summaries | Define proper-pair, duplicate, MAPQ, and blacklist rules |
| Genomic annotation | GenomicRanges + annotatr | Reproducible overlap of CpGs/DMRs with genes and regulatory regions | Record genome build and many-to-many mappings |
| Pathway analysis | clusterProfiler | KEGG/GO workflows with explicit gene universes | Use the tested-region background, not every human gene |
| Penalized fingerprint model | glmnet via tidymodels | Elastic net is interpretable and suitable for correlated predictors | Tune and select features inside nested resampling |
| Model interpretation | DALEX or vip | Auditable variable-importance and diagnostics | Importance does not establish causality |
Recommended architecture for this cohort
What to use now versus later
Use now
DSSas the primary coverage-aware methylation model.bsseq/GenomicRangesfor storage, visualization, and annotation.- Simple BAM-derived fragment metrics with explicit definitions.
clusterProfileronly after defining the correct tested-feature universe.glmnetonly for a deliberately small exploratory integrated signature.
Benchmark before adopting
FrEIA, because its assumptions and preprocessing were developed for cfDNA WGS rather than enzymatically converted libraries.- Tissue-deconvolution tools such as
EpiDISH, because available reference matrices may be platform-, tissue-, or array-specific and may not transfer to plasma EM-seq. - FinaleMe/FRAGMA implementations, because the cited methods demonstrate important principles but are not automatic replacements for direct EM-seq methylation calls.
Add when longitudinal outcomes exist
Non-negotiable safeguards
- Keep participant IDs grouped across all resampling splits.
- Never select DMRs on the full dataset before cross-validation.
- Fit normalization, imputation, and scaling on training folds only.
- Preserve raw counts and coverage; do not model methylation percentages without depth awareness.
- Record software versions, reference genome checksum, annotations, pathway database date, and parameters.
- Report uncertainty, calibration, and feature stability alongside discrimination.
NotePractical recommendation
Start with a containerized Nextflow workflow producing one reviewed participant-level feature table. Use DSS for the primary methylation inference, transparent BAM summaries for first-pass fragmentomics, and elastic net only after reducing the feature space through pre-specified biology—not outcome-driven screening.
Follow the molecular pipeline → · See how the software stack evolved → · Understand the statistical procedures →