Thanks to visit codestin.com
Credit goes to github.com

Skip to content

marcikque/minimap2_mod-mini

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mod-Minimizer-Minimap2

This is a fork of minimap2 that replaces the minimizer algorithm with the mod-minimizer scheme, based on the paper:

The mod-minimizer: a simple and efficient sampling algorithm for long k-mers
Ragnar Groot Koerkamp, Giulio Ermanno Pibiri
bioRxiv 2024.05.25.595898; doi: 10.1101/2024.05.25.595898

Changes

This fork modifies the minimap2 code to implement the mod-minimizer algorithm for finding (w,k)-minimizers on DNA sequences. The mod-minimizer scheme provides a simple and efficient sampling algorithm for long k-mers, improving performance in certain applications.

Note: This implementation reduces the minimizer density. If you wish to achieve approximately the same minimizer density as Minimap2's default settings, it is recommended to use the flag -w 8.

Mod-Minimizer Algorithm Overview

The mod-minimizer algorithm finds (w,k)-minimizers on a DNA sequence using the following procedure:

Notation:

  • tmer: A newly constructed t-mer by removing the first base and appending the new base.
  • W: Set of t-mers in the current window.
  • tmer_i: The i-th t-mer of the window.
  • kmer_i: The i-th k-mer of the window.
  • h(a): Hash of sequence a.
  • rc(a): Reverse complement of sequence a.
  • pos_W(a): Position of a within window W (0-indexed).
  • M: List of minimizers.

Procedure:

Using a sliding window, construct the entering t-mer:

  1. Update Window: Remove the oldest t-mer from W:
    W = W \ {W_0}

  2. Compute t-mer Info:
    info = min( h(tmer), h(rc(tmer)) )

  3. Add t-mer to Window:
    W = W ∪ {info}

  4. Find Minimal t-mer:
    min = min(W)

  5. Compute Position:
    p = pos_W(min) mod w

  6. Select k-mer:
    kmer = min( h(kmer_p), h(rc(kmer_p)) )

  7. Update Minimizers:
    M = M ∪ {kmer}

For more details on the algorithm and its implementation, please refer to the original paper.

Additional Information

For all other details, usage instructions, and documentation, please refer to the original minimap2 repository. The version of the base Minimap2 program used for this modification and the corresponding benchmarks is Release 2.28-r1209 (27 March 2024).

About

Implementing mod-minimizers into minimap2

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 60.2%
  • JavaScript 17.2%
  • TeX 16.5%
  • Roff 2.8%
  • Cython 1.6%
  • Makefile 0.7%
  • Other 1.0%