Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG] Adding cANI Rust implementation to PR #2943 #3005

Merged
merged 8 commits into from
Feb 14, 2024

Conversation

mr-eyes
Copy link
Member

@mr-eyes mr-eyes commented Feb 14, 2024

Rust implementation for ANI estimation

Usage example:

use crate::c_ani::containment_to_distance;

fn main() {
    let containment = 0.1;
    let ksize = 31;
    let scaled = 1000; // u64
    let n_unique_kmers = 1000;
    let sequence_len_bp = n_unique_kmers * scaled;
    let confidence = Some(0.95);
    let estimate_ci = Some(true);
    let prob_threshold = Some(1e-3);

    let result = containment_to_distance(
        containment,
        ksize,
        scaled,
        Some(n_unique_kmers),
        Some(sequence_len_bp),
        confidence,
        estimate_ci,
        prob_threshold,
    );


    match result {
        Ok(ci_result) => {
            let ani_result = 1.0 - ci_result.point_estimate;
            println!("ANI: {}", ani_result);
        }

        Err(e) => println!("Error occurred: {:?}", e),
    }
}

dependabot bot and others added 5 commits February 14, 2024 06:10
Bumps [wasm-bindgen-test](https://github.com/rustwasm/wasm-bindgen) from
0.3.40 to 0.3.41.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/rustwasm/wasm-bindgen/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=wasm-bindgen-test&package-manager=cargo&previous-version=0.3.40&new-version=0.3.41)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [num-iter](https://github.com/rust-num/num-iter) from 0.1.43 to
0.1.44.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-num/num-iter/blob/master/RELEASES.md">num-iter's
changelog</a>.</em></p>
<blockquote>
<h1>Release 0.1.44 (2024-02-07)</h1>
<ul>
<li><a
href="https://redirect.github.com/rust-num/num-iter/pull/22">Upgrade to
2018 edition, <strong>MSRV 1.31</strong></a></li>
</ul>
<p><strong>Contributors</strong>: <a
href="https://github.com/cuviper"><code>@​cuviper</code></a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/rust-num/num-iter/commit/c643db4b631ea48c90020c95f26b0134de69dcce"><code>c643db4</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-num/num-iter/issues/27">#27</a>
from cuviper/release-0.1.44</li>
<li><a
href="https://github.com/rust-num/num-iter/commit/0e86a877cd43b7552a8d8854800f5240c7390b2d"><code>0e86a87</code></a>
Release 0.1.44</li>
<li><a
href="https://github.com/rust-num/num-iter/commit/04047f4a57f696d1a4cc9ee8c6b87f904f9af1fb"><code>04047f4</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-num/num-iter/issues/26">#26</a>
from cuviper/ci</li>
<li><a
href="https://github.com/rust-num/num-iter/commit/7f9ff72cd1d26e0a0120aba376b1d0862f30a506"><code>7f9ff72</code></a>
ci: Add a registry cache for git protocol</li>
<li><a
href="https://github.com/rust-num/num-iter/commit/29961d8812fc98e85742806522c3d98cc3de0cb2"><code>29961d8</code></a>
ci: Use a single action to collect final status</li>
<li><a
href="https://github.com/rust-num/num-iter/commit/e582ad4ca6deb53398e44c4959b41a87cc68abdb"><code>e582ad4</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-num/num-iter/issues/25">#25</a>
from cuviper/ci-merge</li>
<li><a
href="https://github.com/rust-num/num-iter/commit/5518b59cc129cbe607a19a23a5c4135097fbfb82"><code>5518b59</code></a>
Make the CI status more robust</li>
<li><a
href="https://github.com/rust-num/num-iter/commit/04d40a69e1bb918ebd301747b742616c0b7b744c"><code>04d40a6</code></a>
ci: upgrade to actions/checkout@v4</li>
<li><a
href="https://github.com/rust-num/num-iter/commit/cd4ac10b805b035a7ace714aacfcac49580b2756"><code>cd4ac10</code></a>
Switch from bors to merge queues</li>
<li><a
href="https://github.com/rust-num/num-iter/commit/4b09fc190214d102c8f76d31441ea4208e043acc"><code>4b09fc1</code></a>
Merge <a
href="https://redirect.github.com/rust-num/num-iter/issues/22">#22</a></li>
<li>Additional commits viewable in <a
href="https://github.com/rust-num/num-iter/compare/num-iter-0.1.43...num-iter-0.1.44">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=num-iter&package-manager=cargo&previous-version=0.1.43&new-version=0.1.44)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [web-sys](https://github.com/rustwasm/wasm-bindgen) from 0.3.67 to
0.3.68.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/rustwasm/wasm-bindgen/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=web-sys&package-manager=cargo&previous-version=0.3.67&new-version=0.3.68)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.56 to
1.0.57.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/thiserror/releases">thiserror's
releases</a>.</em></p>
<blockquote>
<h2>1.0.57</h2>
<ul>
<li>Generate more efficient <code>Display</code> impl for error message
which do not contain any interpolated value (<a
href="https://redirect.github.com/dtolnay/thiserror/issues/286">#286</a>,
thanks <a
href="https://github.com/nyurik"><code>@​nyurik</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/dtolnay/thiserror/commit/1d106b169c1ba328bcd64d70d06687413906d751"><code>1d106b1</code></a>
Release 1.0.57</li>
<li><a
href="https://github.com/dtolnay/thiserror/commit/8a5c4d1b76eaa667a71dfaeb1373bca36fda4e78"><code>8a5c4d1</code></a>
Use write_str when args only consists of trailing comma</li>
<li><a
href="https://github.com/dtolnay/thiserror/commit/f790bee2a401d71ac6e5492c7d1f8bb3a18a0e1c"><code>f790bee</code></a>
Phrase flag in terms of whether core::fmt machinery is required</li>
<li><a
href="https://github.com/dtolnay/thiserror/commit/d43b759e3aa02d54dcad59c5eadfc78a8e96536f"><code>d43b759</code></a>
Ignore needless_raw_string_hashes pedantic clippy lint in test</li>
<li><a
href="https://github.com/dtolnay/thiserror/commit/d09c4182955b459a4699adaf9b045077308a1d1a"><code>d09c418</code></a>
Touch up PR 286</li>
<li><a
href="https://github.com/dtolnay/thiserror/commit/097251d2f538c123c850e1873cd1e0172bf4c151"><code>097251d</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/thiserror/issues/286">#286</a>
from nyurik/litstr</li>
<li><a
href="https://github.com/dtolnay/thiserror/commit/cd79876fe8f2eead51a1d9efa0b0f42467b9bef8"><code>cd79876</code></a>
optimize by avoiding second fmt.value() call</li>
<li><a
href="https://github.com/dtolnay/thiserror/commit/d7e738e1d8e339d35a1ea0c4c252b055c66c3526"><code>d7e738e</code></a>
Optimize simple literals for Display::fmt</li>
<li><a
href="https://github.com/dtolnay/thiserror/commit/0717de3f507293f6faa7a32d987febb5c39a7048"><code>0717de3</code></a>
Update ui test suite to nightly-2024-02-08</li>
<li><a
href="https://github.com/dtolnay/thiserror/commit/c7c75470ec80c253a197b365f4571569ab53a8d9"><code>c7c7547</code></a>
Update ui test suite to nightly-2024-01-31</li>
<li>See full diff in <a
href="https://github.com/dtolnay/thiserror/compare/1.0.56...1.0.57">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=thiserror&package-manager=cargo&previous-version=1.0.56&new-version=1.0.57)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Copy link

codecov bot commented Feb 14, 2024

Codecov Report

Attention: 56 lines in your changes are missing coverage. Please review.

Comparison is base (01adde3) 92.85% compared to head (fb03dc6) 58.29%.

❗ Current head fb03dc6 differs from pull request most recent head eb8731a. Consider uploading reports for the commit eb8731a to get more accurate results

Files Patch % Lines
src/core/src/c_ani.rs 0.00% 56 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                  @@
##           upd-gatherresult    #3005       +/-   ##
=====================================================
- Coverage             92.85%   58.29%   -34.57%     
=====================================================
  Files                   104       32       -72     
  Lines                 12527     2918     -9609     
  Branches               2624        0     -2624     
=====================================================
- Hits                  11632     1701     -9931     
- Misses                  594     1217      +623     
+ Partials                301        0      -301     
Flag Coverage Δ
hypothesis-py ?
python ?
rust 58.29% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bluegenes
Copy link
Contributor

hi @mr-eyes if you change the branch to 'use-upd-gatheresult' i can go ahead and merge into my PR.

cheers for setting up - this ensures you get credit for your contributions :)

@mr-eyes mr-eyes changed the base branch from latest to upd-gatherresult February 14, 2024 20:50
@mr-eyes
Copy link
Member Author

mr-eyes commented Feb 14, 2024

hi @mr-eyes if you change the branch to 'use-upd-gatheresult' i can go ahead and merge into my PR.

cheers for setting up - this ensures you get credit for your contributions :)

upd-gatherresult is now the base. Thank you!

@mr-eyes mr-eyes changed the title [WIP] Adding cANI Rust implementation [MRG] Adding cANI Rust implementation Feb 14, 2024
@mr-eyes mr-eyes changed the title [MRG] Adding cANI Rust implementation [MRG] Adding cANI Rust implementation to PR #2943 Feb 14, 2024
Copy link
Contributor

@bluegenes bluegenes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx!

@bluegenes bluegenes merged commit 0d67fc4 into upd-gatherresult Feb 14, 2024
14 of 37 checks passed
@bluegenes bluegenes deleted the mo/rust_ani branch February 14, 2024 20:56
@mr-eyes
Copy link
Member Author

mr-eyes commented Feb 14, 2024

thx!

You are most welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants