mkrg01/genome_assembly_pipeline
An integrated pipeline for eukaryotic genome assembly and gene annotation
Overview
Latest release: None, Last update: 2026-09-10
Share link: https://snakemake.github.io/snakemake-workflow-catalog?wf=mkrg01/genome_assembly_pipeline
Quality control: linting: passed formatting: failed
Deployment
Step 1: Install Snakemake and Snakedeploy
Snakemake and Snakedeploy are best installed via the Conda package manager. It is recommended to install conda via Miniforge. Run
conda create -c conda-forge -c bioconda -c nodefaults --name snakemake snakemake snakedeploy
to install both Snakemake and Snakedeploy in an isolated environment. For all following commands ensure that this environment is activated via
conda activate snakemake
For other installation methods, refer to the Snakemake and Snakedeploy documentation.
Step 2: Deploy workflow
With Snakemake and Snakedeploy installed, the workflow can be deployed as follows. First, create an appropriate project working directory on your system and enter it:
mkdir -p path/to/project-workdir
cd path/to/project-workdir
In all following steps, we will assume that you are inside of that directory. Then run
snakedeploy deploy-workflow https://github.com/mkrg01/genome_assembly_pipeline . --tag None
Snakedeploy will create two folders, workflow and config. The former contains the deployment of the chosen workflow as a Snakemake module, the latter contains configuration files which will be modified in the next step in order to configure the workflow to your needs.
Step 3: Configure workflow
To configure the workflow, adapt config/config.yml to your needs following the instructions below.
Step 4: Run workflow
The deployment method is controlled using the --software-deployment-method (short --sdm) argument.
To run the workflow using a combination of conda and apptainer/singularity for software deployment, use
snakemake --cores all --sdm conda apptainer
Snakemake will automatically detect the main Snakefile in the workflow subfolder and execute the workflow module that has been defined by the deployment in step 2.
For further options such as cluster and cloud execution, see the docs.
Step 5: Generate report
After finalizing your data analysis, you can automatically generate an interactive visual HTML report for inspection of results together with parameters and code inside of the browser using
snakemake --report report.zip
Configuration
The following section is imported from the workflow’s config/README.md.
Configuration Guide
This document explains:
Required input files to be placed in the
raw_datadirectory.Configuration parameters to set in
config/config.yml.
1. Input Files (raw_data/)
The full assembly workflow requires PacBio HiFi reads. The external-assembly annotation workflow (workflow/Snakefile.annotation) instead requires an assembly FASTA via external_assembly. Nuclear gene prediction uses local paired-end RNA-seq reads by default. With braker4_rnaseq_source: "varus", BRAKER4 samples public SRA RNA-seq instead, so local reads are optional for nuclear annotation targets. Organelle RNA-editing curation still requires local paired-end RNA-seq, including in the full all target when organelle annotation is enabled.
Place your raw sequencing files in the raw_data directory with the following naming conventions:
File Type |
Naming Pattern |
Example |
|---|---|---|
PacBio HiFi reads |
|
|
Index for HiFi reads |
|
|
External assembly FASTA (annotation workflow only) |
Any path set in |
|
Ultra-long ONT reads (optional) |
Any FASTQ path in config ( |
|
Hi-C reads R1 (optional) |
One or more FASTQ paths in |
|
Hi-C reads R2 (optional) |
One or more FASTQ paths in |
|
Paired-end RNA-seq (R1) |
|
|
Paired-end RNA-seq (R2) |
|
|
Notes:
The pipeline will automatically detect and process multiple PacBio HiFi and RNA-seq samples, if present.
PacBio HiFi reads are not required when running the external-assembly annotation workflow with
workflow/Snakefile.annotation.RNA-seq raw FASTQ inputs can be gzipped or plain text. The pipeline normalizes them during preprocessing, so downstream rules keep using the same internal filenames.
Keep only one raw RNA-seq file per sample and read pair. For example, do not place both
SAMPLE_1.fastq.gzandSAMPLE_1.fqinraw_data/.Ultra-long ONT reads are optional and can improve assembly quality when integrated with HiFi reads. See the hifiasm documentation for details.
Hi-C reads are optional and should be provided as matching R1/R2 paths in
hic_reads_r1andhic_reads_r2. Multiple lanes can be listed in matching order. If Hi-C reads are configured, the pipeline uses them for hifiasm phasing, runs YaHS scaffolding on each assembly listed inselected_assemblies, and prepares Juicebox-ready contact maps. See the hifiasm documentation and the YaHS documentation for details.LongStitch is enabled by default. It uses the curated HiFi reads produced by this workflow.
2. Configuration File (config/config.yml)
Edit config/config.yml to match your dataset and analysis requirements.
The sections below follow the order of config/config.yml.
Runtime
Parameter |
Description |
Example |
|---|---|---|
|
Container image tag used by the entrypoint Snakefiles. The workflow builds the full image URI as |
|
|
Filesystem-safe organism label used for output file prefixes and GenBank source/metadata. Use underscores instead of spaces; legacy |
|
|
Filesystem-safe version label for this genome release. Used for release directories and output file names; legacy |
|
|
Required only with |
|
Hifiasm Genome Assembly
Parameter |
Description |
Example |
|---|---|---|
|
One or more assemblies to process after hifiasm. Allowed values: |
|
|
Optional: Enable hifiasm self-scaffolding by adding |
|
|
Optional: Path to ultra-long ONT reads in FASTQ format ( |
|
|
Optional: Hi-C read 1 input for hifiasm phasing, YaHS scaffolding, and Juicebox-ready contact maps. Set to |
|
|
Optional: Hi-C read 2 input for hifiasm phasing, YaHS scaffolding, and Juicebox-ready contact maps. Must match |
|
Oatk Organelle Assembly
Parameter |
Description |
Example |
|---|---|---|
|
Lineage of the Oatk HMM profile database. Lineage list |
|
|
One or more organelles to assemble, specified as a YAML list: |
|
|
Minimum kmer coverage used for Oatk. Use |
|
Contamination Screening
Parameter |
Description |
Example |
|---|---|---|
|
NCBI Taxonomy ID for the target organism. Used by FCS-GX screening and organelle GenBank source |
|
Optional Haplotig Removal with purge_dups
purge_dups removes residual haplotigs after FCS cleanup and before LongStitch and YaHS. Each entry in selected_assemblies is processed independently.
Parameter |
Description |
Example |
|---|---|---|
|
Optional: Enable haplotig removal before LongStitch and YaHS. Disabled by default. |
|
|
Use |
|
With purge_dups_enabled: true, purge_dups_all runs haplotig removal and QC before LongStitch and YaHS. Compare the QC results in results/fcs/ and results/purge_dups/ to assess the effect of purging. When disabled, this target runs through FCS cleanup and its associated QC, and subsequent assembly steps start from the FCS-cleaned assembly.
LongStitch Misassembly Correction and Scaffolding
Parameter |
Description |
Example |
|---|---|---|
|
Run LongStitch after FCS cleanup and optional purge_dups, before YaHS and downstream analysis. LongStitch uses the curated HiFi reads. The genome size passed as |
|
YaHS Scaffolding
Parameter |
Description |
Example |
|---|---|---|
|
Optional: Restriction enzyme motif(s) passed to YaHS with |
|
Quality Assessment
The workflow retains QC results for the pre-rename assembly stages. It also runs SeqKit statistics, sequence-length and GC-content plots, BUSCO, Merqury, a self-dotplot, TIDK, and a fresh HiFi read-depth analysis on the length-sorted assembly under results/renamed/. HiFi reads are mapped again so the depth table uses the renamed sequence IDs.
Parameter |
Description |
Example |
|---|---|---|
|
BUSCO lineage dataset for genome completeness assessment. Lineage list |
|
|
Clade for tidk find. Lineage list |
|
|
A telomeric repeat unit for tidk search. A Telomeric Repeat Database |
|
Softmasking
Parameter |
Description |
Example |
|---|---|---|
|
Supported Dfam release for the FamDB 3 consensus layout. |
|
|
Name of the Dfam lineage to use. |
|
Repeat analysis uses dfam/tetools:2.00, which includes RepeatModeler 2.0.9, RepeatMasker 4.2.4, FamDB 3.0.0, and RMBlast 2.17.1. Allocate at least four cores for masking; each RepeatMasker RMBlast batch uses four threads. See the TE Tools release.
The workflow downloads the Dfam 4.0 root and all curated and uncurated consensus components, verifies their MD5 checksums, and exports sequences for dfam_lineage_name and its ancestors and descendants. Allow approximately 4 GB for compressed downloads, plus space for the unpacked database and exported FASTA. See the Dfam 4.0 FamDB README.
When updating an existing analysis, remove the unused dfam_partitions setting and rerun the repeat-analysis targets to download Dfam 4.0 and rebuild the RepeatModeler database. Dfam 3.9 files are not reused. Regenerate downstream annotations to use the updated masking.
Gene Prediction
BRAKER4 v0.5.0-beta runs in ETP mode with the RepeatMasker soft-masked genome, RNA-seq evidence (fastp-filtered local libraries or VARUS sampling), and OrthoDB proteins. Set busco_lineage_dataset to an odb12 lineage, which is also used by compleasm.
Parameter |
Description |
Example |
|---|---|---|
|
Nuclear annotation RNA-seq source: |
|
|
Version of the OrthoDB database (used by BRAKER4). ProtHint instructions |
|
|
OrthoDB lineage dataset to use. Lineage list |
|
|
MD5 checksum of the OrthoDB database. Checksums |
|
BRAKER4 requires Conda and Apptainer on the host; enable both with --sdm conda apptainer. Input and working paths must not contain spaces or shell metacharacters. Use an organism_name that starts with a letter and contains only letters, digits, and underscores.
CPU and memory requirements are set in rule braker4 in workflow/rules/gene_prediction.smk: threads: 48 and resources: mem_mb=120000. Snakemake caps threads to the allocated cores. For concurrent assemblies, pass a total --resources mem_mb=... budget to the workflow. Advanced annotation settings are in workflow/config/braker4.ini.
When migrating from BRAKER3, archive previous QC and release files if needed; downstream output paths are shared. Existing results/braker3/ files are not reused. Check gene_prediction_all with --dry-run and the default rerun triggers so changes to inputs and code are detected. Use a new genome_version for a new release.
Visualization
Parameter |
Description |
Example |
|---|---|---|
|
Minimum contig length to be considered a “long contig” for downstream visualization such as Circos plots and self-alignment dot plots. |
|
|
Track configuration for the Circos plot |
|
|
Major tick interval (in bp) for the x-axis in Circos plots. Major ticks are labeled. |
|
|
Minor tick interval (in bp) for the x-axis in Circos plots. Minor ticks are unlabeled. |
|
Self-alignment dot plots include long contigs selected by min_long_contig_length, show that contig-length cutoff in the axis labels, and draw minimap2 PAF alignments with length >= 10 kb and identity >= 90%.
Linear plot count labels show each track’s input window size. Coverage tracks use the largest window in the input, and telomeric-repeat tracks use the TIDK interval; terminal windows may be shorter.
Organelle Annotation
Parameter |
Description |
Example |
|---|---|---|
|
Annotation tools for Oatk-assembled organelle genomes. Mitochondrion: |
|
|
Optional reference CDS/protein QC for PMGA/PGA annotations. Set an organelle |
|
For PMGA/mitochondrion, CDS /translation qualifiers are regenerated with the
pipeline’s final translation table. If residual validation failures are limited
to an undetermined terminal start and/or stop, the curation step marks the CDS
location with < and/or >, refreshes the corresponding note, and emits
/translation; other residual validation failures remain untranslated for
manual review.
Choosing Organelle Reference CDS QC References
When organelle_annotation.chloroplast is set to pga_v2, place one or a few plastid GenBank files (.gb, .gbk, or .gbff) in organelle_reference_cds_qc.chloroplast.reference_dir. PGA v2 uses these annotated references to transfer chloroplast/plastid gene annotations, so the reference choice can affect annotation completeness and naming. The same references are also used for chloroplast CDS/protein QC and reference-inferred RNA-editing rescue.
For PMGA/mitochondrion, organelle_reference_cds_qc.mitochondrion.reference_dir is optional. If provided, place one or a few mitochondrial GenBank files (.gb, .gbk, or .gbff) in that directory. Those references are used for mitochondrial CDS/protein QC and reference-inferred RNA-editing rescue. Applied reference-inferred sites are recorded separately from RNA-seq-supported calls in the RNA-editing evidence sidecars and GenBank /inference qualifiers.
Useful NCBI Nucleotide searches for chloroplast/plastid references:
"<Species name>"[Organism] AND chloroplast[Title] AND "complete genome"[Title]
<Genus name>[Organism] AND chloroplast[Title] AND "complete genome"[Title]
<Family name>[Organism] AND chloroplast[Title] AND "complete genome"[Title]
Useful NCBI Nucleotide searches for mitochondrial references:
"<Species name>"[Organism] AND mitochondrion[Title] AND "complete genome"[Title]
<Genus name>[Organism] AND mitochondrion[Title] AND "complete genome"[Title]
<Family name>[Organism] AND mitochondrion[Title] AND "complete genome"[Title]
Prefer complete organelle GenBank records from the same species, genus, or family when available.
NCBI GenBank download examples:
mkdir -p plastid_reference
mkdir -p mitochondrial_reference
PLASTID_ACCESSION="NC_041245.1"
MITOCHONDRION_ACCESSION="<mitochondrion accession>"
curl -L "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nuccore&id=${PLASTID_ACCESSION}&rettype=gb&retmode=text" \
-o "plastid_reference/${PLASTID_ACCESSION}.gbk"
curl -L "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nuccore&id=${MITOCHONDRION_ACCESSION}&rettype=gb&retmode=text" \
-o "mitochondrial_reference/${MITOCHONDRION_ACCESSION}.gbk"
Linting and formatting
Linting results
All tests passed!
Formatting results
1[DEBUG]
2[DEBUG] In file "/tmp/tmpsm0pvt45/workflow/rules/gene_prediction.smk": Formatted content is different from original
3[DEBUG]
4[DEBUG] In file "/tmp/tmpsm0pvt45/workflow/rules/common.smk": Formatted content is different from original
5[DEBUG]
6[DEBUG] In file "/tmp/tmpsm0pvt45/workflow/rules/circos_plot.smk": Formatted content is different from original
7[DEBUG]
8[DEBUG] In file "/tmp/tmpsm0pvt45/workflow/rules/organelle_annotation.smk": Formatted content is different from original
9[DEBUG]
10[DEBUG] In file "/tmp/tmpsm0pvt45/workflow/rules/softmask.smk": Formatted content is different from original
11[DEBUG]
12[DEBUG] In file "/tmp/tmpsm0pvt45/workflow/Snakefile": Formatted content is different from original
13[DEBUG]
14[DEBUG] In file "/tmp/tmpsm0pvt45/workflow/rules/purge_dups.smk": Formatted content is different from original
15[DEBUG]
16[DEBUG] In file "/tmp/tmpsm0pvt45/workflow/rules/genome_assembly.smk": Formatted content is different from original
17[INFO] 8 file(s) would be changed 😬
18
19snakefmt version: 0.11.5