LingPy

lingpy.compare.Multiple.get_pid

Multiple.get_pid(mode=1)

Return the Percentage Identity (PID) score of the calculated MSA.

Parameters :

mode : { 1, 2, 3, 4, 5 }

Indicate which of the four possible PID scores described in Raghava2006 should be calculated, the fifth possibility is added for linguistic purposes:

  1. identical positions / (aligned positions + internal gap positions),
  2. identical positions / aligned positions,
  3. identical positions / shortest sequence, or
  4. identical positions / shortest sequence (including internal gap pos.)
  5. identical positions / (aligned positions + 2 * number of gaps)
Returns :

score : float

The PID score of the given alignment as a floating point number between 0 and 1.