{"slug":"alterlab-nf-core-sarek","title":"alterlab-nf-core-sarek","summary":"Runs FASTQ-to-VCF germline and somatic variant calling via the Nextflow nf-core/sarek pipeline pinned to -r 3.10.0 — builds the samplesheet.csv (patient, sex, status, sample, lane, fastq_1, fastq_2), runs bwa-mem/bwa-mem2/dragmap alignment plus GATK4 MarkDuplicates and BQSR again","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-09-23T18:56:55.798439Z","repo":{"url":"https://github.com/AlterLab-IEU/AlterLab-Academic-Skills","stars":68,"forks":13,"license":"MIT","updatedAt":"2026-09-23T13:42:59Z"},"bodyHtml":"<hr>\n<h2>name: alterlab-nf-core-sarek\ndescription: \"Runs FASTQ-to-VCF germline and somatic variant calling via the Nextflow nf-core/sarek pipeline pinned to -r 3.10.0 — builds the samplesheet.csv (patient, sex, status, sample, lane, fastq_1, fastq_2), runs bwa-mem/bwa-mem2/dragmap alignment plus GATK4 MarkDuplicates and BQSR against the GATK GRCh38 resource bundle (dbSNP, Mills/1000G indels), and selects callers — explicitly correcting that sarek defaults to Strelka when --tools is unset (pass haplotypecaller for GATK best practice or deepvariant for CNN accuracy), with a non-Nextflow manual GATK4 fallback. Use when the user wants a variant-calling pipeline, FASTQ to VCF, germline or somatic SNV/indel calling, nf-core/sarek, GATK best-practices alignment-to-VCF, or BQSR/HaplotypeCaller/Mutect2/DeepVariant; annotate hits with alterlab-clinvar/alterlab-gnomad/alterlab-cosmic, parse VCFs with alterlab-pysam, store at scale with alterlab-tiledbvcf. Part of the AlterLab Academic Skills suite.\"\nlicense: MIT\nallowed-tools: Read Write Edit Bash(python:<em>) Bash(uv:</em>) Bash(nextflow:*)\ncompatibility: \"Requires Nextflow &gt;= 25.10.4 (declared by sarek 3.10.0) plus a container engine (Docker/Singularity/Apptainer) or conda; the pipeline pulls nf-core/sarek 3.10.0 and reference bundles over the network on first run. The manual GATK4 fallback needs bwa-mem2 + samtools + gatk4 (bioconda) and runs offline once references are local. No API key. Indexing, BQSR and variant calling are long, compute-heavy jobs — good candidates to run locally rather than through repeated API calls.\"\nmetadata:\nskill-author: AlterLab\nversion: \"1.2.0\"\nlast_updated: \"2026-09-23\"</h2>\n<h1>nf-core/sarek — FASTQ-to-VCF Variant Calling</h1>\n<p>The workflow-runner entry point for raw-reads-to-variants: drive the\n<strong>Nextflow <a href=\"https://nf-co.re/sarek/3.10.0/\">nf-core/sarek</a> pipeline (pinned <code>-r 3.10.0</code>)</strong>\nto take germline or somatic short-read FASTQ through alignment, GATK4 duplicate\nmarking and base-quality recalibration, and SNV/indel calling, then hand the\nresulting VCFs to the suite's database and parsing skills for interpretation.</p>\n<p>This skill is the <strong>command-line / workflow</strong> counterpart to the suite's\nPython-library bioinformatics skills. Use it for the <em>raw-data-to-VCF</em> leg;\nuse the library skills (<code>alterlab-pysam</code>, <code>alterlab-tiledbvcf</code>) once you hold a VCF.</p>\n<h2>When to Use This Skill</h2>\n<p>Trigger this skill when the user wants to:</p>\n<ul>\n<li>Go from <strong>FASTQ to VCF</strong> — call variants on whole-genome (WGS) or whole-exome\n(WES) short reads.</li>\n<li>Run <strong>germline</strong> SNV/indel calling (one or many normal samples).</li>\n<li>Run <strong>somatic / tumor-normal</strong> calling (matched tumor + normal, or tumor-only).</li>\n<li>Use <strong>nf-core/sarek</strong> specifically, or want a reproducible \"GATK\nbest-practices alignment-to-VCF\" pipeline without hand-writing every step.</li>\n<li>Resume a run from an intermediate <strong><code>--step</code></strong> (already have BAM/CRAM, only need\nrecalibration or variant calling).</li>\n</ul>\n<h3>Does NOT Trigger — route adjacent requests here</h3>\n<table>\n<thead>\n<tr>\n<th>The request is really about…</th>\n<th>Route to</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Parsing / filtering / reading an <strong>existing</strong> VCF/BAM in Python (pysam/htslib)</td>\n<td><code>alterlab-pysam</code></td>\n</tr>\n<tr>\n<td><strong>Storing / querying</strong> large multi-sample variant stores (TileDB-VCF arrays)</td>\n<td><code>alterlab-tiledbvcf</code></td>\n</tr>\n<tr>\n<td>Clinical significance of a called variant (pathogenic/benign)</td>\n<td><code>alterlab-clinvar</code></td>\n</tr>\n<tr>\n<td>Population allele frequencies for a called variant</td>\n<td><code>alterlab-gnomad</code></td>\n</tr>\n<tr>\n<td>Somatic mutation catalogue / cancer census lookup</td>\n<td><code>alterlab-cosmic</code></td>\n</tr>\n<tr>\n<td><strong>RNA-seq</strong> transcript/gene quantification (salmon/kallisto), not DNA variants</td>\n<td><code>alterlab-rnaseq-quant</code></td>\n</tr>\n<tr>\n<td>16S/ITS <strong>amplicon / microbiome</strong> FASTQ → feature table</td>\n<td><code>alterlab-qiime2-amplicon</code></td>\n</tr>\n<tr>\n<td>Sequence <strong>homology / similarity search</strong> (BLAST+, DIAMOND)</td>\n<td><code>alterlab-blast</code></td>\n</tr>\n<tr>\n<td>Spatial transcriptomics neighborhood/SVG analysis</td>\n<td><code>alterlab-squidpy-spatial</code></td>\n</tr>\n<tr>\n<td>Differential <strong>expression</strong> stats from counts</td>\n<td><code>alterlab-pydeseq2</code></td>\n</tr>\n</tbody>\n</table>\n<p>If the user has no workflow engine and cannot install Nextflow + containers,\ndo <strong>not</strong> refuse — fall back to the <strong>manual GATK4 recipe</strong> (below /\n<code>references/manual_gatk4.md</code>).</p>\n<h2>The #1 Correctness Trap: sarek's default caller is Strelka</h2>\n<p>Per the <a href=\"https://nf-co.re/sarek/3.10.0/docs/usage/\">3.10.0 usage docs</a>, <strong>when\n<code>--tools</code> is not set, sarek runs preprocessing and then Strelka only.</strong> It does\n<strong>not</strong> default to GATK HaplotypeCaller or DeepVariant. Always set <code>--tools</code>\nexplicitly to match the user's intent:</p>\n<table>\n<thead>\n<tr>\n<th>Intent</th>\n<th>Pass</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>GATK4 best-practice germline</td>\n<td><code>--tools haplotypecaller</code></td>\n</tr>\n<tr>\n<td>Highest germline F1 (CNN)</td>\n<td><code>--tools deepvariant</code></td>\n</tr>\n<tr>\n<td>Somatic, matched tumor/normal</td>\n<td><code>--tools mutect2</code> (often <code>mutect2,strelka</code>)</td>\n</tr>\n<tr>\n<td>Joint germline genotyping across a cohort</td>\n<td><code>--tools haplotypecaller --joint_germline</code></td>\n</tr>\n<tr>\n<td>GPU-accelerated germline (needs an NVIDIA GPU profile)</td>\n<td><code>--tools parabricks_haplotypecaller</code></td>\n</tr>\n</tbody>\n</table>\n<p><code>--tools</code> accepts (per the 3.10.0 schema): <code>deepvariant</code>, <code>freebayes</code>,\n<code>haplotypecaller</code>, <code>parabricks_haplotypecaller</code>, <code>mutect2</code>, <code>lofreq</code>, <code>mpileup</code>,\n<code>muse</code>, <code>strelka</code>, <code>sentieon_*</code>, structural-variant callers (<code>manta</code>, <code>tiddit</code>,\n<code>indexcov</code>), CNV/purity tools (<code>ascat</code>, <code>cnvkit</code>, <code>controlfreec</code>), QC\n(<code>ngscheckmate</code>, <code>msisensorpro</code>), <code>varlociraptor</code>, and the annotation tools\n(<code>snpeff</code>, <code>vep</code>, <code>snpsift</code>, <code>bcfann</code>). Caller choice materially changes precision/recall — see\n<code>references/caller_accuracy.md</code> for the nf-core benchmark (Hanssen et al., 2024).</p>\n<h2>Pipeline (how to run it)</h2>\n<h3>1. Build the samplesheet</h3>\n<p>sarek's input is a CSV. Required columns for <code>--step mapping</code>:\n<code>patient</code>, <code>sample</code>, <code>lane</code>, <code>fastq_1</code>, <code>fastq_2</code>. Optional: <code>sex</code> (XX/XY,\ndefault NA) and <code>status</code> (<strong><code>0</code> = normal, <code>1</code> = tumor</strong>, default 0) — <code>status</code>\nis what tells sarek a pair is somatic.</p>\n<p>Use the helper to generate a valid sheet from a FASTQ directory (it pairs R1/R2,\nfills <code>lane</code>, and validates the schema before you burn compute):</p>\n<pre><code>uv run python skills/bioinformatics/alterlab-nf-core-sarek/scripts/make_samplesheet.py \\\n    --fastq-dir ./fastq --patient PATIENT_01 --sample TUMOR_01 \\\n    --status 1 --sex XY --out samplesheet.csv\n</code></pre>\n<p>Append more rows (e.g. the matched normal with <code>--status 0 --append</code>) before\nrunning. See <code>references/samplesheet_schema.md</code> for every column, BAM/CRAM\nre-entry rows, and a tumor-normal example.</p>\n<h3>2. Run the pipeline (pinned)</h3>\n<pre><code>nextflow run nf-core/sarek -r 3.10.0 \\\n    -profile docker \\\n    --input samplesheet.csv \\\n    --outdir ./results \\\n    --genome GATK.GRCh38 \\\n    --tools haplotypecaller \\\n    --aligner bwa-mem2\n</code></pre>\n<ul>\n<li><strong>Always keep <code>-r 3.10.0</code></strong> — unpinned runs drift to a different pipeline version.</li>\n<li><code>-profile</code> is <strong>mandatory</strong>: <code>docker</code>, <code>singularity</code>, <code>apptainer</code>, or <code>conda</code>\nfor the local environment (clusters add <code>test</code>, institutional configs, etc.).</li>\n<li><code>--genome GATK.GRCh38</code> selects the iGenomes/GATK GRCh38 reference and its\nbundled BQSR known-sites (dbSNP, Mills/1000G indels) automatically.</li>\n<li><code>--aligner</code> options: <code>bwa-mem</code> (default), <code>bwa-mem2</code>, <code>dragmap</code>, <code>sentieon-bwamem</code>,\n<code>parabricks</code> (GPU).</li>\n<li>For <strong>WES/panel</strong>, pass <strong><code>--wes</code></strong> <em>and</em> <code>--intervals targets.bed</code>: <code>--intervals</code>\nrestricts where calling happens, while <code>--wes</code> switches the tools to\ntargeted-sequencing settings. Exome data run without <code>--wes</code> completes happily with\nWGS-tuned thresholds.</li>\n<li>Resume mid-pipeline with <code>--step</code> (<code>mapping</code> default, then <code>markduplicates</code>,\n<code>prepare_recalibration</code>, <code>recalibrate</code>, <code>variant_calling</code>, <code>annotate</code>) and\nNextflow's <code>-resume</code>.</li>\n</ul>\n<p>Preprocessing follows GATK best practice: align → <strong>MarkDuplicates</strong> →\n<strong>BaseRecalibrator/ApplyBQSR</strong> (BQSR) → variant calling. Details and every flag:\n<code>references/usage_3.10.0.md</code>.</p>\n<h3>3. Interpret the output VCFs</h3>\n<p>Per-caller VCFs land under <code>results/variant_calling/&lt;tool&gt;/</code>. Then:</p>\n<ul>\n<li><strong>Parse / filter</strong> with <code>alterlab-pysam</code>.</li>\n<li><strong>Store / query at scale</strong> (multi-sample) with <code>alterlab-tiledbvcf</code>.</li>\n<li><strong>Annotate</strong> clinical significance → <code>alterlab-clinvar</code>; population frequency →\n<code>alterlab-gnomad</code>; somatic catalogue → <code>alterlab-cosmic</code>.</li>\n</ul>\n<h3>Fallback: manual GATK4 (no Nextflow)</h3>\n<p>If the user cannot run Nextflow + containers, run the equivalent GATK4\nbest-practices chain by hand: <code>bwa-mem2 mem</code> → <code>gatk MarkDuplicates</code> →\n<code>gatk BaseRecalibrator</code> + <code>gatk ApplyBQSR</code> (with dbSNP + Mills/1000G known\nsites) → <code>gatk HaplotypeCaller -ERC GVCF</code> → <code>gatk GenotypeGVCFs</code>. Full command\nsequence and the resource-bundle paths are in <code>references/manual_gatk4.md</code>.</p>\n<h2>Self-Check Before Reporting</h2>\n<ul>\n<li>Is <code>--tools</code> set explicitly? Never let a run fall through to the <strong>Strelka</strong>\ndefault unless the user truly wants Strelka.</li>\n<li>Is the version pinned (<code>-r 3.10.0</code>), a <code>-profile</code> chosen, and is Nextflow\n<code>&gt;=25.10.4</code> (the version 3.10.0 requires)?</li>\n<li>For somatic asks, does the samplesheet carry a <code>status 1</code> tumor <strong>and</strong> a\n<code>status 0</code> normal under the <strong>same <code>patient</code></strong>?</li>\n<li>For WES/panel, were <strong>both</strong> <code>--wes</code> and <code>--intervals &lt;capture.bed&gt;</code> supplied?</li>\n<li>After the run, did you route VCF interpretation to the correct sibling skill\nrather than re-deriving variant meaning here?</li>\n</ul>\n<h2>References</h2>\n<ul>\n<li><code>references/usage_3.10.0.md</code> — pinned run command, profiles, <code>--step</code>/<code>--aligner</code>\noptions, the <code>--wes</code> + <code>--intervals</code> pairing, BQSR preprocessing, sourced from the\n3.10.0 usage docs.</li>\n<li><code>references/samplesheet_schema.md</code> — full CSV column spec, BAM/CRAM re-entry,\ntumor-normal worked example.</li>\n<li><code>references/caller_accuracy.md</code> — choosing <code>--tools</code>, summarizing the nf-core\nbenchmark (Hanssen et al., 2024, NAR Genomics &amp; Bioinformatics).</li>\n<li><code>references/manual_gatk4.md</code> — the non-Nextflow GATK4 best-practices fallback.</li>\n</ul>\n<p>Part of the AlterLab Academic Skills suite.</p>\n","files":[{"path":"evals/evals.json","sizeBytes":6665,"isText":true},{"path":"references/caller_accuracy.md","sizeBytes":2362,"isText":true},{"path":"references/manual_gatk4.md","sizeBytes":3120,"isText":true},{"path":"references/samplesheet_schema.md","sizeBytes":2879,"isText":true},{"path":"references/usage_3.10.0.md","sizeBytes":4859,"isText":true},{"path":"scripts/make_samplesheet.py","sizeBytes":7196,"isText":true},{"path":"SKILL.md","sizeBytes":9689,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-09-23T18:57:41.189028Z","sha256":"2FAB64CE0C234C5E117153E74052BF4D1AC212F7A62EFD0C525B279071AD15D3","sizeBytes":16815},"review":null,"source":{"repositoryUrl":"https://github.com/AlterLab-IEU/AlterLab-Academic-Skills","path":"skills/bioinformatics/alterlab-nf-core-sarek","license":"MIT","commit":"e4836c08a20da195a11f30f203a8cf23ec30aa95","subtreeSha":"9CA2B97A6860D324E4CDE79BEE1779A356C2923804977628AA0CD2963662A67C","lastSyncedAt":"2026-09-23T18:56:52.297238Z"},"reviewedAt":"2026-09-23T18:59:09.948694Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/AlterLab-IEU/AlterLab-Academic-Skills/tree/main/skills/bioinformatics/alterlab-nf-core-sarek"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install alterlab-ieu-alterlab-academic-skills@llmmart"},{"target":"git","command":"git clone https://github.com/AlterLab-IEU/AlterLab-Academic-Skills.git"}]}