Skip to content

Alignment Trimming

Trim alignment sites across many alignments at once. PySEGUL writes the trimmed alignments to the trimmed_alignments directory and a trimming summary to trimming_summary.csv.

Set the input with input_dir or input_files, then call a trimming method.

import pysegul
def trim_alignments():
trim = pysegul.AlignmentTrimming(
input_fmt='nexus',
datatype='dna',
output_path='tests/output',
output_fmt='fasta',
)
trim.input_dir = 'tests/align-data'
trim.missing_data(0.5)
OptionDefaultDescription
input_fmtRequired'auto', 'fasta', 'nexus', 'phylip'
datatypeRequired'dna', 'aa', 'ignore'
output_pathRequiredOutput directory
output_fmtRequired'fasta', 'nexus', 'phylip', or interleaved 'fasta-int', 'nexus-int', 'phylip-int'
AttributeDescription
input_dirDirectory of input alignments
input_filesList of input alignment files
MethodDescription
missing_data(max_missing)Remove sites with more than max_missing (0.0–1.0) missing data (gaps and ?)
parsimony_inf(threshold)Trim using a threshold of parsimony informative sites

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.