From 9615652f39c205312905263bfc1eb08fd1233676 Mon Sep 17 00:00:00 2001 From: Joseph Guhlin Date: Wed, 27 Nov 2024 12:16:30 +1300 Subject: [PATCH] Update README.md with rayon and multithreading section --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e00bcb0..d88f511 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,7 @@ let mappings: Result> = aligner.map_file("query.fa", false, false); ## Multithreading Multithreading is supported, for implementation example see [fakeminimap2](https://github.com/jguhlin/minimap2-rs/blob/main/fakeminimap2/src/main.rs). Minimap2 also supports threading itself, and will use a minimum of 3 cores for building the index. Multithreading for mapping is left to the end-user. +Adjust the number of threads used to build the index: ```rust let mut aligner = Aligner::builder() .map_ont() @@ -106,7 +107,7 @@ let mut aligner = Aligner::builder() ``` ### Experimental Rayon support -This _appears_ to work. +This _appears_ to work. See [fakeminimap2](https://github.com/jguhlin/minimap2-rs/tree/main/fakeminimap2) for full implementation. ```rust use rayon::prelude::*; @@ -116,6 +117,9 @@ let results = sequences.par_iter().map(|seq| { }).collect::>(); ``` +### Arc cloning the Aligner +Also works. Otherwise directly cloning the aligner will Arc clone the internal index. + ## Features The following crate features are available: * map-file - Enables the ability to map a file directly to a reference. Enabled by deafult