marbl/MashMap

output conversion to SAM/BAM file

Closed this issue · 7 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!

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

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

@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

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

bkille commented

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.

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]
ekg commented