python posterior probability in stockholm file
1
0
Entering edit mode
9.1 years ago
MAK ▴ 10

I want to parse a multiple sequence alignment stockholm file by columns.

Is there any library or package in python to parse a multiple sequence alignment stockholm file and especially get the columns posterior probabilities??

P.s I went through AlignIo object from biopython, I couldn't find a way to get the posterior probability

python probability biopython msa alignment • 2.9k views
ADD COMMENT
0
Entering edit mode

Can you post an example alignment file (here or using something like gist.github.com) which contains the per-column posterior probability numbers you want?

ADD REPLY
0
Entering edit mode
ADD REPLY
2
Entering edit mode
9.0 years ago
Peter 6.0k

These are present in the Stockholm file as per-colum annotation on each sequence, thus:

from Bio import AlignIO
align = AlignIO.read("alignment.sto", "stockholm")
for record in align:
    print(record.id)
    print(record.seq)
    print(record.letter_annotations["posterior_probability"])

Update: See https://github.com/biopython/biopython/issues/357 on not recording the per-column information in Stockholm files.

ADD COMMENT
0
Entering edit mode

I need #GC pp_cons which is per column pp for all sequences and not #GR pp which is per residue pp for each sequence

ADD REPLY
0
Entering edit mode

This will be supported in Biopython 1.66

ADD REPLY

Login before adding your answer.

Traffic: 3198 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6