EValue#

class pyswrd.EValue#

A class for calculating E-values from alignment scores.

__init__(database_size, scorer)#

Create a new E-value calculator.

Parameters:
  • database_size (int) – The total length of the database, i.e. the cumulated length of all sequences lengths in the database.

  • scorer (Scorer) – The scorer to use for computing the alignment scores.

calculate(score, query_length, target_length)#

Calculate the E-value for a single alignment.

Parameters:
  • score (float) – The score of the alignment.

  • query_length (int) – The length of the query sequence in the alignment.

  • target_length (int) – The length of the target sequence in the alignment.

Returns:

float – The E-value for the alignment.