jts/nanopolish

creating bam files for 6mA and 4mC

Qvdauwer opened this issue · 1 comments

Dear,

I would like to use nanopolish to call methylation for 5mC, 6mA, and 4mC.

When I try it using following commands, it works and seems to produce a normal output:

nanopolish call-methylation -v -t 14 -q cpg -r /projects/methylation_work/isolates/Isolates/isolates_29_09_part_2/barcoded/reads/barcode17.fastq.gz -b barcode17_reads_nanopolish_sorted.bam -g /projects/methylation_work/isolates/Isolates/isolates_29_09_part_2/barcoded/assemblies/barcode17_trycycler.fasta > methylation_calls_nanopolish_bc17_29_09_5mC.tsv

nanopolish call-methylation -v -t 14 -q dam -r /projects/methylation_work/isolates/Isolates/isolates_29_09_part_2/barcoded/reads/barcode17.fastq.gz -b barcode17_reads_nanopolish_sorted.bam -g /projects/methylation_work/isolates/Isolates/isolates_29_09_part_2/barcoded/assemblies/barcode17_trycycler.fasta > methylation_calls_nanopolish_bc17_29_09_6mA.tsv

nanopolish call-methylation -v -t 14 -q dcm -r /projects/methylation_work/isolates/Isolates/isolates_29_09_part_2/barcoded/reads/barcode17.fastq.gz -b barcode17_reads_nanopolish_sorted.bam -g /projects/methylation_work/isolates/Isolates/isolates_29_09_part_2/barcoded/assemblies/barcode17_trycycler.fasta > methylation_calls_nanopolish_bc17_29_09_4mC.tsv

But when I add the --modbam-output-name tag, only 5mC works:

nanopolish call-methylation -v -t 14 -q cpg -r /projects/methylation_work/isolates/Isolates/isolates_29_09_part_2/barcoded/rea.gz -b barcode17_reads_nanopolish_sorted.bam -g /projects/methylation_work/isolates/Isolates/isolates_29_09_part_2/barcoded/assemblies/barcode17_trycycler.fasta --modbam-output-name  methyolish_bc17_29_09_5mC.bam
[post-run summary] total reads: 67258, unparseable: 0, qc fail: 58, could not calibrate: 67, no alignment: 2106, bad fast5: 0

nanopolish call-methylation -v -t 14 -q dam -r /projects/methylation_work/isolates/Isolates/isolates_29_09_part_2/barcoded/rea.gz -b barcode17_reads_nanopolish_sorted.bam -g /projects/methylation_work/isolates/Isolates/isolates_29_09_part_2/barcoded/assemblies/barcode17_trycycler.fasta --modbam-output-name  methyolish_bc17_29_09_6mA.bam
nanopolish: src/basemods/nanopolish_basemods.cpp:135: bam1_t* create_modbam_record(const bam1_t*, const std::map<int, ScoredSite>&, const MethylationCallingParameters&): Assertion `callinget->get_name() == "cpg"' failed.
Aborted

nanopolish call-methylation -v -t 14 -q dcm -r /projects/methylation_work/isolates/Isolates/isolates_29_09_part_2/barcoded/rea.gz -b barcode17_reads_nanopolish_sorted.bam -g /projects/methylation_work/isolates/Isolates/isolates_29_09_part_2/barcoded/assemblies/barcode17_trycycler.fasta --modbam-output-name  methyolish_bc17_29_09_4mC.bam
nanopolish: src/basemods/nanopolish_basemods.cpp:37: void get_modification_symbols(const Alphabet*, char&, char): Assertion `alphabet->num_recognition_sites() == 1' failed.
Aborted

Does to conversion to bam output only work for the cpg pattern?

Thanks in advance,
Quentin

jts commented

Hi,

Yes, the modbam support only works for CpG methylation. If you need modbams for other modifications and contexts I recommend using ONT's callers (guppy/dorado/remora).

Jared