[Biopython] How to only extract the best alignment without looping with Bio.Align

Slowat <[email protected]> Wed, 14 Aug 2024 11:46:23 +0100
Newsgroups gmane.comp.python.bio.general
Message-ID <CAC_Z2aCtbT-e52sYU4jK-8akdJ00Lety+cTrto6fGOPH4P0=ww@mail.gmail.com>
--===============0305497722771571644==
Content-Type: multipart/alternative; boundary="000000000000938f93061fa270a7"

--000000000000938f93061fa270a7
Content-Type: text/plain; charset="UTF-8"

Hello -

May I ask. I want to align two sequences, and return, for the optimal
alignment only, the score, number of identities, mismatches, gaps etc.

I can see that this is possible by using the 'one_alignment_only=True'
parameter in the pairwise2 module, however when I load the pairwise2
module, I get the message that this module is deprecated.

Using Bio.Align, I can see how you can obtain the .score for the best
alignment, but not how to obtain the other information I require about the
best alignment.

I don't want to loop through all the possible alignments, as this would be
prohibitively time-consuming for me. Also, since the .score of the best
alignment can be returned, it makes me think that the best alignment should
be saved somewhere and I should be able to see it (even to calculate the
gaps, identities and mismatches myself).

Could someone explain how to go about this, without using the deprecated
pairwise2 module?

Thanks
Slowat

--000000000000938f93061fa270a7
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hello -=C2=A0<div><br></div><div>May I ask. I want to alig=
n two sequences, and return, for the optimal alignment only, the score, num=
ber of identities, mismatches, gaps etc.</div><div><br></div><div>I can see=
 that this is possible by using the &#39;one_alignment_only=3DTrue&#39; par=
ameter in the pairwise2 module, however when I load the pairwise2 module, I=
 get the message that this module is deprecated.</div><div><br></div><div>U=
sing Bio.Align, I can see how you can obtain the .score for the best alignm=
ent, but not how to obtain the other information I require about the best a=
lignment.</div><div><br></div><div>I don&#39;t want to loop through all the=
 possible alignments, as this would be prohibitively time-consuming for me.=
 Also, since the .score of the best alignment can be returned, it makes me =
think that the best alignment should be saved somewhere and I should be abl=
e to see it (even to calculate the gaps, identities and mismatches myself).=
</div><div><br></div><div>Could someone explain how to go about this, witho=
ut using the deprecated pairwise2 module?</div><div><br></div><div>Thanks</=
div><div>Slowat</div></div>

--000000000000938f93061fa270a7--

--===============0305497722771571644==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Biopython mailing list  -  [email protected]
https://mailman.open-bio.org/mailman/listinfo/biopython

--===============0305497722771571644==--