[Biopython-dev] [Biopython - Feature #3396] (New) Add alignment score, % identity, % similarity, % gaps, etc to EmbossIO

redmine at redmine.open-bio.org redmine at redmine.open-bio.org
Wed Nov 28 00:46:22 UTC 2012


Issue #3396 has been reported by Olga Botvinnik.

----------------------------------------
Feature #3396: Add alignment score, % identity, % similarity, % gaps, etc to EmbossIO
https://redmine.open-bio.org/issues/3396

Author: Olga Botvinnik
Status: New
Priority: Normal
Assignee: Olga Botvinnik
Category: 
Target version: 
URL: 


As of BioPython 1.59, if an alignment is read in with Bio.AlignIO(handle, 'emboss'), the metadata such as the substitution matrix used, gap_penalty, extend_penalty, identity, similarity, gaps, and score in the header is ignored:

<pre>
#=======================================
#
# Aligned_sequences: 4
# 1: IXI_234
# 2: IXI_235
# 3: IXI_236
# 4: IXI_237
# Matrix: EBLOSUM62
# Gap_penalty: 10.0
# Extend_penalty: 0.5
#
# Length: 131
# Identity:      95/131 (72.5%)
# Similarity:   127/131 (96.9%)
# Gaps:          25/131 (19.1%)
# Score: 100.0
#
#
#=======================================
</pre>

I edited the EmbossIO.py file to read these metadata and add it as an annotation to each SeqRecord in the MultipleSequenceAlignment object, since the MultipleSequenceAlignment object does not have the option for annotations. I also added the appropriate unit tests. Please let me know if there is a bug in the code that I missed.

For example, for the above alignment, the SeqRecord objects would have the following annotations:

<pre>
{'identity_denominator': 131, 'matrix': 'EBLOSUM62', 'similarity': 0.8549618320610687, 'similarity_numerator': 112, 'similarity_denominator': 131, 'gaps': 0.1450381679389313, 'identity_numerator': 112, 'gap_penalty': 10.0, 'extend_penalty': 0.5, 'gaps_denominator': 131, 'score': 591.5, 'identity': 0.8549618320610687, 'gaps_numerator': 19}
</pre>

I decided to keep the numerators and denominators separately from the identity, similarity, and gap percentages just in case a user wanted to do something else with them.


----------------------------------------
You have received this notification because this email was added to the New Issue Alert plugin


-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here and login: http://redmine.open-bio.org




More information about the Biopython-dev mailing list