Skip to content

Length

Sequence

pp.fpseq.length is used to measure the length of a protein sequence. There are two options: log and normal.

Python

1
2
3
4
5
6
7
import pypropel as pp

l = pp.fpseq.length(
    seq=seq,
    mode='normal',
)
print(l)

Output

67

You can get a log-normalised length value by

1
mode='log',

Output

4.204692619390966

MSA

We can use PyPropel to count the homologs of a MSA.

Python

1
2
3
4
5
6
7
8
import pypropel as pp

msa = pp.msa.read(msa_fpn=to('data/msa/aln/1aijL.aln'))

l = pp.fpmsa.length(
    msa=msa,
)
print(l)

Output

16181