Transpose locus alignments into one sequence file per sample. Each output file contains all loci for one sample, labeled by the locus (input file name) they come from. Gaps and missing data are removed. PySEGUL writes each sample to <output_path>/<sample_id>/<sample_id>.<ext>.
Example
Section titled “Example”import pysegul
def transpose_sequences(): transpose = pysegul.SequenceTranspose( input_fmt='nexus', datatype='dna', output_path='tests/output', ) transpose.from_dir('tests/align-data')To use a list of files, call from_files instead of from_dir:
transpose.from_files(['tests/align-data/locus1.nex', 'tests/align-data/locus2.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 |
output_fmt | 'fasta' | 'fasta' or interleaved 'fasta-int'. Transposed sequences are unaligned |
Methods
Section titled “Methods”| Method | Description |
|---|---|
from_dir(input_dir) | Transpose the alignments in a directory |
from_files(input_files) | Transpose a list of alignment files |