Skip to content

Alignment Unalignment

Convert alignments to unaligned sequences by removing gaps and missing data.

import pysegul
def unalign_alignments():
unalign = pysegul.AlignmentUnalignment(
input_fmt='nexus',
datatype='dna',
output_path='tests/output',
)
unalign.from_dir('tests/align-data')

To use a list of files, call from_files instead of from_dir:

unalign.from_files(['tests/align-data/locus1.nex', 'tests/align-data/locus2.nex'])
OptionDefaultDescription
input_fmtRequired'auto', 'fasta', 'nexus', 'phylip'
datatypeRequired'dna', 'aa', 'ignore'
output_pathRequiredOutput directory
output_fmt'fasta''fasta' or interleaved 'fasta-int'
MethodDescription
from_dir(input_dir)Unalign the alignments in a directory
from_files(input_files)Unalign a list of alignment files

This material is based upon work supported by the National Science Foundation under grant numbers: DEB-1754393 and DEB-2244754. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Science Foundation.