MashMap icon indicating copy to clipboard operation
MashMap copied to clipboard

output conversion to SAM/BAM file

Open SAMtoBAM opened this issue 4 years ago • 4 comments

Hi there, I have a polyploid genome that I want to map to a haploid reference and want to calculate the depth/number of contigs aligning at each region. Is there a way to convert your output tsv file into a SAM file in order so simplify this?

Thanks!

SAMtoBAM avatar Aug 16 '21 22:08 SAMtoBAM

I am assuming your input to this was a fasta file , can you not just align that using something like minimap2 ?

Nheyer avatar Aug 16 '21 22:08 Nheyer

Yes it is a fasta file for the query assembly I have already done it with minimap2 using the asm5 option I was wondering if MashMap would perform differently, particularly in repetitive regions

SAMtoBAM avatar Aug 16 '21 22:08 SAMtoBAM

@treangen @skoren or @ondovb may be able to help you more, but generally mash map is used primarily for genome wide alignments where a SAM is not very useful so I would really trust minimap2 for your coverage data

Nheyer avatar Aug 16 '21 22:08 Nheyer

Genome wide alignments is exactly what I want, its just I can have 3-4 phased haplotypes assembled within a single polyploid genome. Plus with the default 'map' filter I should have the best position of all query contigs. Yes, this may be the case, the SAM is not the best format for these genome wide alignments, it's purely that there are already simple pipelines in place for coverage analysis using SAM/BAM files so I was hoping to take advantage of this

Thanks for the help

SAMtoBAM avatar Aug 16 '21 22:08 SAMtoBAM

Updating this issue for MashMap v3

The new version of mashmap outputs a PAF file. Unfortunately, there are no plans at the moment for paftools.js to support conversion from PAF to SAM/BAM.

bkille avatar Jul 10 '23 19:07 bkille

Hi @SAMtoBAM,

You may be interested in the rustybam toolkit, which supports PAF --> SAM conversion:

    paf-to-sam     Convert a PAF file into a SAM file. Warning, all alignments will be marked as
                   primary! [aliases: paftosam, p2s, paf2sam]

bkille avatar Nov 19 '23 19:11 bkille

wfmash can produce BAM on top of mashmap's homology maps.

On Sun, Nov 19, 2023, 13:04 Bryce Kille @.***> wrote:

Hi @SAMtoBAM https://github.com/SAMtoBAM,

You may be interested in the rustybam https://github.com/mrvollger/rustybam toolkit, which supports PAF --> SAM conversion:

paf-to-sam     Convert a PAF file into a SAM file. Warning, all alignments will be marked as
               primary! [aliases: paftosam, p2s, paf2sam]

— Reply to this email directly, view it on GitHub https://github.com/marbl/MashMap/issues/35#issuecomment-1817947419, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABDQEPF55EQQ462J6FDMJDYFJJ2NAVCNFSM5CITKKWKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBRG44TINZUGE4Q . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ekg avatar Nov 19 '23 22:11 ekg