
Progressive two-pass interaction selection
add_interactions_progressive.RdImplements the two-pass interaction-selection pattern used manually in Akhiad's analysis workflow:
Arguments
- traj_model
A
TrajectoryModel.- thresholds
A numeric vector of
interaction_thresholdvalues, one per pass. Defaultc(0.01, 0.0005)mirrors Akhiad's pattern.- only_sig_motifs
A logical vector matched to
thresholds. Defaultc(TRUE, FALSE).- only_sig_add_motifs
A logical vector matched to
thresholds. Defaultc(TRUE, TRUE).- additional_features_builder
NULL or a function taking the traj_model after pass 1 and returning a data frame to cbind onto
@additional_features. Usedefault_score_split_features()as a ready-made builder whenatac_scoresis available.- interaction_scale_factor, min_signal_correlation
Forwarded to each
add_interactions()call.- seed
Integer seed forwarded to
add_interactions().- ...
Additional arguments forwarded to
add_interactions()(e.g.max_motif_n,max_add_n,max_n,logist_interactions).
Value
The updated trajectory model with interactions and any engineered additional features from the builder.
Details
First pass: tight
interaction_threshold[1], typically withonly_sig_motifs = TRUE— a strict selection to seed the model with high-confidence interactions.(Optional) Call
additional_features_builder(traj_model)to produce engineered additional features (e.g.base_pred,end_predfromdefault_score_split_features()) and inject them. Relearn once so the next pass sees an enriched anchor set.Second pass: looser
interaction_threshold[2], typically withonly_sig_motifs = FALSEandforce = TRUE— broader selection that can pick interactions anchored on the newly-injected features.
Without a feature builder, the two passes are equivalent to a single
add_interactions() call at the final (loosest) threshold, so the
primary use case is with default_score_split_features or a custom
builder. For data without multi-bin atac_scores, prefer a single
add_interactions() call with interaction_threshold = thresholds[1].