cdskit filter - kfuku52/cdskit GitHub Wiki
cdskit filter
cdskit filter removes CDS records that fail sequence-level quality rules.
Example
cdskit filter --seq_file input.fasta --out_file filtered.fasta --drop_internal_stop yes --min_clean_codon_fraction 0.8 --dedup keep-longest
What can be filtered
- Non-triplet sequence lengths.
- Sequences with internal in-frame stop codons.
- Sequences whose clean-codon fraction is below a threshold.
- Duplicate IDs, resolved by
keep-firstorkeep-longest.
Key options
--drop_non_triplet yes|no(defaultyes): Drop sequences whose length is not divisible by three.--drop_internal_stop yes|no(defaultno): Drop sequences with internal stop codons.--min_clean_codon_fraction FLOAT(0–1, default0.5): Minimum fraction of clean codons required to retain a sequence.--dedup no|keep-first|keep-longest(defaultno): Duplicate-ID handling after filtering.--report PATH: Optional JSON or TSV report listing kept and dropped IDs.
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.
TSV report format
TSV reports use schema version 2. Every row starts with schema_version and
section. Use summary for run settings/counts, id_set for kept or dropped
ID lists, drop_reason for per-reason counts, and sequence for one row per
input record. List-valued cells such as ids and drop_reasons contain compact
JSON arrays.
Notes
- Input sequences must be DNA.
- The command filters whole sequences, not alignment columns.
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.