Skip to content

Sequence Removal

Remove sequences by sequence ID. It is the opposite of sequence extraction, and is faster when you remove fewer than half of the sequences.

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

import pysegul
def remove_sequences():
remove = pysegul.SequenceRemoval(
input_fmt='nexus',
datatype='dna',
output_path='tests/output',
output_format='fasta',
)
remove.input_dir = 'tests/align-data'
remove.remove_id_list(['abce1', 'abce2'])
OptionDefaultDescription
input_fmtRequired'auto', 'fasta', 'nexus', 'phylip'
datatypeRequired'dna', 'aa', 'ignore'
output_pathRequiredOutput directory
output_formatRequired'fasta', 'nexus', 'phylip', or interleaved 'fasta-int', 'nexus-int', 'phylip-int'
AttributeDescription
input_dirDirectory of input sequence files
input_filesList of input sequence files
MethodRemove sequences
remove_regex(regex)whose IDs match a regular expression (Rust regex syntax)
remove_id_list(id)with the IDs in a list

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.