Output

class enzymm.output.BaseTable(matches: List[Match])

A base class for different types of output styles. Easily adaptable

__init__(matches: List[Match])
classmethod columns() List[str]

Return List of column names.

dumps(header: bool = False) str

Dump Match to a string. Calls Match.dump()

Parameters:

header – if a header line should be dumped to the string too.

classmethod from_match(match: Match)

Generate the table from a single Match

classmethod from_matches(matches: Iterable[Match]) BaseTable

Generate the table from a list of Match

to_polars() polars.DataFrame

Create a polars.DataFrame from this table.

Returns:

polars.DataFrame with the schema set out in the child class!

Note

Calling this function requires the polars library!

write_tsv(file: TextIO, header: bool = True) None

Dump the ‘Table’ as an iteralbe or rows to a ‘.tsv’ like file.

Parameters:
  • filefile-like object to write to

  • headerbool If a header line should be written too

Note

Coordinate information is not written.

class enzymm.output.FullMatchTable(matches: List[Match])

A class for representing the full information associated with EnzyMM matches.

class Row(match: Match)

Subclass for defining and building a row in a FullMatchTable

__init__(match: Match)
classmethod columns() List[str]

Return a list of str of column names for the FullMatchTable

classmethod from_match(match: Match) Iterable[FullMatchTable.Row]

Create a row per match for a FullMatchTable

Returns:

Iteralbe of FullMatchTable.Row

class enzymm.output.MatchResidueTable(matches: List[Match])

A class for representing residue mappings between query, template and reference from EnzyMM matches.

class Row(q_res: Tuple[str, str, str], t_res: AnnotatedResidue, match: Match)

Subclass for defining and building a row in a MatchResidueTable

__init__(q_res: Tuple[str, str, str], t_res: AnnotatedResidue, match: Match)
classmethod columns() List[str]

Return a list of str of column names for the MatchResidueTable

classmethod from_match(match: Match) Iterable[MatchResidueTable.Row]

Create one row per matched residue in the match for a MatchResidueTable

Returns:

Iteralbe of MatchResidueTable.Row

class enzymm.output.SimpleMatchTable(matches: List[Match])

A class for representing the simpler information associated with EnzyMM matches.

class Row(match: Match)

Subclass for defining and building a row in a SimpleMatchTable

__init__(match: Match)
classmethod columns() List[str]

Return a list of str of column names for the SimpleMatchTable

classmethod from_match(match: Match) Iterable[SimpleMatchTable.Row]

Create a row per match for a SimpleMatchTable

Returns:

Iteralbe of SimpleMatchTable.Row

class enzymm.output.Tables

A class for creating instances of children of BaseTable of the selected kind

classmethod create(kind: Literal['full'], matches: Iterable[Match]) FullMatchTable
classmethod create(kind: Literal['simple'], matches: Iterable[Match]) SimpleMatchTable
classmethod create(kind: Literal['residue'], matches: Iterable[Match]) MatchResidueTable

Create an instance of the selected kind of table from a list of matches

Parameters:
  • kind – One of the following str ‘full’, ‘simple’ or ‘residue’

  • matcheslist of Match objects

Returns:

BaseTable child. The exact type depends on the ‘kind’ argument.