Biopython How To Access Fa_Z-Score In Bio.Align.Multipleseqalign
1
0
Entering edit mode
12.0 years ago
Richard ▴ 590

I'm new to biopython.

I can see through my debugger that the alignment I have loaded has 2 SeqRecords (as expected). Now I can see through my debugger that some of the descriptions of this alignment are hidden deep in the data structure in a dictionary. Specifically, I can see that there is a variable called fa_z-score that I would like to be able to access the value of.

My code, which is pretty much exactly a copy from the biopython tutorials:

f = open("fasta.out", 'r')
for a in AlignIO.parse(f, "fasta-m10"):
print(a)
print "Alignment length %i" % a.get_alignment_length()
for record in a:
    print record.seq, record.name, record.id

Who can tell me how to access the fa_z-score variable in my "a"?

biopython • 2.2k views
ADD COMMENT
1
Entering edit mode
12.0 years ago
Richard ▴ 590

Ahhh. It was an underscore that was holding me back.

zscore = a._annotations["fa_z-score"]
ADD COMMENT
1
Entering edit mode

For now, yes, do that. In Python a leading underscore indicates a private method/function that isn't considered part of the public API. In this case, that is because we don't have a proper setup for storing alignment level annotation yet - but parsing FASTA pairwise alignments is something being worked on this summer by a Biopython Google Summer of Code (GSoC) student project.

ADD REPLY

Login before adding your answer.

Traffic: 4027 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