Pairwise2 Alignment Gap Penalties
1
0
Entering edit mode
3.9 years ago

I am trying to align two sequences. I have the error information for the insertion/deletion of each letter(A,G,T,C). How do I effectively incorporate this into the gap penalty?

alignments = pairwise2.align.globalms(X, Y, 1, -1, -1, -0.1, force_generic=True)
sequencing alignment python biopython • 2.1k views
ADD COMMENT
0
Entering edit mode
3.9 years ago
Mark ★ 1.6k

You can specify a dict of lists that define nucleotide substitution scores. See this answer for an example:

Custom substitution matrix in biopython pairwise2 aligner

Note you need to specify this the d option. Read the documentation:

https://biopython.org/docs/1.75/api/Bio.pairwise2.html

I believe the function call would be:

pairwise2.align.globalds(X, Y, match_dict, ...)
ADD COMMENT
0
Entering edit mode

Yes but is this for substitutions(mismatch) errors?

I have a particular sequence that is passed through a channel which results in insertion, deletion and substitution errors.

I have these probabilities but all insertions and deletions appear as gaps in the alignments.

ADD REPLY
0
Entering edit mode

You can define a callback gap function for such cases then:

c     A callback function returns the gap penalties.

Everything is in the documentation.

ADD REPLY

Login before adding your answer.

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