Collections:
Pairwise Sequence Alignment Score Settings
How to change Pairwise Sequence Alignment Score Settings?
✍: FYIcenter.com
Bio.Align.PairwiseAligner().align() uses a set of Alignment Score Settings to control how each possible alignment score is calculated. It then returns only those alignments that have the highest score.
Here are the Alignment Score Settings their default values.
fyicenter$ python >>> from Bio import Align >>> aligner = Align.PairwiseAligner() >>> print(aligner) Pairwise sequence aligner with parameters wildcard: None match_score: 1.000000 mismatch_score: 0.000000 target_internal_open_gap_score: 0.000000 target_internal_extend_gap_score: 0.000000 target_left_open_gap_score: 0.000000 target_left_extend_gap_score: 0.000000 target_right_open_gap_score: 0.000000 target_right_extend_gap_score: 0.000000 query_internal_open_gap_score: 0.000000 query_internal_extend_gap_score: 0.000000 query_left_open_gap_score: 0.000000 query_left_extend_gap_score: 0.000000 query_right_open_gap_score: 0.000000 query_right_extend_gap_score: 0.000000 mode: global
With these default settings, we will get 3 alignments with the best score of 4.0 between AACTT" and "AAGTT".
>>> alignments = aligner.align("AACTT", "AAGTT") >>> for alignment in alignments: ... print("score = {}".format(alignment.score)) ... print(alignment) ... score = 4.0 target 0 AAC-TT 5 0 ||--|| 6 query 0 AA-GTT 5 score = 4.0 target 0 AA-CTT 5 0 ||--|| 6 query 0 AAG-TT 5 score = 4.0 target 0 AACTT 5 0 ||.|| 5 query 0 AAGTT 5
But actually, the last alignment is much better than the first 2 alignments. In order to give the last alignment a higher total score, we can give a lower gap score setting.
>>> aligner.gap_score = -1.0 >>> print(aligner) Pairwise sequence aligner with parameters wildcard: None match_score: 1.000000 mismatch_score: 0.000000 target_internal_open_gap_score: -1.000000 target_internal_extend_gap_score: -1.000000 target_left_open_gap_score: -1.000000 target_left_extend_gap_score: -1.000000 target_right_open_gap_score: -1.000000 target_right_extend_gap_score: -1.000000 query_internal_open_gap_score: -1.000000 query_internal_extend_gap_score: -1.000000 query_left_open_gap_score: -1.000000 query_left_extend_gap_score: -1.000000 query_right_open_gap_score: -1.000000 query_right_extend_gap_score: -1.000000 mode: global >>> alignments = aligner.align("AACTT", "AAGTT") >>> for alignment in alignments: ... print("score = {}".format(alignment.score)) ... print(alignment) ... score = 4.0 target 0 AACTT 5 0 ||.|| 5 query 0 AAGTT 5
As you can see from the output, alignments with gaps are not returned any more, because their score is 2.0 now.
target 0 A A C - T T 5 0 | | - - | | 6 query 0 A A - G T T 5 ---------------- 1 1 -1 -1 1 1 = 2.0
⇒ Too Many Results from align() Function
⇐ Calculate Pairwise Sequence Alignment
2023-05-09, 642🔥, 0💬
Popular Posts:
Molecule Summary: ID: FYI-1002226 Names: InChIKey: RJNJNLPEYZFHEL-HKWRFOASS A-NSMILES: CC5=C(C(N)=O)...
Molecule Summary: ID: FYI-1002570 Names: InChIKey: DVHNEVRQOJPCCG-UHFFFAOYS A-NSMILES: Cc1occc1C(=O)...
How Stereoinformation is stored in in SDF/Mol V3000 files? Similar to SDF/Mol V2000, stereoinformati...
Molecule Summary: ID: FYI-1004233 Names: InChIKey: FBZXVLKGAAWMCE-UIGHHBECS A-NSMILES: O=C(Cc1cc(O)n...
Molecule Summary: ID: FYI-1000179 SMILES: CNC[C@H](O)C1=CC(O)=C(O) C=C1Received at FYIcenter.com on:...