Change biopython pairwise2 output format alignment ?
1
0
Entering edit mode
2.5 years ago

Hi all, Whenever I use pairwise2 to align two sequences with at the end:

print (pairwise2.format_alignment(*aln[0]))

I get a output result that looks like:

Alignement

Is it possible to get the output in a different format, like for example an output where there is only two rows, removing the pipe and dot ( ||.|…| ) line ?

I could not find the info on https://biopython.org/docs/1.75/api/Bio.pairwise2.html?highlight=bio.pairwise2.format_alignment#Bio.pairwise2.format_alignment , at the end there is a mention on the formatting but either I did not understood how it works or there is no explanation on how to change the format (if possible).

Thanks

biopython pairwise2 alignment format output • 661 views
ADD COMMENT
0
Entering edit mode
2.5 years ago

You can split the resulting text output into lines, then replace the characters as needed.

It is a bit hacky but provides the most flexibility.

ADD COMMENT

Login before adding your answer.

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