How to save the results from an multiple alignment #326
-
I have as test 13 sequences each one about 1270 amino acids in length, and I want to save the alignment result in a file (text, clustal, msf, etc) but I can't find a way to properly do it. I have the following code:
Thanks in advance |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If you would like to save the alignment as fasta file, you can use 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 |
Beta Was this translation helpful? Give feedback.
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):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.