seqme.metrics.Length

seqme.metrics.Length#

class seqme.metrics.Length(objective='minimize')[source]#

Average sequence length.

Sequence length is defined as the number of characters in a sequence.

__init__(objective='minimize')[source]#

Initialize the metric.

Parameters:

objective (Literal['minimize', 'maximize']) – Whether to minimize or maximize the metric.

__call__(sequences)[source]#

Compute the average sequence length.

Parameters:

sequences (list[str]) – A list of sequences.

Returns:

Mean sequence length and sequence length standard deviation.

Return type:

MetricResult

Methods

__init__([objective])

Initialize the metric.

__call__(sequences)

Compute the average sequence length.

Attributes

name

Name of the metric.

objective

Whether lower or higher scores indicate better performance.