Calculate the Percentage Identity (PID) score for aligned sequence pairs.
Parameters : | almA, almB : string or list
mode : { 1, 2, 3, 4, 5 }
|
---|---|
Returns : | score : float
|
See also
Notes
The PID score is a common measure for the diversity of a given alignment. The implementation employed by LingPy follows the description of Raghava2006 where four different variants of PID scores are distinguished. Essentially, the PID score is based on the comparison of identical residue pairs with the total number of residue pairs in a given alignment.
Examples
Load an alignment from the test suite.
>>> from lingpy import *
>>> pairs = PSA(get_file('test.psa'))
Extract the alignments of the first aligned sequence pair.
>>> almA,almB,score = pairs.alignments[0]
Calculate the PID score of the alignment.
>>> pid(almA,almB)
0.44444444444444442