Introduction

nf-core/methylong is a bioinformatics pipeline that is tailored for long-read methylation calling. This pipeline require only modification-basecalled ONT reads or PacBio HiFi reads (modBam) and a genome reference as input. The ONT workflow including preprocessing (trim and repair) of reads, genome alignment and methylation calling. The PacBio HiFi workflow includes genome alignment and methylation calling. Methylation calls are extracted into BED/BEDGRAPH format, readily for direct downstream analysis.

ONT workflow:

  1. trim and repair tags of input modBam

    • trim and repair workflow:
      1. sort modBam - samtools sort
      2. convert modBam to fastq - samtools fastq
      3. trim barcode and adapters - porechop
      4. convert trimmed modfastq to modBam - samtools import
      5. repair MM/ML tags of trimmed modBam - modkit repair
  2. align to reference (plus sorting and indexing) - dorado aligner( default) / minimap2

    • include alignment summary - samtools flagstat
  3. create bedMethyl - modkit pileup, 5x base coverage minimum.

  4. create bedgraphs (optional)

PacBio workflow:

  1. align to reference - pbmm2 (default) or minimap2

    • minimap workflow:

      1. convert modBam to fastq - samtools convert
      2. alignment - minimap2
      3. sort and index - samtools sort
      4. alignment summary - samtools flagstat
    • pbmm2 workflow:

      1. alignment and sorting - pbmm2
      2. index - samtools index
      3. alignment summary - samtools flagstat
  2. create bedMethyl - pb-CpG-tools (default) or modkit pileup

    • notes about using pb-CpG-tools pileup:
      • 5x base coverage minimum.
      • 2 pile up methods available from pb-CpG-tools:
        1. default using model
        2. or count (differences described here: https://github.com/PacificBiosciences/pb-CpG-tools)
      • pb-CpG-tools by default merge mC signals on CpG into forward strand. To β€˜force’ strand specific signal output, I followed the suggestion mentioned in this issue (PacificBiosciences/pb-CpG-tools#37) which uses HP tags to tag forward and reverse reads, so they were output separately.
  3. create bedgraph (optional)

Usage

Note

Currently no support of dorado and pb-CpG-tools through conda.

Note

If you are new to Nextflow and nf-core, please refer to this page on how to set-up Nextflow. Make sure to test your setup with -profile test before running the workflow on actual data.

Required input:

  • unaligned modification basecalled bam (modBam)
    • for ONT R10.4.1 reads: basecall with dorado basecaller

      dorado basecaller hac,5mCG_5hmCG,6mA pod5s/ > calls.bam

    • for PacBio Revio HiFi reads: basecall with Jasmine
  • reference genome

First, prepare a samplesheet with your input data that looks as follows:

samplesheet.csv
sample,modbam,ref,method
Col_0,ont_modbam.bam,Col_0.fasta,ont
ColumnContent
sampleName of the sample
modBamPath to basecalled modBam file
refPath to assembly fasta/fa file
methodspecify ont / pacbio

Now, you can run the pipeline using:

nextflow run nf-core/methylong \
   -profile <docker/singularity/.../institute> \
   --input samplesheet.csv \
   --outdir <OUTDIR>
Warning

Please provide pipeline parameters via the CLI or Nextflow -params-file option. Custom config files including those provided by the -c Nextflow option can be used to provide any configuration except for parameters; see docs.

For more details and further functionality, please refer to the usage documentation and the parameter documentation.

Pipeline output

To see the results of an example test run with a full size dataset refer to the results tab on the nf-core website pipeline page. For more details about the output files and reports, please refer to the output documentation.

Folder stuctures of the outputs:

 
β”œβ”€β”€ ont/sampleName
β”‚   β”‚
β”‚   β”œβ”€β”€ fastqc
β”‚   β”‚
β”‚   β”œβ”€β”€ trim
β”‚   β”‚   β”œβ”€β”€ trimmed.fastq.gz
β”‚   β”‚   β”œβ”€β”€ trimmed.bam
β”‚   β”‚   └── trimmed.log
β”‚   β”‚
β”‚   β”œβ”€β”€ repair
β”‚   β”‚   β”œβ”€β”€ repaired.bam
β”‚   β”‚   └── repaired.log
β”‚   β”‚
β”‚   β”œβ”€β”€ alignment
β”‚   β”‚   β”œβ”€β”€ aligned.bam
β”‚   β”‚   β”œβ”€β”€ aligned.bai
β”‚   β”‚   β”œβ”€β”€ summary.txt
β”‚   β”‚   └── aligned.flagstat
β”‚   β”‚
β”‚   β”œβ”€β”€ pileup/modkit
β”‚   β”‚   β”œβ”€β”€ pileup.bed
β”‚   β”‚   └── pileup.log
β”‚   β”‚
β”‚   └── bedgraph
β”‚       └── bedgraphs
β”‚
β”‚
β”œβ”€β”€ pacbio/sampleName
β”‚   β”‚
β”‚   β”œβ”€β”€ fastqc
β”‚   β”‚
β”‚   β”œβ”€β”€ aligned_minimap2/ aligned_pbmm2
β”‚   β”‚   β”œβ”€β”€ aligned.bam
β”‚   β”‚   β”œβ”€β”€ aligned.bai/csi
β”‚   β”‚   └── aligned.flagstat
β”‚   β”‚
β”‚   β”œβ”€β”€ pileup: modkit/pb_cpg_tools
β”‚   β”‚   β”œβ”€β”€ pileup.bed
β”‚   β”‚   β”œβ”€β”€ pileup.log
β”‚   β”‚   └── pileup.bw (only pb_cpg_tools)
β”‚   β”‚
β”‚   └── bedgraph
β”‚      └── bedgraphs
β”‚
└── multiqc
    β”‚
    β”œβ”€β”€ fastqc
    └── flagstat
 

bedgraph outputs all have min. 5x base coverage.

Credits

nf-core/methylong was originally written by Jin Yan Khoo.

We thank the following people for their extensive assistance in the development of this pipeline:

Contributions and Support

If you would like to contribute to this pipeline, please see the contributing guidelines.

For further information or help, don’t hesitate to get in touch on the Slack #methylong channel (you can join with this invite).

Citations

An extensive list of references for the tools used by the pipeline can be found in the CITATIONS.md file.

You can cite the nf-core publication as follows:

The nf-core framework for community-curated bioinformatics pipelines.

Philip Ewels, Alexander Peltzer, Sven Fillinger, Harshil Patel, Johannes Alneberg, Andreas Wilm, Maxime Ulysse Garcia, Paolo Di Tommaso & Sven Nahnsen.

Nat Biotechnol. 2020 Feb 13. doi: 10.1038/s41587-020-0439-x.