Skip to content

How to save the results from an multiple alignment #326

Answered by padix-key
rpestana94 asked this question in Q&A
Discussion options

You must be logged in to vote

If you would like to save the alignment as fasta file, you can use biotite.sequence.io.fasta.set_alignment() (https://www.biotite-python.org/apidoc/biotite.sequence.io.fasta.set_alignment.htm):

fasta_file = fasta.FastaFile()
fasta.set_alignment(fasta_file, alignment, seq_names=ids)
fasta_file.write("alignment.fasta")

If you prefer another format, you have to write the file yourself, unfortunately. However, you can start with Alignment.get_gapped_sequences() (https://www.biotite-python.org/apidoc/biotite.sequence.align.Alignment.html#biotite.sequence.align.Alignment.get_gapped_sequences) to convert the alignment into gapped sequence strings.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rpestana94
Comment options

Answer selected by padix-key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants