Complete E1-v2 workflow: stage A ladder + control + gate, stage B variants + baseline
- Snakefile: modules -> plain include: (single namespace; fixed cross-module helper resolution), rule all with stage-A/stage-B target sets driven by flat --config stage_b_arch/budget/stride switches. - config/main.yaml: v2 run matrix (ladder 12-grid, control 1M cnn s4), store excludes (DCS spike-in, in-corpus escherichia trap reads), barcoding kit (SQK-RBK114-96 classified during dorado basecalls), removes v1 quota. - baseline_pipeline: CUDA branch streams per-chunk dorado emit-sam through minimap2 (-N 10, tags preserved) and samtools view into per-batch BAMs, merged with samtools cat; ROCm/slorado fallback kept. - ml_pipeline: label parquets -> signal stores (main / windows-ablation w4 / trap store) -> 12 ladder trainings + shuffled control -> custom_models test with the trap store (TP2) -> custom_models gate over the g11 runs; stage B adds windows ablation, holdout/core_clade(/bacillus_group) variants and the dorado-fast alignment baseline on the winner's identical test split. - scripts: bam2annotation now emits source_run (barcoded -> barcodeNN from the dorado tags, dataset fallback); new label_qc.py (TP1 capture counts) and baseline_eval.py. - custom_models submodule: bump to test_split.parquet export commit. - README: two-stage run instructions (dev dry-run vs runner GPU).
This commit is contained in:
+24
-27
@@ -1,3 +1,22 @@
|
||||
"""E1 (v2) squiggle-probe workflow — eDNA_Stream_E01.
|
||||
|
||||
Invoke from `workflow/` (see the repo README). The rule modules are brought
|
||||
into a single namespace with plain `include:` (Snakemake modules would give
|
||||
each file its own globals and the ML rules would lose the shared helpers).
|
||||
|
||||
Run matrix (E1_v2_eleven_taxa_redesign.md §4.1):
|
||||
Stage A: data (download pod5 -> basecall+align -> label parquet -> signal
|
||||
store, incl. the trap store), label-side QC (TP1), the 12-point
|
||||
arch/param ladder, the shuffled-label control, per-run test
|
||||
evaluation with the trap store (TP2), and the gate verdict.
|
||||
Stage B: after the Stage-A winner is picked (report.json of the ladder
|
||||
runs), rerun with --config stage_b...=... to add the windows
|
||||
ablation (store with max_windows_per_read=4 when requested), the
|
||||
robustness variants (holdout_runs / core_clade / bacillus_group)
|
||||
and the alignment baseline (dorado-fast + minimap2 + LCA) on the
|
||||
identical test read set of the winner.
|
||||
"""
|
||||
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
|
||||
@@ -7,33 +26,11 @@ configfile: "config/main.yaml"
|
||||
configfile: "config/dependencies.yaml"
|
||||
configfile: "../reference/species_list.yaml"
|
||||
|
||||
module preparation:
|
||||
snakefile: "rules/preparation.smk"
|
||||
config: config
|
||||
include: "rules/preparation.smk"
|
||||
include: "rules/baseline_pipeline.smk"
|
||||
include: "rules/ml_pipeline.smk"
|
||||
|
||||
module baseline:
|
||||
snakefile: "rules/baseline_pipeline.smk"
|
||||
config: config
|
||||
|
||||
module ml:
|
||||
snakefile: 'rules/ml_pipeline.smk'
|
||||
config: config
|
||||
# Pulldown
|
||||
rule all:
|
||||
default_target: True
|
||||
input:
|
||||
#"binaries/datasets",
|
||||
#f"{config['dorado_model_dir']}/{config['fast_model_name']}",
|
||||
#f"{config['dorado_model_dir']}/{config['hac_model_name']}",
|
||||
#'../data/reference_genomes/full_reference.mmi',
|
||||
#'../data/raw_pod5/'
|
||||
#'../data/pod5_files_to_pull',
|
||||
#'../data/basecalled_reads/hac.fastq.gz'
|
||||
#expand('../data/raw_pod5/PBK98658_853a956f_57f83f46_{batch}.pod5',batch=range(1,config["pod5_dataset_size"]+1,config["pod5_stride"]))
|
||||
'../data/aligned_reads/nomiss_hac_to_genome.sorted.bam',
|
||||
'../data/aligned_reads/trap_hac_to_genome.sorted.bam'
|
||||
#'../data/ml_inputs/hac_label_store.pq'
|
||||
#'../data/ml_inputs/model_layouts/cnn_512_4_100000_11_4.json'
|
||||
|
||||
use rule * from preparation
|
||||
use rule * from baseline
|
||||
use rule * from ml
|
||||
STAGE_A_TARGETS + STAGE_B_TARGETS
|
||||
|
||||
Reference in New Issue
Block a user