Residue.get_leading_gaps() — get number of gaps before this residue

get_leading_gaps()
This returns the number of gaps in the alignment immediately preceding this residue. Not available for model sequences.