Skip to content

Alignment Summary

Generate summary statistics for DNA and amino acid alignments.

import pysegul
def summarize_alignments():
summary = pysegul.AlignmentSummary(
input_fmt='nexus',
datatype='dna',
output_path='tests/output',
output_prefix='summary',
)
outputs = summary.from_dir('tests/align-data')

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

summary.from_files(['tests/align-data/alignment1.nex', 'tests/align-data/alignment2.nex'])
OptionDefaultDescription
input_fmtRequired'auto', 'fasta', 'nexus', 'phylip'
datatypeRequired'dna', 'aa', 'ignore'
output_pathRequiredOutput directory
summary_interval5Step of the missing data summary, in percent: 1, 2, 5, 10
output_prefixNoneName of the output files
per_locus (beta)FalseWrite a summary for each alignment instead of one across all alignments
plot (beta)NoneChart options. Not available with per_locus=True. See Charts
MethodDescription
from_dir(input_dir)Summarize the alignments in a directory
from_files(input_files)Summarize a list of alignment files

Both return a dictionary of output paths: locus, taxon, text, report, and plots. With per_locus=True, the dictionary is empty.

Set plot to write charts to the plots folder of the output directory. See Charts and Reports for the chart options.

summary = pysegul.AlignmentSummary(
'nexus',
'dna',
'tests/output',
plot=pysegul.PlotOptions(format='svg'),
)
outputs = summary.from_dir('tests/align-data')
report = pysegul.load_align_report(outputs['report'])

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.