Skip to content

mult1fractal/ShadowBase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nanopore DNA modification analysis pipeline

License Nextflow Docker Singularity DSL2


Overview

ShadowBase is a Nextflow DSL2 pipeline for analyzing DNA modifications from Nanopore sequencing data. It supports both single-sample and multi-sample analysis, where each sample can use a different reference sequence.

Pipeline steps

  1. mod_mapping — Remaps MM/ML modification tags from BAM to reference via minimap2
  2. modkit pileup — Generates pileup BED with modification frequencies
  3. modkit find-motifs — Identifies enriched sequence motifs
  4. modkit call-mods — Produces modification-called BAM
  5. modkit extract — Extracts modification calls to TSV
  6. MicrobeMod (optional) — Motif calling and RM gene annotation
  7. MethylomeMiner (optional) — Methylome analysis with GFF annotations

Prerequisites

  • Java 8+ (OpenJDK / default-jre)
  • Nextflow 20.10.0+
  • Container engine — either Docker or Singularity
# Install Java
sudo apt install -y default-jre

# Install Nextflow
curl -s https://get.nextflow.io | bash
sudo mv nextflow /bin && sudo chmod 770 /bin/nextflow

Quick start

Single sample

nextflow run main.nf \
  --fasta_ref ref.fasta \
  --bam sample.bam \
  --output results \
  -profile local,docker

Multiple samples (same or different references)

Create a CSV:

SampleA,/path/to/sampleA.bam,/path/to/refA.fasta
SampleB,/path/to/sampleB.bam,/path/to/refB.fasta

Then run:

nextflow run main.nf \
  --samples samples.csv \
  --output results \
  -profile local,docker

With per-sample annotations (optional 4th column)

SampleA,/path/to/sampleA.bam,/path/to/refA.fasta,/path/to/annotationA.gff
SampleB,/path/to/sampleB.bam,/path/to/refB.fasta

Annotations enable the MethylomeMiner step.

Test data

nextflow run main.nf \
  --fasta_ref test_data/fastas/A_conjugant_0.5h_polished.fasta \
  --bam test_data/subsampled_bam/A_conjugant_0.5h_10percent.bam \
  --output test_output \
  -profile local,docker

Parameters

Param Default Description
--fasta_ref Reference FASTA (single sample mode)
--bam BAM with MM/ML modification tags (single sample mode)
--samples CSV file (name,bam,fasta[,annotation_gff])
--output results Output directory
--cores max_cores/4 CPUs per process
--max_cores all CPUs Machine-wide CPU limit
--gff_annotation Global GFF annotation for MethylomeMiner
--no_microbemod false Skip MicrobeMod (motif calling + RM genes)
--filter_threshold_modkit modkit pileup filter threshold

Profiles

Always use a two-part profile: -profile <Executor>,<Engine>

Executor Engine
local docker
slurm singularity
lsf
ukj_cloud
nextflow run main.nf ... -profile local,docker
nextflow run main.nf ... -profile slurm,singularity

Output structure

results/
├── Pipeline-runinfo/
│   ├── execution_timeline.html
│   └── execution_report.html
├── <sample_name>/
│   ├── 1.Modmapped_bam/
│   │   ├── <sample>.modmapped.bam
│   │   └── <sample>.modmapped.bam.bai
│   ├── 2.Microbemod_motifs/        (if --no_microbemod is not set)
│   │   ├── <sample>_motifs.tsv
│   │   ├── <sample>_methylated_sites.tsv
│   │   └── RM_genes/
│   ├── 3.Modkit/
│   │   ├── <sample>_pileup.bed
│   │   ├── find_motifs/
│   │   │   ├── <sample>_motifs.tsv
│   │   │   └── <sample>_modkit_find_motifs_log.txt
│   │   ├── call-mods-bam/
│   │   │   └── <sample>_call-mods.bam
│   │   └── extract/
│   │       └── <sample>_extract.tsv
│   └── 4.MethylomeMiner/           (if GFF annotation provided)
│       └── <sample>_MethylomeMiner_output/

Acknowledgments

Developed by Mike Marquet@mult1fractal

  • modkit — Nanopore modified base analysis toolkit
  • MicrobeMod — Microbial methylation analysis
  • Nextflow — Workflow orchestration

License

GPL-3.0

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors