Collections:
Pre-defined Sequence Alignment Score Settings
How to Use Pre-defined Sequence Alignment Score Settings?
✍: FYIcenter.com
Biopython provides 3 Pre-defined Sequence Alignment Score Settings:
"blastn" and "megablast" for nucleotide alignments,
and "blastp" for protein alignments.
Here is an example on how to "blastp" score settings.
fyicenter$ python
>>> from Bio import Align
>>> aligner = Align.PairwiseAligner(scoring="blastp")
>>> print(aligner)
Pairwise sequence aligner with parameters
substitution_matrix: <Array object at 0x111404eb0>
target_internal_open_gap_score: -12.000000
target_internal_extend_gap_score: -1.000000
target_left_open_gap_score: -12.000000
target_left_extend_gap_score: -1.000000
target_right_open_gap_score: -12.000000
target_right_extend_gap_score: -1.000000
query_internal_open_gap_score: -12.000000
query_internal_extend_gap_score: -1.000000
query_left_open_gap_score: -12.000000
query_left_extend_gap_score: -1.000000
query_right_open_gap_score: -12.000000
query_right_extend_gap_score: -1.000000
mode: global
>>> target = "AEPNAATNYATEAMDSLKTQAIDLISQTWPVVTTVVVAGLVIRLFKKFSSKA"
>>> query = "DGTSTATSYATEAMNSLKTQATDLIDQTWPVVTSVAVAGLAIRLFKKFS"
>>> alignments = aligner.align(target, query)
>>> print(len(alignments))
1
>>> print(alignments[0])
target 0 AEPNAATNYATEAMDSLKTQAIDLISQTWPVVTTVVVAGLVIRLFKKFSSKA 52
0 .....||.||||||.||||||.|||.|||||||.|.||||.||||||||--- 52
query 0 DGTSTATSYATEAMNSLKTQATDLIDQTWPVVTSVAVAGLAIRLFKKFS--- 49
>>> print(alignments.score)
166.0
As you see "blastp" score settings eliminated the alignment that has an internal gap, because the internal gap score is set to -12.0, much lower than left or right gaps.
Eliminated alignment:
target 0 AEPNAATNYATEAMDSLKTQAIDLISQTWPVVTTVVVAGLVIRLFKKFSSKA 52
0 .....||.||||||.||||||.|||.|||||||.|.||||.|||||||-|-- 52
query 0 DGTSTATSYATEAMNSLKTQATDLIDQTWPVVTSVAVAGLAIRLFKKF-S-- 49
⇒ Get Help Documentation with Biopython
⇐ Too Many Results from align() Function
2023-08-03, 1112🔥, 0💬
Popular Posts:
Molecule Summary: ID: FYI-1002073 Names: InChIKey: OTMSDBZUPAUEDD-UHFFFAOYS A-NSMILES: CC Received a...
Molecule Summary: ID: FYI-1000324 SMILES: C[C@@](c1cc(cc(c1)F)F)(C (=O)OC)NReceived at FYIcenter.com...
How to save molecules created in JSME editor to the Web server? If you want to save the molecule str...
Molecule Summary: ID: FYI-1001441 SMILES: C(=O)(C3CN(C(=O)C1=C(C=C C=C1)CC2CO2)C4=C3C=CC=C4 )OReceive...
Molecule Summary: ID: FYI-1001314 SMILES: COC(=O)[C@@H]1[C@H]2CC[C @H](N2CCCC(F)C)[C@@H]1C3 CC3Receiv...