vgteam / vg

tools for working with genome variation graphs
https://biostars.org/tag/vg/
Other
1.11k stars 195 forks source link

Use mpmap as a mapper for MSGA #2678

Open adamnovak opened 4 years ago

adamnovak commented 4 years ago

@jmonlong wants vg mpmap as an option for the mapper behind vg msga, instead of vg map. This is because vg mpmap reliably makes colinear alignments, while the vg map mapper allows arbitrary rearrangements.

jmonlong commented 4 years ago

Thanks for creating the issue @adamnovak. So, I was originally thinking of a pipeline that would chunk the graph, then iterate gcsa index->mpmap->augment (#2688 ). If there is a way to use vg mpmap within the vg msga framework that would also work I think and would make my pipeline much simpler.

I'll try to have a look at the vg msga code but if someone has worked on it in the past and wants to help, it'd be very appreciated!

glennhickey commented 4 years ago

Instead of the current logic

Mapper* mapper = nullptr;
...
mapper = new Mapper(xgidx, gcsaidx, lcpidx);
set options
...
Alignment aln = mapper->align(seq, 0, 0, 0, band_width, band_overlap, xdrop_alignment);

You'd want something like the following:

BaseMapper* base_mapper = nullptr;
...
if (not multipath) {
    Mapper* mapper = new Mapper(xgidx, gcsaidx, lcpidx);
    set options
    base_mapper = mapper;
} else {
    MultipathMapper* mapper = new MultipathMapper(xgidx, gcsaidx, lcpidx);
    set options
    base_mapper = mapper;
}
...
Alignment aln = base_mapper->align(seq, 0, 0, 0, band_width, band_overlap, xdrop_alignment);

It's a fairly trivial change but... supporting any command-line options specific to the different mappers would be a pain.