Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified bam results #145

Closed
partha434 opened this issue Apr 15, 2023 · 7 comments
Closed

Modified bam results #145

partha434 opened this issue Apr 15, 2023 · 7 comments

Comments

@partha434
Copy link

Dorado produces basecalls in unmapped bam file. How can I check the modifications from this bam file?

@sklages
Copy link

sklages commented Apr 17, 2023

Map your data on your reference genome using minimap2[1] and then run modbam2bed[2] on the alignment file. You can check the results in e.g. IGV[3]

[1] https://github.com/lh3/minimap2
[2] https://github.com/epi2me-labs/modbam2bed
[3] https://software.broadinstitute.org/software/igv/

@partha434
Copy link
Author

But this is an unmapped bam file. How can I map a bam file to reference genome?

@Psy-Fer
Copy link

Psy-Fer commented Apr 17, 2023

You can go ubam to fastq and carry the meth tags with something like this
samtools fastq -TMM,ML ${USAM} | minimap2 -x map-ont -a -t ${num_threads} -y --secondary=no ${REFERENCE} - > ${SAMFILE}

The magic here is the - T that tells it to carry the MM and ML tags to the fastq, then the -y in Minimap2 tells it to carry them back to the bam.

Then you can use modbam2bed and other downstream tools.

@cjw85
Copy link
Member

cjw85 commented Apr 17, 2023

If you do:

samtools fastq -T '*' ....

you can carry all the tags from the SAM without loss.

@iiSeymour
Copy link
Member

@partha434 we are working on producing aligned BAMs for the next release.

Note: you need at least samtools 1.16 (Aug 2022) for samtools fastq -T '*' https://github.com/samtools/samtools/releases

@partha434
Copy link
Author

Thank you so much for the codes. This really worked for me... @Psy-Fer @cjw85
Eagerly waiting for an update related to this on Dorado @iiSeymour

@iiSeymour
Copy link
Member

v0.3.0 adds the ability to output aligned BAM directly from the basecaller as well as dorado aligner which can map/remap uSAM/uBAM and retain tags.

https://github.com/nanoporetech/dorado#alignment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants