Package: mectx 1.1.1

Dipankor Dhrubo

mectx: MEchanistic Clustering - Treatment eXposure Framework

Implements the MEC-TX (MEchanistic Clustering - Treatment eXposure) framework for encoding, clustering, and survival analysis of real-world oncology treatment timelines. Provides functions for normalising medication records, computing treatment intervals, performing k-means clustering in PCA space, assigning line-of-therapy labels, and comparing survival outcomes across treatment groups. Designed for use with registry-based cohorts such as the ORIEN AVATAR dataset. Methods follow the digital-twin framework described in Dhrubo and Spakowicz (2026) <https://github.com/spakowiczlab/mec-tx>. treatment timelines using the MEC-TX digital-twin framework.

Authors:Dipankor Dhrubo [aut, cre], Daniel Spakowicz [aut]

mectx_1.1.1.tar.gz
mectx_1.1.1.tar.gz(r-4.7-any)mectx_1.1.1.tar.gz(r-4.6-any)
mectx_1.1.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html
card.svg |card.png
mectx/json (API)

# Install 'mectx' in R:
install.packages('mectx', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

On CRAN:

Conda:

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

1.70 score 2 scripts 17 exports 51 dependencies

Last updated from:71351649ec. Checks:4 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK182
source / vignettesOK219
linux-release-x86_64OK188
wasm-releaseOK135

Exports:cox_forest_plot_from_dfdominant_exclusiveget_focus_cohortkm_panel_from_dfplot_timeline_for_kprep_segsstandardise_statustimeline_paneltreatment_sharestx_cluster_survtx_compare_groupstx_durationtx_focus_dttx_intervalstx_linestx_normalizetx_pooled_analysis

Dependencies:askpassbackportsbroomclicpp11dplyrfarverforcatsgenericsggnewscaleggplot2gluegtablehereisobandjsonlitelabelinglatticelifecyclemagrittrMatrixopensslpatchworkpillarpkgconfigpngpurrrR6rappdirsRColorBrewerRcppRcppEigenRcppTOMLreticulaterlangrprojrootRSpectraS7scalesstringistringrsurvivalsystibbletidyrtidyselectumaputf8vctrsviridisLitewithr

Readme and manuals

Help Manual

Help pageTopics
Cox Proportional Hazards Forest Plotcox_forest_plot_from_df
Assign Mutually Exclusive Dominant Treatment Regimen Per Patientdominant_exclusive
Extract Focus Cohort Sample IDsget_focus_cohort
Kaplan-Meier Survival Panel with Optional Risk Tablekm_panel_from_df
Treatment Timeline Facet Plot by Cluster Assignmentplot_timeline_for_k
Recode and clip treatment segments to canonical types Validates a raw segments data frame, recodes free-text treatment type labels to the eight canonical MEC-TX types via regex, and clips segment start/end times to '[0, horizon_years]'. Zero-duration segments (after clipping) and rows with 'NA' in 'sample', 't0', or 't1' are dropped. Called upstream by 'plot_timeline_for_k()' and 'timeline_panel()' - not intended for direct use.prep_segs
Standardise Survival Status Column to 0/1 Integerstandardise_status
Treatment Timeline Panel for Selected Patientstimeline_panel
Compute per-patient treatment type durations and shares Takes a clipped and recoded segments data frame (output of 'prep_segs') and computes per-patient treatment duration and share for each of the eight canonical treatment types. Returns a wide-format tibble with one row per patient. Called upstream by 'timeline_panel' and 'plot_timeline_for_k' - not intended for direct use.treatment_shares
Cluster Treatment Timelines and Attach Survival Datatx_cluster_surv
Flexible Survival Comparison by Grouping Variable or Custom Groupstx_compare_groups
Treatment Duration Analysis by Grouping Variabletx_duration
Digital Twin Focus Analysis for a Specific Treatment Typetx_focus_dt
Convert Normalised Treatment Timeline to Treatment Intervalstx_intervals
Detect Lines of Therapy from Treatment Timelinestx_lines
Normalise Raw Medication Data into a Grid-Based Treatment Timelinetx_normalize
Pooled Treatment Cohort Analysistx_pooled_analysis