twinfer.inference.ranked_edges.ranked_edge_lists
- twinfer.inference.ranked_edges.ranked_edge_lists(result, scores=None, time='tb', significant_rho_only=True, fdr=0.05, z_rho_threshold=1.96, top=None, direction_alpha=0.05, z_dag_threshold=1.96, two_way_scenarios=(2,))[source]
Ranked lists of gene pairs, one per score.
- Parameters:
result (pandas.DataFrame) – Returned by infer_with_twinfer (one row per gene pair; with several time points, one (t_a, t_b) pair).
scores (list of str, optional) – Score columns to rank by (without the _ta / _tb suffix), and/or “z_dag” (cross-time correlation, several time points only). None (default): (“z_rho_s”, “z_rho_Delta”), plus “z_dag” when the result has two time points.
time ({"ta", "tb"}) – Which twin group to use when the result has several time points (columns with that suffix).
significant_rho_only (bool, float, float) – Rank only pairs whose z_rho is significant (q_rho <= fdr if a q_rho column exists, else
|z_rho|> z_rho_threshold).fdr (bool, float, float) – Rank only pairs whose z_rho is significant (q_rho <= fdr if a q_rho column exists, else
|z_rho|> z_rho_threshold).z_rho_threshold (bool, float, float) – Rank only pairs whose z_rho is significant (q_rho <= fdr if a q_rho column exists, else
|z_rho|> z_rho_threshold).top (int, optional) – Keep the first top pairs of each list (None = all).
direction_alpha (float, float, tuple of int) – z_dag list: the direction rule of pair_directions (as network_from_scenarios draws it).
z_dag_threshold (float, float, tuple of int) – z_dag list: the direction rule of pair_directions (as network_from_scenarios draws it).
two_way_scenarios (float, float, tuple of int) – z_dag list: the direction rule of pair_directions (as network_from_scenarios draws it).
- Returns:
{score: DataFrame} with the columns rank (1 = largest
|score|), gene_x, gene_y, the score, z_rho, and q_rho, q_rho_Delta, inference_scenario where present. The z_dag list has one row per direction (pair_directions): source, target, directed, z_dag (of that direction), z_dag_xy, z_dag_yx, delta, p_delta instead of gene_x, gene_y. Pairs with a missing score are left out; tied rows keep their order in result.- Return type:
dict