edit_quant
Nextflow (DSL2) pipeline: aligns a designed amplicon panel's guides + primers to a reference genome with BWA, extracts each amplicon's reference sequence, QC's primer orientation/gene overlap, then runs CRISPRessoPooled on each FASTQ sample against the resulting (deduplicated) amplicons panel.
Translated from the bash/Python pipeline in
OTAR3086/analysis/mapping_amplicons/scripts — see that directory's
README.md for the full rationale behind the two-BWA-pass design, primer
reassignment, gene-overlap window, high-copy-number flagging, etc. All of
that logic is reused unchanged (bin/*.py), just re-wired as Nextflow
processes.
Inputs
--amplicon_manifest (required)
Tab-separated, header row required. Column names are matched after
stripping punctuation/case (guide_.1/guide_1/Guide1 all work):
project_name, plate_name, well_position, gene_name, gene_id, species, guide1, guide2, guide3, amplicon_size, fwd_primer, rev_primer. Guides are
given as RNA (U) and converted to DNA; primers are the plain
fwd_primer/rev_primer columns (not adaptor-tagged final_* columns).
--fastq_manifest (required)
Tab-separated, header row required, 3 columns:
Every sample is screened with CRISPRessoPooled against the same shared,
deduplicated amplicons panel — there's no per-sample link to a specific
amplicon_manifest row required or used.
Reference / config params
If ref_fai/BWA index/gene_bed+exon_bed already exist on disk, the
pipeline uses them as-is (no rebuild). Anything auto-built is written under
${outdir}/reference/, never into the original reference directory (which
may be shared/read-only).
Environment
All processes run inside one conda environment auto-built by Nextflow from
environment.yml (conda.enabled = true, process.conda points at the
file) — bwa, samtools, crispresso2, python. No manual env setup
required.
Running
On the Sanger LSF farm, add -profile farm (see conf/farm.config — adjust
the placeholder queue name to your actual queues before relying on it).
edit_quant runner script
A tglow-pipeline-style wrapper (./edit_quant) is included for driving runs
via LSF (or locally) with sensible logging/-resume defaults baked in:
Everything after -- is passed straight through to nextflow run (so any
pipeline --param works there), an optional -c run.config can supply
further overrides, and -w sets the Nextflow work directory (default
../workdir, one level above this pipeline folder). Each run gets its own
logs/<timestamp>/ with the Nextflow log, HTML report, and trace. See
./edit_quant -h for all flags. The proxy/module-load lines near the top of
the script are Sanger-farm-specific — adjust for your own installation.
Outputs (under --outdir)
fasta/queries.fasta— guide/primer query sequencesalign/queries.exact.sorted.bam(+.bai) — exact-match alignment (source of truth for position/gene-overlap/amplicon extraction)align/queries.sorted.bam(+.bai) — mismatch-tolerant alignment (off-target search)align/queries.exact.reassigned.sorted.bam(+.bai) — corrected BAM, only whenreassign_primarycorrected at least one positionreports/validation_report.tsv— per guide/primer: position, gene/exon overlap, statusreports/amplicon_report.tsv— per sample: amplicon coordinates, length, orientation QCreports/off_targets.tsv— additional low-edit-distance hitsreports/reassigned_primaries.tsv— log of every tie-break correctionreports/crispresso_amplicons.txt— CRISPRessoPooled amplicons file (one row per sample whose amplicon was extracted)amplicons/<sample_id>.fa,amplicons/all_amplicons.fasta— extracted reference amplicon sequencescrispresso/amplicons_unique.txt— the above, deduplicated byamplicon_seq(CRISPRessoPooled requires unique sequences)crispresso/CRISPRessoPooled_on_<sample>/— one per fastq-manifest sample