Generate summary statistics for DNA and amino acid alignments.
Example
Section titled “Example”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'])Options
Section titled “Options”| Option | Default | Description |
|---|---|---|
input_fmt | Required | 'auto', 'fasta', 'nexus', 'phylip' |
datatype | Required | 'dna', 'aa', 'ignore' |
output_path | Required | Output directory |
summary_interval | 5 | Step of the missing data summary, in percent: 1, 2, 5, 10 |
output_prefix | None | Name of the output files |
per_locus (beta) | False | Write a summary for each alignment instead of one across all alignments |
plot (beta) | None | Chart options. Not available with per_locus=True. See Charts |
Methods
Section titled “Methods”| Method | Description |
|---|---|
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.
Charts
Section titled “Charts”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'])