lmpy.data_wrangling.matrix.match_tree_wrangler

Module containing data wranglers for matching a matrix to a tree.

Module Contents

Classes

MatchTreeMatrixWrangler

Constructor for MatchTreeMatrixWrangler class.

class lmpy.data_wrangling.matrix.match_tree_wrangler.MatchTreeMatrixWrangler(tree, species_axis, **params)[source]

Bases: lmpy.data_wrangling.matrix.base._MatrixDataWrangler

Constructor for MatchTreeMatrixWrangler class.

Parameters
  • tree (TreeWrapper or str) – A tree object or file path to a tree.

  • species_axis (int) – The matrix axis with species names to match.

  • **params (dict) – Keyword parameters to pass to _MatrixDataWrangler.

name = MatchTreeMatrixWrangler[source]
version = 1.0[source]
wrangle_matrix(matrix)[source]

Wrangle a matrix.

Parameters

matrix (Matrix) – A matrix to wrangle.

Returns

The matrix subset to tree tip names.

Return type

Matrix