cdskit trimcodon - kfuku52/cdskit GitHub Wiki

cdskit trimcodon

cdskit trimcodon removes aligned codon columns using a clean-codon fraction threshold.

Example

cdskit trimcodon --seq_file alignment.fasta --out_file trimmed.fasta --min_clean_fraction 0.8

How sites are evaluated

For each codon column, cdskit trimcodon records:

  • clean fraction: fraction of sequences with a clean codon
  • clean, missing, ambiguous, and stop-codon counts

Sites are retained when their clean fraction is at least --min_clean_fraction.

A clean codon contains no missing character (-, ?, or .), no ambiguous nucleotide (N, R, Y, etc.), and no definite stop codon under ordinary translation. A dual-coding A/C/G/T codon is clean but is also reported as context-dependent.

Key options

  • --min_clean_fraction FLOAT (0–1, default 0.5): Minimum fraction of sequences with a clean codon required to retain a site.
  • --report PATH: Optional JSON or TSV site-level report.

TSV report format

TSV reports use schema version 2 and begin with schema_version and section. summary rows contain run-level counts and the threshold; site rows contain the original one-based codon_site_1based position, category counts, clean fraction (0–1, six decimals), and keep=yes|no result.

Notes

  • Input sequences must be DNA, aligned, and multiples of three in length.
  • Sequence order is preserved in the trimmed output.

Codon semantics

See codon meaning and uncertainty for definite versus possible stops, dual-coding tables 27/28/31, overlapping ambiguity/stop counts, and report compatibility. These rules describe sequence QC, not gene function.

Citation

No separate method paper is designated for this utility. Report the CDSKIT version, command and options; see citing CDSKIT.