Skip to content

Commit

Permalink
Version bump & doc_cfg removed
Browse files Browse the repository at this point in the history
  • Loading branch information
douweschulte committed Feb 17, 2024
1 parent caca2ba commit 2f834cf
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 25 deletions.
23 changes: 14 additions & 9 deletions rustyms-imgt-generate/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::redundant_pub_crate)]

use std::{
collections::HashMap,
fmt::Display,
Expand All @@ -14,7 +16,11 @@ mod shared;
use crate::shared::*;

use itertools::Itertools;
use rustyms::*;
use rustyms::{
align::Alignment,
system::{dalton, Mass},
*,
};

fn main() {
let file = File::open("../rustyms/databases/imgt.dat")
Expand Down Expand Up @@ -176,10 +182,9 @@ pub fn all_germlines() -> impl std::iter::Iterator<Item = &'static Germlines> {{
writeln!(
output,
"/// Get all germlines in one parallel iterator, see the main documentation for more information about the available germlines
use doc_cfg::doc_cfg;
#[cfg(feature = \"rayon\")]
use rayon::prelude::*;
#[doc_cfg(feature = \"rayon\")]
#[cfg(feature = \"rayon\")]
pub fn par_germlines() -> impl rayon::prelude::ParallelIterator<Item = &'static Germlines> {{"
)
.unwrap();
Expand Down Expand Up @@ -1122,12 +1127,12 @@ impl std::fmt::Display for TemporaryGermline {
)?;
}
if let Some(first_allele) = first_allele {
let alignment = rustyms_align::align::<1>(
let alignment = rustyms::align::align::<1>(
first_allele,
&seq.sequence,
rustyms_align::BLOSUM90,
rustyms::align::matrix::BLOSUM90,
crate::Tolerance::new_absolute(Mass::new::<dalton>(0.01)),
rustyms_align::AlignType::GLOBAL,
rustyms::align::AlignType::GLOBAL,
)
.stats();
writeln!(
Expand All @@ -1138,12 +1143,12 @@ impl std::fmt::Display for TemporaryGermline {
)?;
}
if let Some(reference) = reference {
let alignment = rustyms_align::align::<1>(
let alignment = rustyms::align::align::<1>(
reference,
&seq.sequence,
rustyms_align::BLOSUM90,
rustyms::align::matrix::BLOSUM90,
crate::Tolerance::new_absolute(Mass::new::<dalton>(0.01)),
rustyms_align::AlignType::GLOBAL,
rustyms::align::AlignType::GLOBAL,
)
.stats();
writeln!(
Expand Down
7 changes: 1 addition & 6 deletions rustyms/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rustyms"
version = "0.8.0"
version = "0.8.1"
edition = "2021"
license = "MIT OR Apache-2.0"
authors = ["Douwe Schulte <[email protected]>"]
Expand All @@ -20,7 +20,6 @@ rust-version = "1.70.0"

[dependencies]
bincode = "1.3"
doc-cfg = { version = "0.1" }
flate2 = "1.0"
itertools = "0.12"
ordered-float = { version = "4.2", features = ["serde"] }
Expand Down Expand Up @@ -48,10 +47,6 @@ default = ["imgt", "align", "identification", "rayon"]
imgt = []
align = []
identification = []
unstable-doc-cfg = []

[package.metadata.docs.rs]
features = ["unstable-doc-cfg"]

[[bench]]
name = "iai"
Expand Down
5 changes: 2 additions & 3 deletions rustyms/src/align/consecutive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ use crate::itertools_extension::ItertoolsExt;
use crate::*;
use std::collections::HashSet;

use doc_cfg::doc_cfg;
use itertools::Itertools;

/// Only available with if features `align` and `imgt` are turned on.
/// Align one sequence to multiple consecutive genes. Each gene can be controlled to be global to the left or free to allow unmatched residues between it and the previous gene.
/// If the sequence is too short to cover all genes only the genes that could be matched are returned.
#[doc_cfg(feature = "imgt")]
#[cfg(feature = "imgt")]
pub fn consecutive_align<const STEPS: u16>(
sequence: &LinearPeptide,
genes: &[(GeneType, AlignType)],
Expand Down Expand Up @@ -64,7 +63,7 @@ pub fn consecutive_align<const STEPS: u16>(
/// Only available with if features `align`, `rayon`, and `imgt` are turned on.
/// Align one sequence to multiple consecutive genes. Each gene can be controlled to be global to the left or free to allow unmatched residues between it and the previous gene.
/// If the sequence is too short to cover all genes only the genes that could be matched are returned.
#[doc_cfg(all(feature = "rayon", feature = "imgt"))]
#[cfg(all(feature = "rayon", feature = "imgt"))]
pub fn par_consecutive_align<const STEPS: u16>(
sequence: &LinearPeptide,
genes: &[(GeneType, AlignType)],
Expand Down
5 changes: 2 additions & 3 deletions rustyms/src/imgt/germlines/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,10 @@ pub fn all_germlines() -> impl std::iter::Iterator<Item = &'static Germlines> {
.chain(std::iter::once(lock_SusScrofa()))
.chain(std::iter::once(lock_VicugnaPacos()))
}
use doc_cfg::doc_cfg;
/// Get all germlines in one parallel iterator, see the main documentation for more information about the available germlines
/// Get all germlines in one parallel iterator, see the main documentation for more information about the available germlines, only available with feature "rayon" (on by default)
#[cfg(feature = "rayon")]
use rayon::prelude::*;
#[doc_cfg(feature = "rayon")]
#[cfg(feature = "rayon")]
pub fn par_germlines() -> impl rayon::prelude::ParallelIterator<Item = &'static Germlines> {
rayon::iter::once(lock_BosTaurus())
.chain(rayon::iter::once(lock_CamelusDromedarius()))
Expand Down
3 changes: 1 addition & 2 deletions rustyms/src/imgt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ mod germlines;
mod select;
mod shared;

use doc_cfg::doc_cfg;
pub use fancy::*;
#[doc_cfg(feature = "rayon")]
#[cfg(feature = "rayon")]
use germlines::par_germlines;
use germlines::{all_germlines, germlines};

Expand Down
3 changes: 1 addition & 2 deletions rustyms/src/imgt/select.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use doc_cfg::doc_cfg;
#[cfg(feature = "rayon")]
use rayon::prelude::*;
use std::collections::HashSet;
Expand Down Expand Up @@ -86,7 +85,7 @@ impl Selection {
.map(Into::into)
}

#[doc_cfg(feature = "rayon")]
#[cfg(feature = "rayon")]
/// Get the selected alleles in parallel fashion, only available if you enable the feature "rayon" (on by default)
pub fn par_germlines(self) -> impl ParallelIterator<Item = Allele<'static>> {
super::par_germlines()
Expand Down

0 comments on commit 2f834cf

Please sign in to comment.