8000 refactor: imports by Guelakais · Pull Request #600 · rust-bio/rust-bio · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refactor: imports #600

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,40 +22,40 @@ phylogeny = ["pest", "pest_derive", "bio-types/phylogeny"]


[dependencies]
bytecount = "0.6"
csv = "1.1"
num-traits = "0.2"
num-integer = "0.1"
bytecount = "0.6.8"
csv = "1.3"
num-traits = "0.2.19"
num-integer = "0.1.46"
itertools = ">=0.8, <0.14"
itertools-num = "0.1"
bv = { version = "0.11", features = ["serde"] }
itertools-num = "0.1.3"
bv = { version = "0.11.1", features = ["serde"] }
bit-set = "0.8"
ndarray= ">=0.15, <0.16"
lazy_static = "1.4"
serde = "1.0"
serde_derive = "1.0"
lazy_static = "1.5"
serde = "1.0.204"
serde_derive = "1.0.204"
approx = ">=0.3, <0.6"
custom_derive = "0.1"
newtype_derive = "0.1"
ordered-float = "4.2"
regex = { version = "1.3", default-features = false, features = ["std", "perf"] }
custom_derive = "0.1.7"
newtype_derive = "0.1.6"
ordered-float = "4.2.2"
regex = { version = "1.10.6", default-features = false, features = ["std", "perf"] }
multimap = ">=0.6, <0.11"
fxhash = "0.2"
fxhash = "0.2.1"
statrs = ">= 0.11, < 0.18"
bio-types = ">=1.0.0"
pest = { version = "2", optional = true }
pest_derive = { version = "2", optional = true }
pest = { version = "2.7.11", optional = true }
pest_derive = { version = "2.7.11", optional = true }
strum = ">= 0.16, < 0.27"
strum_macros = ">= 0.16, < 0.27"
enum-map = ">=0.6.4, <3"
triple_accel = ">=0.3, <0.5"
thiserror = "1"
anyhow = "1"
thiserror = "1.0.63"
anyhow = "1.0.86"
rand = ">=0.7.3, < 0.9"
editdistancek = ">=1.0.1, <2"

[dependencies.vec_map]
version = "0.8"
version = "0.8.2"
features = ["eders"]

[dependencies.petgraph]
Expand Down
10 changes: 7 additions & 3 deletions benches/approximate_matching.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ extern crate test;

use test::Bencher;

use bio::alignment::Alignment;
use bio::pattern_matching::myers::{long, Myers};
use bio::pattern_matching::ukkonen::*;
use bio::{
alignment::Alignment,
pattern_matching::{
myers::{long, Myers},
ukkonen::*,
},
};

static TEXT: &[u8] = b"GATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCTCTCCATGC\
ATTTGGTATTTTCGTCTGGGGGGTATGCACGCGATAGCATTGCGAGACGCTGGAGCCGGAGCACCCTATGTCGCAGTAT\
Expand Down
3 changes: 1 addition & 2 deletions benches/fasta_buffer_size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ use test::Bencher;

use bio::io::fasta;

use std::io::Seek;
use std::io::Write;
use std::io::{Seek, Write};

use rand::SeedableRng;

Expand Down
12 changes: 8 additions & 4 deletions benches/fmindex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

extern crate test;

use bio::alphabets;
use bio::data_structures::bwt::{bwt, less, Occ};
use bio::data_structures::fmindex::{BackwardSearchResult, FMIndex, FMIndexable};
use bio::data_structures::suffix_array::suffix_array;
use bio::{
alphabets,
data_structures::{
bwt::{bwt, less, Occ},
fmindex::{BackwardSearchResult, FMIndex, FMIndexable},
suffix_array::suffix_array,
},
};
use test::Bencher;

#[bench]
Expand Down
9 changes: 5 additions & 4 deletions benches/interval_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ extern crate test;

use test::Bencher;

use bio::data_structures::interval_tree::*;
use bio::utils::Interval;
use std::cmp::{max, min};
use std::ops::Range;
use bio::{data_structures::interval_tree::*, utils::Interval};
use std::{
cmp::{max, min},
ops::Range,
};

#[bench]
fn bench_interval_few_large_queries(b: &mut Bencher) {
Expand Down
3 changes: 1 addition & 2 deletions benches/orf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ extern crate test;

use test::Bencher;

use bio::seq_analysis::gc::*;
use bio::seq_analysis::orf::Finder;
use bio::seq_analysis::{gc::*, orf::Finder};

// 5,000 random nucleotides, GC content = .55
static STR_1: &[u8] = b"ATCTAACTATTCCCTGTGCCTTATGGGGGCCTGCGCTATCTGCCTGT\
Expand Down
3 changes: 1 addition & 2 deletions benches/pairhmm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

extern crate test;

use bio::stats::pairhmm::*;
use bio::stats::{LogProb, Prob};
use bio::stats::{pairhmm::*, LogProb, Prob};
use test::Bencher;

static TEXT: &[u8] = b"GATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCTCTCCATGC\
Expand Down
8 changes: 3 additions & 5 deletions benches/pattern_matching.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

extern crate test;

use bio::pattern_matching::bndm::BNDM;
use bio::pattern_matching::bom::BOM;
use bio::pattern_matching::horspool::Horspool;
use bio::pattern_matching::kmp::KMP;
use bio::pattern_matching::shift_and::ShiftAnd;
use bio::pattern_matching::{
bndm::BNDM, bom::BOM, horspool::Horspool, kmp::KMP, shift_and::Shift F438 And,
};
use test::Bencher;

static TEXT: &[u8] = b"GATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCTCTCCATGC\
Expand Down
43 changes: 24 additions & 19 deletions src/alignment/pairwise/banded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@
//! # Example
//!
//! ```
//! use bio::alignment::pairwise::banded::*;
//! use bio::alignment::pairwise::{Scoring, MIN_SCORE};
//! use bio::alignment::sparse::hash_kmers;
//! use bio::alignment::AlignmentOperation::*;
//! use bio::alignment::{
//! pairwise::{banded::*, Scoring, MIN_SCORE},
//! sparse::hash_kmers,
//! AlignmentOperation::*,
//! };
//! use std::iter::repeat;
//!
//! let x = b"AGCACACGTGTGCGCTATACAGTAAGTAGTAGTACACGTGTCACAGTTGTACTAGCATGAC";
Expand Down Expand Up @@ -80,16 +81,17 @@
//! // aligner.custom_with_prehash(x, y, &y_kmers_hash) is also supported
//! ```

use crate::alignment::{Alignment, AlignmentOperation};
use crate::utils::TextSlice;
use std::cmp::{max, min, Ordering};
use std::i32;
use std::ops::Range;
use crate::{
alignment::{Alignment, AlignmentOperation},
utils::TextSlice,
};
use std::{
cmp::{max, min, Ordering},
ops::Range,
};

use super::*;
use crate::alignment::pairwise::Scoring;
use crate::alignment::sparse;
use crate::alignment::sparse::HashMapFx;
use crate::alignment::{pairwise::Scoring, sparse, sparse::HashMapFx};

const MAX_CELLS: usize = 5_000_000;
const DEFAULT_MATCH_SCORE: i32 = 2;
Expand Down Expand Up @@ -323,7 +325,7 @@ impl<F: MatchFunc> Aligner<F> {
/// * `y` - Textslice
/// * `matches` - Vector of kmer matching pairs (xpos, ypos)
/// * `allowed_mismatches` - Extend the matches diagonally allowing upto
/// the specified number of mismatches (Option<usize>)
/// the specified number of mismatches (Option<usize>)
/// * `use_lcskpp_union` - Extend the results from sdpkpp using lcskpp
pub fn custom_with_expanded_matches(
&mut self,
Expand Down Expand Up @@ -377,7 +379,7 @@ impl<F: MatchFunc> Aligner<F> {
/// * `y` - Textslice
/// * `matches` - Vector of kmer matching pairs (xpos, ypos)
/// * `path` - Vector of indices pointing to `matches` vector
/// which defines a path. The validity of the path is not checked.
/// which defines a path. The validity of the path is not checked.
pub fn custom_with_match_path(
&mut self,
x: TextSlice,
Expand Down Expand Up @@ -1407,9 +1409,13 @@ impl Band {

#[cfg(test)]
mod banded {
use crate::alignment::pairwise::{self, banded, Scoring};
use crate::alignment::sparse::hash_kmers;
use crate::utils::TextSlice;
use crate::{
alignment::{
pairwise::{self, banded, Scoring},
sparse::hash_kmers,
},
utils::TextSlice,
};

// Check that the banded alignment is equivalent to the exhaustive SW alignment
fn compare_to_full_alignment_local(x: TextSlice<'_>, y: TextSlice<'_>) {
Expand Down Expand Up @@ -1752,8 +1758,7 @@ mod banded {
// compare_to_full_alignment_semiglobal(x, y);
// }

use crate::alignment::AlignmentOperation::*;
use crate::scores::blosum62;
use crate::{alignment::AlignmentOperation::*, scores::blosum62};
use std::iter::repeat;

#[test]
Expand Down
20 changes: 10 additions & 10 deletions src/alignment/pairwise/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
//! # Example
//!
//! ```
//! use bio::alignment::pairwise::*;
//! use bio::alignment::AlignmentOperation::*;
//! use bio::scores::blosum62;
//! use bio::{
//! alignment::{pairwise::*, AlignmentOperation::*},
//! scores::blosum62,
//! };
//!
//! let x = b"ACCGTGGAT";
//! let y = b"AAAAACCGTTGAT";
Expand Down Expand Up @@ -150,12 +151,12 @@
//! );
//! ```

use std::cmp::max;
use std::i32;
use std::iter::repeat;
use std::{cmp::max, iter::repeat};

use crate::alignment::{Alignment, AlignmentMode, AlignmentOperation};
use crate::utils::TextSlice;
use crate::{
alignment::{Alignment, AlignmentMode, AlignmentOperation},
utils::TextSlice,
};

pub mod banded;

Expand Down Expand Up @@ -1163,8 +1164,7 @@ impl Traceback {
#[cfg(test)]
mod tests {
use super::*;
use crate::alignment::AlignmentOperation::*;
use crate::scores::blosum62;
use crate::{alignment::AlignmentOperation::*, scores::blosum62};

#[test]
fn traceback_cell() {
Expand Down
13 changes: 5 additions & 8 deletions src/alignment/poa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,17 @@
//!
//! For the original concept and theory, see:
//! * Lee, Christopher, Catherine Grasso, and Mark F. Sharlow. "Multiple sequence alignment using
//! partial order graphs." Bioinformatics 18.3 (2002): 452-464.
//! partial order graphs." Bioinformatics 18.3 (2002): 452-464.
//! * Lee, Christopher. "Generating consensus sequences from partial order multiple sequence
//! alignment graphs." Bioinformatics 19.8 (2003): 999-1008.
//! alignment graphs." Bioinformatics 19.8 (2003): 999-1008.
//!
//! For a modern reference implementation, see poapy:
//! https://github.com/ljdursi/poapy
//!
//! # Example
//!
//! ```
//! use bio::alignment::pairwise::Scoring;
//! use bio::alignment::poa::*;
//! use bio::alignment::{pairwise::Scoring, poa::*};
//!
//! let x = b"AAAAAAA";
//! let y = b"AABBBAA";
Expand All @@ -41,8 +40,7 @@ use crate::utils::TextSlice;

use crate::alignment::pairwise::{MatchFunc, Scoring};

use petgraph::graph::NodeIndex;
use petgraph::visit::Topo;
use petgraph::{graph::NodeIndex, visit::Topo};

use petgraph::{Directed, Graph, Incoming};

Expand Down Expand Up @@ -921,8 +919,7 @@ impl<F: MatchFunc> Poa<F> {
mod tests {
use super::*;
use crate::alignment::pairwise::Scoring;
use petgraph::dot::Dot;
use petgraph::graph::NodeIndex;
use petgraph::{dot::Dot, graph::NodeIndex};

#[test]
fn test_init_graph() {
Expand Down
8 changes: 5 additions & 3 deletions src/alignment/sparse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@

use crate::data_structures::bit_tree::MaxBitTree;
use fxhash::FxHasher;
use std::cmp::{max, min};
use std::collections::HashMap;
use std::hash::BuildHasherDefault;
use std::{
cmp::{max, min},
collections::HashMap,
hash::BuildHasherDefault,
};

pub type HashMapFx<K, V> = HashMap<K, V, BuildHasherDefault<FxHasher>>;

Expand Down
3 changes: 1 addition & 2 deletions src/alphabets/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
//! assert!(!alphabet.is_word(b"AXYZ"));
//! ```

use std::borrow::Borrow;
use std::mem;
use std::{borrow::Borrow, mem};

use bit_set::BitSet;
use vec_map::VecMap;
Expand Down
Loading
Loading
0