schemarecomb.parent_alignment.calc_identity

schemarecomb.parent_alignment.calc_identity(sr1, sr2)

Calculate the BLAST identity between two sequences.

Note

“BLAST identity” is defined as the number of matches in a pairwise alignment divided by the length of alignment. This is different from the “traditional” definition of identity: number of matches divided by the minimum of the sequence lengths.

Parameters
  • sr1 (SeqRecord) – SeqRecord of first sequence to compare.

  • sr2 (SeqRecord) – SeqRecord of second sequence to compare.

Return type

float

Returns

The BLAST identity between the two sequences.