nanoporetech / dorado

Oxford Nanopore's Basecaller
https://nanoporetech.com/
Other
527 stars 63 forks source link

Align with minimap2 splice aware mode when basecalling? #298

Closed lmulroney closed 1 year ago

lmulroney commented 1 year ago

Hi Dorado team,

From the documentation I couldn't find any information on how to use splice aware mode for mapping during basecalling with minimap2. Any help would be much appreciated.

Thanks, Logan

tijyojwad commented 1 year ago

Hi @lmulroney - we don't have that option configurable through dorado yet. We plan to expose more such options but haven't gotten around to it yet.

For now I can think of 2 workarounds -

  1. instead of using --reference you can pipe the fastq output of dorado to minimap2
    dorado basecaller <model> <pod5> --emit-fastq | minimap2 -a -x ... ref.fq > aligned.bam
  2. The minimap2 flags in dorado are configured here. You can adjust them and rebuild dorado locally. If you're comfortable with contributing you can also upstream those changes :).
lmulroney commented 1 year ago

Hi @tijyojwad,

Thanks for the suggestion for piping, but I also need the move table for my work at the moment. I don't think I have the time to try adding this option to Dorado at the moment, but I will let you know if that changes and I try it.

Thanks, Logan

Psy-Fer commented 1 year ago

Hey @lmulroney

You could pipe the bam along with the move table and other sam tag info like this

dorado <commands> | samtools fastq -T "*" | minimap2 -ax map-ont -y ref.fa > some.sam

where -T "*" is to output all the tags in the fastq header and -y tells minimap2 to read all those tags and put them in the output sam/bam.

So you should get your move table as well.

Hope that helps until they update the minimap2 controls.

Cheers, James

iiSeymour commented 1 year ago

Thanks @Psy-Fer; p.s @lmulroney you'll need at least samtools 1.16 for this https://github.com/samtools/samtools/releases.

lmulroney commented 1 year ago

Fantastic, thank you @Psy-Fer for the suggestion and @iiSeymour for the warning about samtools versions!

Logan

pre-mRNA commented 7 months ago

Edit: This shouldn't matter since MM/ML tags are calculated relative to the read sequence, which doesn't change. It should be safe to use the samtools fastq -T "*" approach to extract the fastq and remap it using the desired parameters.

I don't think this solves the issue of being able to perform spliced alignment while maintain Dorado's RNA modification calls, since the MM/ML tags aren't calculated again once re-aligning the fastq files using minimap -y.