Convenience Helpers#

One-call wrappers that compose delta_heuristic() and squirrel() for the most common workflows. Use these when you do not need the intermediate SqQuartetProfileSet.

physquirrel.convenience.delta_heuristic_from_msa(msa: MSA, lam: float = 0.3, weight: bool = True) SqQuartetProfileSet#

Compute a SqQuartetProfileSet from an MSA using Hamming distances and the delta heuristic.

Parameters:
  • msa (MSA)

  • lam (float) – Delta threshold separating split quartets from cycle quartets. Default 0.3.

  • weight (bool) – Weight profiles by delta confidence. Default True.

Return type:

SqQuartetProfileSet

physquirrel.convenience.squirrel_from_distances(distance_matrix: DistanceMatrix, lam: float = 0.3, weight: bool = True, outgroup: str | None = None, **kwargs) SemiDirectedPhyNetwork | DirectedPhyNetwork#

Reconstruct a phylogenetic network directly from a distance matrix.

Runs delta_heuristic then squirrel in one call.

Parameters:
  • distance_matrix (DistanceMatrix)

  • lam (float) – Delta threshold. Default 0.3.

  • weight (bool) – Weight profiles by delta confidence. Default True.

  • outgroup (str | None) – If provided, returns a rooted DirectedPhyNetwork. Default None.

  • **kwargs – Passed to squirrel (e.g. rho, tsp_threshold, parallel).

Return type:

SemiDirectedPhyNetwork | DirectedPhyNetwork

physquirrel.convenience.squirrel_from_msa(msa: MSA, lam: float = 0.3, weight: bool = True, outgroup: str | None = None, **kwargs) SemiDirectedPhyNetwork | DirectedPhyNetwork#

Reconstruct a phylogenetic network directly from an MSA.

Computes Hamming distances, runs delta_heuristic, then squirrel.

Parameters:
  • msa (MSA)

  • lam (float) – Delta threshold. Default 0.3.

  • weight (bool) – Weight profiles by delta confidence. Default True.

  • outgroup (str | None) – If provided, returns a rooted DirectedPhyNetwork. Default None.

  • **kwargs – Passed to squirrel (e.g. rho, tsp_threshold, parallel).

Return type:

SemiDirectedPhyNetwork | DirectedPhyNetwork