CardamomOT.inference.trajectory =============================== .. py:module:: CardamomOT.inference.trajectory .. autoapi-nested-parse:: Core functions for the inference of trajectories, mainly used in loop_trajectories Functions --------- .. autoapisummary:: CardamomOT.inference.trajectory.find_next_prot_mixed CardamomOT.inference.trajectory.find_next_prot CardamomOT.inference.trajectory.filter_network_fancy Module Contents --------------- .. py:function:: find_next_prot_mixed(d1, P0, M0, M1, mode_init, mode_end, alpha, s, delta_t) Deterministic flow interpolating between two points .. py:function:: find_next_prot(d1, P0, M0, M1, mode_init, mode_end, alpha, s, delta_t) Deterministic flow interpolating between two points .. py:function:: filter_network_fancy(T, N_traj, prot_traj, ks, basal_ref, inter_ref, seuil_intensity=0.05, seuil_variations=0.05, seuil_synergy=1.5, samples_data=None, n_jobs=-1) Structured three-pass edge filtering that avoids both the greedy order-dependence problem and the silent-synergy problem. Pass 1 — Canonical individual scoring Each edge is evaluated independently against the full reference network. Produces a continuous impact score per edge. Pass 2 — Conditional re-evaluation of rejected edges Edges rejected in pass 1 are re-evaluated inside the filtered network (without other rejected edges). An edge that was silent in the full network but becomes significant once dominant edges are removed was being masked — it is reinstated. Pass 3 — Pairwise synergy check among weak edges Among edges with low but non-zero individual scores, pairs are tested jointly. If removing both edges together produces an impact significantly greater than the sum of their individual impacts (super-additivity), both edges are retained. :param T: Number of time steps. :type T: int :param N_traj: Number of trajectories. :type N_traj: int :param prot_traj: Protein trajectories, shape (T * N_traj, G). :type prot_traj: array :param ks: Kinetic parameters. :type ks: array :param basal_ref: Basal transcription rates, shape (G, n_networks) or (n_samples, G, n_networks). :type basal_ref: array :param inter_ref: Reference interaction matrix, shape (G, G, n_networks). :type inter_ref: array :param seuil_intensity: Minimum absolute edge weight to enter evaluation at all. :type seuil_intensity: float :param seuil_variations: Minimum variation score to retain an edge (main threshold). :type seuil_variations: float :param seuil_synergy: Multiplicative factor above which joint impact is considered super-additive. An edge pair (e1, e2) is flagged as synergistic if impact(e1 + e2 removed) > seuil_synergy * (score(e1) + score(e2)). Default 2.0 (joint impact must be at least twice the additive sum). :type seuil_synergy: float :param samples_data: Additional per-sample data passed to _kon_per_sample. :type samples_data: optional :param n_jobs: Number of parallel jobs for joblib (-1 = all cores). :type n_jobs: int :returns: * **inter** (*array, shape (G, G, n_networks)*) -- Filtered interaction matrix (binary mask applied to inter_ref). * **inter_t** (*array, shape (T, G, G, n_networks)*) -- Time-resolved interaction tensor. * **report** (*dict*) -- Diagnostic report with keys: - 'scores_pass1' : raw scores from pass 1, shape (G, G, n_networks) - 'reinstated' : list of edges reinstated by pass 2 - 'synergistic' : list of edge pairs flagged as synergistic in pass 3 - 'retained_mask' : final boolean retention mask