fasta_lake.multi_omics.runner#
fasta_lake.multi_omics.runner
#
FL_MO Stage-3 runner: wire the evidence gate to on-disk inputs/outputs.
This is the file-level orchestration that takes the verified gate logic in
evidence_gate and applies it to a single sample's real inputs:
- the sample's de-novo-extracted FASTA (Stage-3 output, evidence (a)),
- the sample's per-assembly TPM TSV (metaG_tpm / metaT_tpm columns),
- the sample's MEGAHIT predicted-genes FASTA,
- the FL_MO hash_to_rep table,
- the FL_MO cluster97 representative FASTA (for verbatim sequence copy).
It writes:
-
Default gate is OR (the FL_MO default); AND is the low-FDR option. Default runs of the de-novo-only pipeline are untouched: this code only runs when explicitly invoked via the CLI flag or this function.
No new dependencies; headers are copied byte-verbatim from the rep FASTA.
load_tpm_tsv
#
Yield (assembly_protein_id, metaG_tpm, metaT_tpm) from a TPM TSV.
The id column is auto-detected from _TPM_ID_COLS.
Source code in fasta_lake/multi_omics/runner.py
index_fasta
#
Return {first_whitespace_token_of_header: sequence_str} for a FASTA.
Source code in fasta_lake/multi_omics/runner.py
load_hash_to_rep
#
Load the FL_MO hash_to_rep table: {sha256_hex: cluster_rep_id}.
Tab-separated, first column = hash, second = rep id; a header line is skipped.
Source code in fasta_lake/multi_omics/runner.py
run_fl_mo_sample
#
run_fl_mo_sample(*, sample: str, denovo_fasta: str, tpm_tsv: str, assembly_fasta: str, hash_to_rep: str, cluster_rep_fasta: str, output_fasta: str, output_lookup: str, output_stats: str | None = None, gate: str = OR, metag_top_pct: float = 1.0, metat_abs: float = 1.0) -> dict
Run the FL_MO gate for one sample and write the augmented FASTA + lookup.
Returns the stats dict (also written to output_stats if given).
Source code in fasta_lake/multi_omics/runner.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | |