primer-trim trims an alignment to a region defined by a set of forward and reverse primers. Usage is as follows:

usage: seqmagick primer-trim [-h] [--reverse-is-revcomp]
                             [--source-format SOURCE_FORMAT]
                             [--output-format OUTPUT_FORMAT]
                             [--max-hamming-distance MAX_HAMMING_DISTANCE]
                             [--prune-action {trim,isolate}]
                             source_file output_file forward_primer

Find a primer sequence in a gapped alignment, trim to amplicon

positional arguments:
  source_file           Source alignment file
  output_file           Destination trimmed file
  forward_primer        The forward primer used
  reverse_primer        The reverse primer used. By default the reverse primer
                        is assumed to be a subsequence of the top strand (that
                        is, the reverse complement of an actual downstream PCR
                        primer). Use --reverse-is-revcomp if this is not the

optional arguments:
  -h, --help            show this help message and exit
  --reverse-is-revcomp  Reverse primer is written as the reverse complement of
                        the top strand (default: False)
  --source-format SOURCE_FORMAT
                        Alignment format (default: detect from extension
  --output-format OUTPUT_FORMAT
                        Alignment format (default: detect from extension
  --include-primers     Include the primers in the output (default: False)
  --max-hamming-distance MAX_HAMMING_DISTANCE
                        Maximum Hamming distance between primer and alignment
                        site (default: 1). IUPAC ambiguous bases in the primer
                        matching unambiguous bases in the alignment are not
  --prune-action {trim,isolate}
                        Action to take. Options are trim (trim to the region
                        defined by the two primers, decreasing the width of
                        the alignment), or isolate (convert all characters
                        outside the primer-defined area to gaps). default: