diff --git a/.github/workflows/maturin-wheels.yml b/.github/workflows/maturin-wheels.yml new file mode 100644 index 00000000..2e61759e --- /dev/null +++ b/.github/workflows/maturin-wheels.yml @@ -0,0 +1,109 @@ +# This file is autogenerated by maturin v1.2.3 +# To update, run +# +# maturin generate-ci github +# +name: maturin-wheels +on: + push: + branches: + - main + tags: + - 'v*' + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + linux: + runs-on: ubuntu-latest + strategy: + matrix: + target: [x86_64, x86] + steps: + - uses: actions/checkout@v3 + - name: Install LLVM and Clang + uses: KyleMayes/install-llvm-action@v1 + with: + version: "10.0" + - name: Symlink libclang.so (Linux) + run: sudo ln -s libclang-11.so.1 /lib/x86_64-linux-gnu/libclang.so + working-directory: ${{ env.LLVM_PATH }}/lib + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.target }} + args: --release --out dist --find-interpreter + sccache: 'true' + manylinux: auto + - name: Upload wheels + uses: actions/upload-artifact@v3 + with: + name: wheels + path: dist + + macos: + runs-on: macos-latest + strategy: + matrix: + target: [x86_64, aarch64] + steps: + - uses: actions/checkout@v3 + - name: Install LLVM and Clang + uses: KyleMayes/install-llvm-action@v1 + with: + version: "10.0" + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.target }} + args: --release --out dist --find-interpreter + sccache: 'true' + - name: Upload wheels + uses: actions/upload-artifact@v3 + with: + name: wheels + path: dist + + sdist: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Build sdist + uses: PyO3/maturin-action@v1 + with: + command: sdist + args: --out dist + - name: Upload sdist + uses: actions/upload-artifact@v3 + with: + name: wheels + path: dist + + release: + name: Release + runs-on: ubuntu-latest + if: "startsWith(github.ref, 'refs/tags/')" + needs: [linux, macos, sdist] + steps: + - uses: actions/download-artifact@v3 + with: + name: wheels + - name: Publish to PyPI + uses: PyO3/maturin-action@v1 + env: + MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} + with: + command: upload + args: --non-interactive --skip-existing * diff --git a/Cargo.lock b/Cargo.lock index 2f3616ec..08ef6a0b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,12 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" - [[package]] name = "adler" version = "1.0.2" @@ -127,6 +121,12 @@ dependencies = [ "thiserror", ] +[[package]] +name = "binary-merge" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597bb81c80a54b6a4381b23faba8d7774b144c94cbd1d6fe3f1329bd776554ab" + [[package]] name = "bindgen" version = "0.65.1" @@ -269,6 +269,15 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "camino" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +dependencies = [ + "serde", +] + [[package]] name = "cc" version = "1.0.83" @@ -477,6 +486,18 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +[[package]] +name = "enum_dispatch" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f33313078bb8d4d05a2733a94ac4c2d8a0df9a2b84424ebf4f33bfc224a890e" +dependencies = [ + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.29", +] + [[package]] name = "env_logger" version = "0.10.1" @@ -542,37 +563,12 @@ dependencies = [ "num-traits", ] -[[package]] -name = "flume" -version = "0.10.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577" -dependencies = [ - "futures-core", - "futures-sink", - "nanorand", - "pin-project", - "spin", -] - [[package]] name = "funty" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" -[[package]] -name = "futures-core" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" - -[[package]] -name = "futures-sink" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" - [[package]] name = "generic-array" version = "0.14.7" @@ -694,6 +690,15 @@ dependencies = [ "generic-array", ] +[[package]] +name = "inplace-vec-builder" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf64c2edc8226891a71f127587a2861b132d2b942310843814d5001d99a1d307" +dependencies = [ + "smallvec", +] + [[package]] name = "is-terminal" version = "0.4.9" @@ -850,9 +855,9 @@ checksum = "5486aed0026218e61b8a01d5fbd5a0a134649abb71a0e53b7bc088529dced86e" [[package]] name = "memmap2" -version = "0.5.10" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +checksum = "f49388d20533534cd19360ad3d6a7dadc885944aa802ba3995040c5ec11288c6" dependencies = [ "libc", ] @@ -887,15 +892,6 @@ version = "0.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2983372caf4480544083767bf2d27defafe32af49ab4df3a0b7fc90793a3664" -[[package]] -name = "nanorand" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" -dependencies = [ - "getrandom", -] - [[package]] name = "needletail" version = "0.5.1" @@ -994,25 +990,27 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "ouroboros" -version = "0.15.6" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1358bd1558bd2a083fed428ffeda486fbfb323e698cdda7794259d592ca72db" +checksum = "1c86de06555b970aec45229b27291b53154f21a5743a163419f4e4c0b065dcde" dependencies = [ "aliasable", "ouroboros_macro", + "static_assertions", ] [[package]] name = "ouroboros_macro" -version = "0.15.6" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f7d21ccd03305a674437ee1248f3ab5d4b1db095cf1caf49f1713ddf61956b7" +checksum = "8cad0c4b129e9696e37cb712b243777b90ef489a0bfaa0ac34e7d9b860e4f134" dependencies = [ - "Inflector", + "heck", + "itertools", "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.29", ] [[package]] @@ -1067,39 +1065,20 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" -[[package]] -name = "pin-project" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.29", -] - [[package]] name = "piz" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58c75d1c00e6d407e283cc66d9d4fd0985ef1703c761520845b93c4f981bfb65" +checksum = "898b071c1938a2c92b95c18708cbf38f2566a01f0ab9dd7bdf4329987e5c2e17" dependencies = [ + "camino", "chrono", "codepage-437", "crc32fast", "flate2", "log", + "memchr", "thiserror", - "twoway", ] [[package]] @@ -1242,6 +1221,7 @@ dependencies = [ "anyhow", "assert_cmd", "assert_matches", + "camino", "csv", "env_logger", "log", @@ -1425,9 +1405,9 @@ dependencies = [ [[package]] name = "retain_mut" -version = "0.1.9" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" +checksum = "8c31b5c4033f8fdde8700e4657be2c497e7288f01515be52168c631e2e4d4086" [[package]] name = "rkyv" @@ -1459,9 +1439,9 @@ dependencies = [ [[package]] name = "roaring" -version = "0.9.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd539cab4e32019956fe7e0cf160bb6d4802f4be2b52c4253d76d3bb0f85a5f7" +checksum = "6106b5cf8587f5834158895e9715a3c6c9716c8aefab57f1f7680917191c7873" dependencies = [ "bytemuck", "byteorder", @@ -1619,15 +1599,18 @@ checksum = "bceb57dc07c92cdae60f5b27b3fa92ecaaa42fe36c55e22dbfb0b44893e0b1f7" [[package]] name = "sourmash" version = "0.12.0" -source = "git+https://github.com/sourmash-bio/sourmash?rev=ff1092f8f366339caa59d7203f623813228f4356#ff1092f8f366339caa59d7203f623813228f4356" dependencies = [ "az", "bytecount", "byteorder", + "camino", "cfg-if", + "chrono", "counter", + "csv", + "enum_dispatch", "fixedbitset", - "flume", + "getrandom", "getset", "histogram", "log", @@ -1657,15 +1640,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", -] - [[package]] name = "static_assertions" version = "1.1.0" @@ -1803,16 +1777,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" -[[package]] -name = "twoway" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c57ffb460d7c24cd6eda43694110189030a3d1dfe418416d9468fd1c1d290b47" -dependencies = [ - "memchr", - "unchecked-index", -] - [[package]] name = "twox-hash" version = "1.6.3" @@ -1826,9 +1790,9 @@ dependencies = [ [[package]] name = "typed-builder" -version = "0.10.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89851716b67b937e393b3daa8423e67ddfc4bbbf1654bcf05488e95e0828db0c" +checksum = "64cba322cb9b7bc6ca048de49e83918223f35e7a86311267013afff257004870" dependencies = [ "proc-macro2", "quote", @@ -1841,12 +1805,6 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" -[[package]] -name = "unchecked-index" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeba86d422ce181a719445e51872fa30f1f7413b62becb52e95ec91aa262d85c" - [[package]] name = "unicode-ident" version = "1.0.11" @@ -1873,10 +1831,13 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "vec-collections" -version = "0.3.6" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f2390c4dc8ae8640c57d067b1a3d40bc05c124cc6bc7394d761b53435d41b76" +checksum = "3c9965c8f2ffed1dbcd16cafe18a009642f540fa22661c6cfd6309ddb02e4982" dependencies = [ + "binary-merge", + "inplace-vec-builder", + "lazy_static", "num-traits", "serde", "smallvec", diff --git a/Cargo.toml b/Cargo.toml index 9834d303..695fc7b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,9 @@ crate-type = ["cdylib"] pyo3 = { version = "0.20.0", features = ["extension-module", "anyhow"] } rayon = "1.8.0" serde = { version = "1.0.192", features = ["derive"] } -sourmash = { git = "https://github.com/sourmash-bio/sourmash", "rev" = "ff1092f8f366339caa59d7203f623813228f4356" } +#sourmash = { git = "https://github.com/sourmash-bio/sourmash", "rev" = "ff1092f8f366339caa59d7203f623813228f4356" } +#sourmash = { git = "https://github.com/sourmash-bio/sourmash", branch = "lirber/mastiff", features = ["branchwater"] } +sourmash = { path = "../sourmash/src/core", features = ["branchwater"] } serde_json = "1.0.108" niffler = "2.4.0" log = "0.4.14" @@ -23,6 +25,7 @@ zip = "0.6" tempfile = "3.8" needletail = "0.5.1" csv = "1.3.0" +camino = "1.1.6" [dev-dependencies] assert_cmd = "2.0.4" diff --git a/src/check.rs b/src/check.rs index 3b6484ee..7df0ca2a 100644 --- a/src/check.rs +++ b/src/check.rs @@ -2,7 +2,8 @@ use std::path::Path; use crate::utils::is_revindex_database; -use sourmash::index::revindex::RevIndex; +use sourmash::index::revindex::{RevIndex, RevIndexOps}; + pub fn check>(index: P, quick: bool) -> Result<(), Box> { if !is_revindex_database(index.as_ref()) { @@ -13,7 +14,7 @@ pub fn check>(index: P, quick: bool) -> Result<(), Box>( - siglist: P, - template: Sketch, + siglist: PathBuf, + // template: Sketch, + manifest: Option

, + selection: Selection, output: P, save_paths: bool, colors: bool, ) -> Result<(), Box> { println!("Loading siglist"); - let (index_sigs, _temp_dir) = - load_sigpaths_from_zip_or_pathlist(&siglist, &template, ReportType::Index)?; + // let (index_sigs, _temp_dir) = load_sigpaths_from_zip_or_pathlist(&siglist)?; - // if index_sigs pathlist is empty, bail - if index_sigs.is_empty() { - bail!("No signatures to index loaded, exiting."); - } + // // if index_sigs pathlist is empty, bail + // if index_sigs.is_empty() { + // bail!("No signatures to index loaded, exiting."); + // } - // Create or open the RevIndex database with the provided output path and colors flag - let db = RevIndex::create(output.as_ref(), colors); + // // Create or open the RevIndex database with the provided output path and colors flag + // let db = RevIndex::create(output.as_ref(), colors); - // Index the signatures using the loaded template, threshold, and save_paths option - db.index(index_sigs, &template, 0.0, save_paths); + // // Index the signatures using the loaded template, threshold, and save_paths option + // db.index(index_sigs, &template, 0.0, save_paths); + + let manifest = if let Some(m) = manifest { + let rdr = std::fs::OpenOptions::new().read(true).open(m.as_ref())?; + Some(Manifest::from_reader(rdr)?) + } else { + None + }; + + let collection = if matches!(&siglist.extension(), Some("zip")) { + if let Some(m) = manifest { + let storage = ZipStorage::from_file(siglist)?; + Collection::new(m, InnerStorage::new(storage)) + } else { + Collection::from_zipfile(siglist)? + } + } else { + let manifest = manifest.ok_or_else(|| "Need a manifest")?; + let storage = FSStorage::builder() + .fullpath("".into()) + .subdir("".into()) + .build(); + Collection::new(manifest, InnerStorage::new(storage)) + }; + + RevIndex::create( + output.as_ref(), + collection.select(&selection)?.try_into()?, + colors, + )?; Ok(()) } diff --git a/src/lib.rs b/src/lib.rs index e7de2643..b924d2a8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -16,6 +16,8 @@ mod manysketch; mod mastiff_manygather; mod mastiff_manysearch; mod multisearch; +use sourmash::selection::Selection; +use sourmash::encodings::HashFunctions; #[pyfunction] fn do_manysearch( @@ -103,10 +105,24 @@ fn do_fastmultigather( // if a siglist path is a revindex, run mastiff_manygather. If not, run multigather let template = build_template(ksize, scaled, &moltype); if is_revindex_database(siglist_path.as_ref()) { + // build selection instead of template + let hash_function = match moltype.as_str() { + "dna" => HashFunctions::Murmur64Dna, + "protein" => HashFunctions::Murmur64Protein, + "dayhoff" => HashFunctions::Murmur64Dayhoff, + "hp" => HashFunctions::Murmur64Hp, + _ => panic!("Unknown molecule type: {}", moltype), + }; + let selection = Selection::builder() + .ksize(ksize.into()) + .scaled(scaled as u32) + .moltype(hash_function) + .build(); match mastiff_manygather::mastiff_manygather( query_filenames, siglist_path, template, + selection, threshold_bp, output_path, ) { @@ -160,9 +176,25 @@ fn do_index( save_paths: bool, colors: bool, ) -> anyhow::Result { + let hash_function = match moltype.as_str() { + "dna" => HashFunctions::Murmur64Dna, + "protein" => HashFunctions::Murmur64Protein, + "dayhoff" => HashFunctions::Murmur64Dayhoff, + "hp" => HashFunctions::Murmur64Hp, + _ => panic!("Unknown molecule type: {}", moltype), + }; + let selection = Selection::builder() + .ksize(ksize.into()) + .scaled(scaled as u32) + .moltype(hash_function) + .build(); + // match index::index(siglist, template, output, save_paths, colors) { + // convert siglist to PathBuf // build template from ksize, scaled let template = build_template(ksize, scaled, &moltype); - match index::index(siglist, template, output, save_paths, colors) { + let location = camino::Utf8PathBuf::from(siglist); + let manifest = None; + match index::index(location, manifest, selection, output, save_paths, colors) { Ok(_) => Ok(0), Err(e) => { eprintln!("Error: {e}"); diff --git a/src/mastiff_manygather.rs b/src/mastiff_manygather.rs index 48a23053..e51af754 100644 --- a/src/mastiff_manygather.rs +++ b/src/mastiff_manygather.rs @@ -6,7 +6,16 @@ use sourmash::signature::Signature; use sourmash::sketch::Sketch; use std::path::Path; -use sourmash::index::revindex::RevIndex; +// use sourmash::collection::Collection; +// use sourmash::selection::Selection;A +use sourmash::prelude::*; +// use sourmash::index::revindex::{prepare_query, RevIndex, RevIndexOps}; +// use sourmash::manifest::Manifest; +// use sourmash::prelude::*; +// use sourmash::signature::{Signature, SigsTrait}; +// use sourmash::storage::{FSStorage, InnerStorage, ZipStorage}; + +use sourmash::index::revindex::{RevIndex, RevIndexOps}; use std::sync::atomic; use std::sync::atomic::AtomicUsize; @@ -22,6 +31,7 @@ pub fn mastiff_manygather>( queries_file: P, index: P, template: Sketch, + selection: Selection, threshold_bp: usize, output: Option

, ) -> Result<(), Box> { @@ -32,7 +42,7 @@ pub fn mastiff_manygather>( ); } // Open database once - let db = RevIndex::open(index.as_ref(), true); + let db = RevIndex::open(index.as_ref(), true)?; println!("Loaded DB"); // Load query paths @@ -89,6 +99,10 @@ pub fn mastiff_manygather>( match Signature::from_path(filename) { Ok(query_sig) => { let location = filename.display().to_string(); + // if let Some(q) = prepare_query(&query_sig, &selection) { + // query = Some(q); + // } + // let query = query.expect("Couldn't find a compatible MinHash"); if let Some(query) = prepare_query(&query_sig, &template, &location) { // let query_size = query.minhash.size() as f64; let threshold = threshold_bp / query.minhash.scaled() as usize; @@ -103,7 +117,7 @@ pub fn mastiff_manygather>( hash_to_color, threshold, &query.minhash, - &template, + Some(selection.clone()), ); // extract matches from Result diff --git a/src/mastiff_manysearch.rs b/src/mastiff_manysearch.rs index 4681a8ef..654c1c17 100644 --- a/src/mastiff_manysearch.rs +++ b/src/mastiff_manysearch.rs @@ -6,7 +6,14 @@ use sourmash::signature::{Signature, SigsTrait}; use sourmash::sketch::Sketch; use std::path::Path; -use sourmash::index::revindex::RevIndex; +// use sourmash::collection::Collection; +// use sourmash::index::revindex::{prepare_query, RevIndex, RevIndexOps}; +// use sourmash::manifest::Manifest; +// use sourmash::prelude::*; +// use sourmash::storage::{FSStorage, InnerStorage, ZipStorage}; + +// use sourmash::index::revindex::RevIndex; +use sourmash::index::revindex::{RevIndex, RevIndexOps}; use std::sync::atomic; use std::sync::atomic::AtomicUsize; @@ -30,7 +37,7 @@ pub fn mastiff_manysearch>( ); } // Open database once - let db = RevIndex::open(index.as_ref(), true); + let db = RevIndex::open(index.as_ref(), true)?; println!("Loaded DB"); // Load query paths diff --git a/src/utils.rs b/src/utils.rs index 630868f6..84d2c053 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -19,8 +19,8 @@ use anyhow::{anyhow, Result}; use std::cmp::{Ordering, PartialOrd}; -use sourmash::prelude::FracMinHashOps; -use sourmash::prelude::MinHashOps; +// use sourmash::prelude::FracMinHashOps; +// use sourmash::prelude::HashOps; use sourmash::signature::{Signature, SigsTrait}; use sourmash::sketch::minhash::{max_hash_for_scaled, KmerMinHash}; use sourmash::sketch::Sketch; @@ -792,10 +792,10 @@ pub fn consume_query_by_gather + std::fmt::Debug + std::fmt::Disp pub fn build_template(ksize: u8, scaled: usize, moltype: &str) -> Sketch { let hash_function = match moltype { - "dna" => HashFunctions::murmur64_DNA, - "protein" => HashFunctions::murmur64_protein, - "dayhoff" => HashFunctions::murmur64_dayhoff, - "hp" => HashFunctions::murmur64_hp, + "dna" => HashFunctions::Murmur64Dna, + "protein" => HashFunctions::Murmur64Protein, + "dayhoff" => HashFunctions::Murmur64Dayhoff, + "hp" => HashFunctions::Murmur64Hp, _ => panic!("Unknown molecule type: {}", moltype), }; //adjust ksize if not dna