Skip to content

# filter

Apply row-level selection to an index: retain only kmers matching ingroup/outgroup predicates over genome membership, plus optional total-count and complexity thresholds. The output is a new, single-layer index.

    obikmer filter SOURCE -o OUTPUT [OPTIONS]

## Arguments

Argument | Description
--- | ---
`SOURCE` | Source index directory

## Options

Option | Default | Description
--- | --- | ---
`-o, --output` | — (required) | Output index directory
`-f, --force` | off | Overwrite an existing output directory
`--presence` | off | Output presence/absence instead of counts
`--min-total-count` | none | Minimum total count across all genomes (count index only)
`--max-total-count` | none | Maximum total count across all genomes
`--min-complexity` | none | Minimum normalized entropy (same score as `--theta` at index build time), recomputed from the stored unitig sequences
`--complexity-level-max` | `6` | Maximum sub-word size for the complexity score (used only with `--min-complexity`)

## Predicate options

Option | Default | Description
--- | --- | ---
`--ingroup` | none | Ingroup predicate (repeatable; each occurrence is ANDed)
`--outgroup` | none | Outgroup predicate (repeatable; each occurrence is ORed)
`--min-count` | 0, or group size + N if negative | Minimum number of ingroup genomes carrying the kmer
`--max-count` | ingroup group size | Maximum number of ingroup genomes carrying the kmer
`--min-frac` | `1.0` if `--ingroup` given without an explicit quorum, else `0.0` | Minimum fraction of ingroup genomes
`--max-frac` | `1.0` | Maximum fraction of ingroup genomes
`--min-outgroup-count` | `0` | Minimum number of outgroup genomes carrying the kmer
`--max-outgroup-count` | `0` if `--outgroup` given without an explicit quorum, else outgroup group size | Maximum number of outgroup genomes
`--min-outgroup-frac` | `0.0` | Minimum fraction of outgroup genomes
`--max-outgroup-frac` | `1.0` | Maximum fraction of outgroup genomes
`--presence-threshold` | `0` | Minimum count for a genome to be considered a carrier of a kmer

See Genome predicates and taxonomy paths for the predicate syntax used by `--ingroup`/`--outgroup`.

A negative `--min-count`/`--max-count` is interpreted as an offset from the group size — e.g. `--min-count=-1` means "all but one".

Declaring `--ingroup` with no explicit ingroup quorum flag implicitly sets `--min-frac 1.0` (present in every ingroup genome). Declaring `--outgroup` with no explicit outgroup quorum flag implicitly sets `--max-outgroup-count 0` (absent from every outgroup genome). Any explicit quorum flag for a group disables that group's implicit default.