Skip to content

Commit

Permalink
external_command_checker: Use crate which.
Browse files Browse the repository at this point in the history
Suggested by: @nickp60

#207
  • Loading branch information
wwood committed Mar 18, 2024
1 parent f2f27bd commit 22fec64
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
11 changes: 6 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,22 @@ default-run = "coverm"

[dependencies]
bio = "1.1.0"
rust-htslib = { version="0.44.*", default-features = false }
rust-htslib = { version="0.46.*", default-features = false }
clap = { version="4.*", features = ["cargo"] } # cargo feature required for crate_version!
clap_complete = "4.*"
log = "0.4.*"
env_logger = "0.10.*"
env_logger = "0.11.*"
nix = "0.26.*"
tempdir = "0.3.*"
tempfile = "3.*"
ansi_term = "0.12"
lazy_static = "1.4.0"
rand = "0.8.*"
serde = "1.0"
version-compare = "0.1.0"
bird_tool_utils = "0.5.0"
# bird_tool_utils = { git = "https://github.com/wwood/bird_tool_utils" }
version-compare = "0.2.0"
# bird_tool_utils = "0.5.0"
bird_tool_utils = { git = "https://github.com/wwood/bird_tool_utils" }
# bird_tool_utils = { path = "../bird_tool_utils" }
galah = "0.4.0"
# galah = { git = "https://github.com/wwood/galah" }
bird_tool_utils-man = "0.4.0"
Expand Down
11 changes: 5 additions & 6 deletions src/external_command_checker.rs
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
use bird_tool_utils::external_command_checker::*;

pub fn check_for_bwa() {
check_for_external_command_presence("BWA", "which bwa").expect("Failed to find installed BWA");
check_for_external_command_presence_with_which("bwa").expect("Failed to find installed BWA");
}

pub fn check_for_bwa_mem2() {
check_for_external_command_presence("BWA", "which bwa-mem2")
.expect("Failed to find installed BWA");
check_for_external_command_presence_with_which("bwa").expect("Failed to find installed BWA");
default_version_check("bwa-mem2", "2.0", false, Some("bwa-mem2 version"))
.expect("Failed to find sufficient version of bwa-mem2");
}

pub fn check_for_minimap2() {
check_for_external_command_presence("minimap2", "which minimap2")
check_for_external_command_presence_with_which("minimap2")
.expect("Failed to find installed minimap2");
default_version_check("minimap2", "2.24-r1122", false, None)
.expect("Failed to find sufficient version of minimap2");
}

pub fn check_for_samtools() {
check_for_external_command_presence("samtools", "which samtools")
check_for_external_command_presence_with_which("samtools")
.expect("Failed to find installed samtools");
default_version_check("samtools", "1.9", false, None)
.expect("Failed to find sufficient version of samtools");
}

pub fn check_for_strobealign() {
check_for_external_command_presence("strobealign", "which strobealign")
check_for_external_command_presence_with_which("strobealign")
.expect("Failed to find installed strobealign");
default_version_check("strobealign", "0.11.0", false, None)
.expect("Failed to find sufficient version of strobealign");
Expand Down

0 comments on commit 22fec64

Please sign in to comment.