Workflowsο
siRNAforge provides flexible workflows from quick gene-to-siRNA analysis to custom multi-step pipelines.
Complete Workflowο
The workflow command handles everything: gene search β design β scoring β filtering.
sirnaforge workflow TP53 --output-dir results/
Output Structureο
results/
βββ sirnaforge/
β βββ candidates_pass.csv # β Use these for experiments
β βββ candidates_all.csv # All candidates with scores
βββ transcripts/
β βββ TP53_transcripts.fasta # Retrieved sequences
β βββ TP53_canonical.fasta # Canonical isoform
βββ logs/
β βββ workflow_summary.json # Analysis statistics
βββ off_target/
βββ input_candidates.fasta # For Nextflow pipeline
That tree is the default run. Two entries are conditional: off_target/ stays empty under --skip-off-targets (the skip is honoured before any candidate FASTA is staged or any reference resolved), and TP53_canonical.fasta only appears on the gene-search path, so --input-fasta runs write just <GENE>_transcripts.fasta.
Common Optionsο
# Stricter quality filters
sirnaforge workflow TP53 --gc-min 35 --gc-max 55 --top-n 30
# More candidates
sirnaforge workflow BRCA1 --top-n 50
# Verbose output
sirnaforge workflow EGFR --verbose
Step-by-Step Workflowο
For more control, run individual commands:
# 1. Get transcripts
sirnaforge search TP53 -o transcripts.fasta
# 2. Design candidates
sirnaforge design transcripts.fasta -o candidates.csv --top-n 20
Batch Processingο
Process multiple genes efficiently:
for gene in TP53 BRCA1 EGFR KRAS; do
sirnaforge workflow $gene --output-dir results/$gene
done
ZFN Workflowο
β οΈ EXPERIMENTAL β results are not decision-grade
The ZFN arm ships experimental in 0.6.0 with known unfixed defects β half-site orientation handling, FokI seed-region weighting, off-target region classification, inverted
worst_site_score/best_offtarget_scoreexports, and a default backend that rejects mismatch budgets above 3 β all tracked in #82. Do not use ZFN output for any decision without independent validation. In particular the published CCR5 half-site pair does not match its own on-target site under the default strand-pairing rule, which also invalidates the ZFN validation runs recorded in this documentation set. See ZFN Module Guide for details.
Use the dedicated ZFN command when you want half-site constrained off-target discovery.
sirnaforge zfn \
--zfn-left-half-site GTCATCCTCATC \
--zfn-right-half-site CTTTTGCAGTTT \
--zfn-search-space ensembl_human_hg38_primary \
--zfn-spacer-lengths 5,6 \
--zfn-max-mismatches 2 \
--zfn-algorithm zfn_v2 \
--output-dir zfn_output/
CTTTTGCAGTTT is the reverse complement of the published CCR5 (β) half-site AAACTGCAAAAG;
passing the published text verbatim returns 0 sites. Keep --zfn-max-mismatches at 3 or below
unless you also pass --zfn-search-backend exhaustive_python.
Expected artifacts:
zfn_output/sirnaforge/candidate_summary.jsonzfn_output/sirnaforge/offtarget_sites.csvzfn_output/logs/workflow_summary.json
Advanced runtime controls:
SIRNAFORGE_ZFN_USE_NEXTFLOW=1opts the public ZFN workflow into the embedded Nextflow route. The route runs the same typed, full-reference search in one process, preserving the direct pathβs backend, mismatch, seed and ranking settings without loading the whole genome once per shard. The direct Python route remains the default.SIRNAFORGE_ZFN_SHARDING_JSON='{"enabled": true, "chunk_size_mb": 3, "overlap_bp": 40000}'for custom shard/window behavior on large references.
Variant Targeting (documented runs)ο
Five offline variant-resolution runs were executed with the bundled FASTA (examples/sample_transcripts.fasta) and demo VCF (examples/variant_demo.vcf). Minimal outputs live under docs/documented_workflows/:
Summary:
docs/documented_workflows/variant_examples.json(command, mode, min-af, resolved variants)Reports:
docs/documented_workflows/*/logs/resolved_variants.json
Example commands mirrored in the summary:
# Avoid mode with default AF threshold
sirnaforge workflow TP53 --input-fasta examples/sample_transcripts.fasta --snp-file examples/variant_demo.vcf --variant-mode avoid --min-af 0.01 --output-dir workflow_output/avoid_baseline
# Target common alleles
sirnaforge workflow TP53 --input-fasta examples/sample_transcripts.fasta --snp-file examples/variant_demo.vcf --variant-mode target --min-af 0.03 --output-dir workflow_output/target_focus
Docker Workflowο
docker run --rm -v $(pwd):/data -w /data \
ghcr.io/austin-s-h/sirnaforge:latest \
sirnaforge workflow TP53 --output-dir results/
Note
Inside the container, Nextflow uses the local profile automaticallyβno Docker-in-Docker needed.
Nextflow Pipelineο
siRNAforge runs off-target analysis via an embedded Nextflow workflow.
Off-target analysis flow (mRNA + miRNA seed)ο
The SIRNA_OFFTARGET_ANALYSIS subworkflow runs two independent scans over the same
candidate FASTA and aggregates them into a single report. The miRNA seed scan always
runs (lightweight, no reference download beyond the miRNA database); the
transcriptome scan is conditional on a reference being supplied via
--transcriptome_fastas or --transcriptome_indices. There is no genomic scan for siRNA/miRNA:
siRNA acts on mRNA, so the transcriptome is the reference for on- and off-target alike (#99).
flowchart TD
IN["Candidate guide FASTA<br/>(from design, or --input-candidates-fasta)"]
IN --> MIR
IN --> GATE
subgraph MIRNA["miRNA seed scan β ALWAYS runs (MIRNA_SEED_ANALYSIS)"]
direction TB
MIR["run_mirna_seed_analysis()<br/>default db: mirgenedb<br/>default species: chicken,rat,mouse,human,macaque"]
MIR --> SEED["Extract guide seed = guide positions 2-8"]
SEED --> SCAN["Scan seed across every miRNA<br/>backend: pyahocorasick (exhaustive_python oracle)"]
SCAN --> RAW["RAW alignments: seed match at any offset<br/>(*_mirna_analysis_raw.tsv)"]
RAW --> FILT{"guide seed on the miRNA's<br/>own seed region?<br/>0-based coord == seed_start-1"}
FILT -->|yes| HIT["Counted hit<br/>(*_mirna_analysis.tsv, total_hits)"]
FILT -->|"no (e.g. 3' region)"| RAWONLY["Retained in *_raw only,<br/>NOT a hit"]
end
GATE{"--transcriptome_fastas /<br/>--transcriptome_indices<br/>provided?"}
GATE -->|no| SKIP["Transcriptome scan skipped<br/>(miRNA-only run)"]
GATE -->|yes| TXSCAN
subgraph TXSCAN["Transcriptome scan β CONDITIONAL"]
direction TB
BIDX["BUILD_BWA_INDEX<br/>(only for FASTA inputs; indices reused as-is)"]
BIDX --> OT["OFFTARGET_ANALYSIS per species<br/>run_bwa_alignment_analysis()<br/>one BWA-MEM2 session, all candidates"]
OT --> GHITS["Per-species alignments + seed_mismatches<br/>(species_analysis.tsv)"]
end
HIT --> AGG
RAWONLY --> AGG
GHITS --> AGG
SKIP --> AGG
subgraph AGGREGATE["AGGREGATE_RESULTS"]
direction TB
AGG["aggregate_results_cli()"]
AGG --> AMIR["aggregate_mirna_results()"]
AGG --> AGEN["aggregate_offtarget_results()<br/>(miRNA files excluded)"]
end
AMIR --> OUT["combined_*.tsv / combined*.json<br/>final_summary.txt"]
AGEN --> OUT
Both scans compute seed_mismatches over the same seed window (guide positions 2β8), but
they answer different questions: the transcriptome scan finds where a guide aligns in the
target transcriptome (BWA-MEM2), while the miRNA scan asks whether a guideβs seed mimics a
known miRNA seed. Only seed-region matches count as miRNA hits; perfect matches elsewhere in
a miRNA are kept as raw records for transparency but are not off-target hits. See
Models & Scoring for the scoring details.
# Full workflow (includes embedded Nextflow off-target analysis)
sirnaforge workflow TP53 --output-dir results/
# Off-target only (runs the embedded Nextflow workflow)
sirnaforge offtarget \
--input-candidates-fasta results/off_target/input_candidates.fasta \
--output-dir results/off_target \
--species "human,mouse"
Advanced: discover and run the embedded pipeline directly:
PIPELINE_NF=$(uv run python -c "from sirnaforge.pipeline.nextflow.runner import NextflowRunner; print(NextflowRunner().get_main_workflow())")
nextflow run "$PIPELINE_NF" --help
Developer Validation Notesο
For maintainers and advanced users validating the internal ZFN Nextflow bridge behavior (including uv run --project ... usage outside repository root), see: