From 85e37bb44f9ab2e31eb3ea705fc2b5d66ba182e4 Mon Sep 17 00:00:00 2001 From: Jon Alm Eriksen Date: Fri, 11 Oct 2024 12:14:13 +0200 Subject: [PATCH 1/8] add Artifact.toml generating script and Artifact.toml for blast 2.16.0 --- .gitignore | 1 + Artifacts.toml | 42 +++++++++++++++++++++++++++++++++++ dev/generate_artifact_toml.jl | 23 +++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 Artifacts.toml create mode 100644 dev/generate_artifact_toml.jl diff --git a/.gitignore b/.gitignore index abc5673..0118731 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /docs/build/ .CondaPkg test/example_files/dna2.fasta.* +.DS_Store diff --git a/Artifacts.toml b/Artifacts.toml new file mode 100644 index 0000000..16b098d --- /dev/null +++ b/Artifacts.toml @@ -0,0 +1,42 @@ +[[ncbi-blast]] +arch = "aarch64" +git-tree-sha1 = "0406b91031ce302fa9117606d007d04635279fef" +os = "macos" + + [[ncbi-blast.download]] + sha256 = "e8da4f34b0421da051b1c2d9e5f8e1e43bf76e38cf9361a1dbe2fbc44b6224db" + url = "https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.16.0/ncbi-blast-2.16.0+-aarch64-macosx.tar.gz" +[[ncbi-blast]] +arch = "x86_64" +git-tree-sha1 = "690abc170201bc029d0e7386da0791d7a76d98ff" +os = "macos" + + [[ncbi-blast.download]] + sha256 = "7eee1e7720f5daaf06e39d9c92b125d9072de7eb81f499c005dedb08b932324c" + url = "https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.16.0/ncbi-blast-2.16.0+-x64-macosx.tar.gz" +[[ncbi-blast]] +arch = "aarch64" +git-tree-sha1 = "39394a0d1959ae677fde91f3148e1a6bc94f11eb" +libc = "glibc" +os = "linux" + + [[ncbi-blast.download]] + sha256 = "d447a232ed3c47d1a5abca91932e0e4d3e6540f2c970cee26aa52b994392e0c2" + url = "https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.16.0/ncbi-blast-2.16.0+-aarch64-linux.tar.gz" +[[ncbi-blast]] +arch = "x86_64" +git-tree-sha1 = "401cfe44557a4063e16671896f0834e2648b67af" +libc = "glibc" +os = "linux" + + [[ncbi-blast.download]] + sha256 = "b0b13098c901d23b324ad1700e7471bb7408a7f7f517d74d5faad711be76e8f4" + url = "https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.16.0/ncbi-blast-2.16.0+-x64-linux.tar.gz" +[[ncbi-blast]] +arch = "x86_64" +git-tree-sha1 = "f8f04f978f874b0a2a50ba3ebcfe97f29eaa740d" +os = "windows" + + [[ncbi-blast.download]] + sha256 = "3b6f27a72e9a875f1c02119704775a8e04ae97b5e4a148b560f9be9acd39e943" + url = "https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.16.0/ncbi-blast-2.16.0+-x64-win64.tar.gz" diff --git a/dev/generate_artifact_toml.jl b/dev/generate_artifact_toml.jl new file mode 100644 index 0000000..17ebdc8 --- /dev/null +++ b/dev/generate_artifact_toml.jl @@ -0,0 +1,23 @@ +using Pkg +Pkg.activate(@__DIR__) + +## + +using Pkg: BinaryPlatforms +using ArtifactUtils: add_artifact! + +blast_version = "2.16.0" +url_common = "https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/$(blast_version)/ncbi-blast-$(blast_version)+-" +platform_url_pairs = [ + BinaryPlatforms.MacOS(:aarch64) => "$(url_common)aarch64-macosx.tar.gz", + BinaryPlatforms.MacOS(:x86_64) => "$(url_common)x64-macosx.tar.gz", + BinaryPlatforms.Linux(:aarch64) => "$(url_common)aarch64-linux.tar.gz", + BinaryPlatforms.Linux(:x86_64) => "$(url_common)x64-linux.tar.gz", + BinaryPlatforms.Windows(:x86_64) => "$(url_common)x64-win64.tar.gz" +] + +foreach(platform_url_pairs) do (platform, url) + add_artifact!("Artifacts.toml", "ncbi-blast", url; platform, force=true) +end + +## From 92f59781660d926ac1cd44cd42c0e29ef8b2ec46 Mon Sep 17 00:00:00 2001 From: Jon Alm Eriksen Date: Fri, 11 Oct 2024 12:15:42 +0200 Subject: [PATCH 2/8] remove from generate_artifact script --- dev/generate_artifact_toml.jl | 5 ----- 1 file changed, 5 deletions(-) diff --git a/dev/generate_artifact_toml.jl b/dev/generate_artifact_toml.jl index 17ebdc8..488a184 100644 --- a/dev/generate_artifact_toml.jl +++ b/dev/generate_artifact_toml.jl @@ -1,8 +1,3 @@ -using Pkg -Pkg.activate(@__DIR__) - -## - using Pkg: BinaryPlatforms using ArtifactUtils: add_artifact! From 6b20baf9d3b239d67ddfc6053991f51bee95f78e Mon Sep 17 00:00:00 2001 From: Jon Alm Eriksen Date: Fri, 11 Oct 2024 13:09:22 +0200 Subject: [PATCH 3/8] use artifact path and remove condapkg --- CondaPkg.toml | 3 --- Project.toml | 4 ++-- src/NCBIBlast.jl | 47 +++++++++++++++++++++++------------------------ 3 files changed, 25 insertions(+), 29 deletions(-) delete mode 100644 CondaPkg.toml diff --git a/CondaPkg.toml b/CondaPkg.toml deleted file mode 100644 index 40086da..0000000 --- a/CondaPkg.toml +++ /dev/null @@ -1,3 +0,0 @@ - -[deps.blast] -channel = "bioconda" diff --git a/Project.toml b/Project.toml index b0c628f..2b43811 100644 --- a/Project.toml +++ b/Project.toml @@ -4,8 +4,8 @@ authors = ["Kevin Bonham and contributors"] version = "0.1.0" [deps] -CondaPkg = "992eb4ea-22a4-4c89-a5bb-47a3300528ab" +Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" [compat] -CondaPkg = "0.2.23" +Artifacts = "1.11.0" julia = "1.10" diff --git a/src/NCBIBlast.jl b/src/NCBIBlast.jl index 0b7dcfc..905a8ec 100644 --- a/src/NCBIBlast.jl +++ b/src/NCBIBlast.jl @@ -8,6 +8,17 @@ export blastn, makeblastdb using CondaPkg +using Artifacts: @artifact_str + +const BLAST_VERSION = "2.16.0" +const BIN_PATH = joinpath(artifact"ncbi-blast", "ncbi-blast-$(BLAST_VERSION)+", "bin") + +_blastn_exe() = joinpath(BIN_PATH, "blastn") +_blastx_exe() = joinpath(BIN_PATH, "blastx") +_blastp_exe() = joinpath(BIN_PATH, "blastp") +_tblastn_exe() = joinpath(BIN_PATH, "tblastn") +_tblastx_exe() = joinpath(BIN_PATH, "tblastx") +_makeblastdb_exe() = joinpath(BIN_PATH, "makeblastdb") function add_cli_kwargs!(cmd::Vector{String}, kwargs) for (key,val) in pairs(kwargs) @@ -85,11 +96,9 @@ Use '-help' to print detailed descriptions of command line arguments ``` """ function blastn(stdin = nothing; stdout=stdout, kwargs...) - cmd = ["blastn"] + cmd = [_blastn_exe()] add_cli_kwargs!(cmd, kwargs) - CondaPkg.withenv() do - run(pipeline(Cmd(cmd); stdout, stdin)) - end + run(pipeline(Cmd(cmd); stdout, stdin)) end @@ -141,11 +150,9 @@ DESCRIPTION ``` """ function blastp(stdin = nothing; stdout=stdout, kwargs...) - cmd = ["blastp"] + cmd = [_blastp_exe()] add_cli_kwargs!(cmd, kwargs) - CondaPkg.withenv() do - run(pipeline(Cmd(cmd); stdout, stdin)) - end + run(pipeline(Cmd(cmd); stdout, stdin)) end """ @@ -199,11 +206,9 @@ Use '-help' to print detailed descriptions of command line arguments ``` """ function blastx(stdin = nothing; stdout=stdout, kwargs...) - cmd = ["blastx"] + cmd = [_blastx_exe()] add_cli_kwargs!(cmd, kwargs) - CondaPkg.withenv() do - run(pipeline(Cmd(cmd); stdin, stdout)) - end + run(pipeline(Cmd(cmd); stdin, stdout)) end @@ -258,11 +263,9 @@ Use '-help' to print detailed descriptions of command line arguments ``` """ function tblastn(stdin = nothing; stdout=stdout, kwargs...) - cmd = ["tblastn"] + cmd = [_tblastn_exe()] add_cli_kwargs!(cmd, kwargs) - CondaPkg.withenv() do - run(pipeline(Cmd(cmd); stdout, stdin)) - end + run(pipeline(Cmd(cmd); stdout, stdin)) end """ @@ -311,11 +314,9 @@ Use '-help' to print detailed descriptions of command line arguments ``` """ function tblastx(stdin = nothing; stdout=stdout, kwargs...) - cmd = ["tblastx"] + cmd = [_tblastx_exe()] add_cli_kwargs!(cmd, kwargs) - CondaPkg.withenv() do - run(pipeline(Cmd(cmd); stdout, stdin)) - end + run(pipeline(Cmd(cmd); stdout, stdin)) end @@ -345,11 +346,9 @@ Use '-help' to print detailed descriptions of command line arguments ``` """ function makeblastdb(; kwargs...) - cmd = ["makeblastdb"] + cmd = [_makeblastdb_exe()] add_cli_kwargs!(cmd, kwargs) - CondaPkg.withenv() do - run(Cmd(cmd)) - end + run(Cmd(cmd)) end end From 3b3abe798490d94853a5756e179fc77b22a3ec9f Mon Sep 17 00:00:00 2001 From: Jon Alm Eriksen Date: Fri, 11 Oct 2024 13:12:18 +0200 Subject: [PATCH 4/8] bump --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 2b43811..9eacad8 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "NCBIBlast" uuid = "dcaf3faf-48b5-45a7-abb1-fcfd75344536" authors = ["Kevin Bonham and contributors"] -version = "0.1.0" +version = "0.2.0" [deps] Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" From 84635bea773fe835be5852d559b85dbb8ab3d853 Mon Sep 17 00:00:00 2001 From: Jon Alm Eriksen Date: Fri, 11 Oct 2024 13:13:48 +0200 Subject: [PATCH 5/8] remove using CondaPkg --- src/NCBIBlast.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/src/NCBIBlast.jl b/src/NCBIBlast.jl index 905a8ec..de3b75b 100644 --- a/src/NCBIBlast.jl +++ b/src/NCBIBlast.jl @@ -7,7 +7,6 @@ export blastn, tblastx, makeblastdb -using CondaPkg using Artifacts: @artifact_str const BLAST_VERSION = "2.16.0" From 5a421757f434d40f069f23e1aac5abe1ef56148c Mon Sep 17 00:00:00 2001 From: Jon Alm Eriksen Date: Fri, 11 Oct 2024 23:04:27 +0200 Subject: [PATCH 6/8] use Pkg instead of Artifacts directly and make sure it runs on 1.10 --- .gitignore | 1 + Project.toml | 4 ++-- src/NCBIBlast.jl | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 0118731..234971e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ .CondaPkg test/example_files/dna2.fasta.* .DS_Store +Manifest* diff --git a/Project.toml b/Project.toml index 9eacad8..2573f6d 100644 --- a/Project.toml +++ b/Project.toml @@ -4,8 +4,8 @@ authors = ["Kevin Bonham and contributors"] version = "0.2.0" [deps] -Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" [compat] -Artifacts = "1.11.0" +Pkg = "1.10.0" julia = "1.10" diff --git a/src/NCBIBlast.jl b/src/NCBIBlast.jl index de3b75b..d712941 100644 --- a/src/NCBIBlast.jl +++ b/src/NCBIBlast.jl @@ -7,7 +7,7 @@ export blastn, tblastx, makeblastdb -using Artifacts: @artifact_str +using Pkg.Artifacts: @artifact_str const BLAST_VERSION = "2.16.0" const BIN_PATH = joinpath(artifact"ncbi-blast", "ncbi-blast-$(BLAST_VERSION)+", "bin") From 628be1bbd74da13a578765015af9e773d859c93c Mon Sep 17 00:00:00 2001 From: Jon Alm Eriksen Date: Fri, 11 Oct 2024 23:23:15 +0200 Subject: [PATCH 7/8] try test windows CI --- .github/workflows/CI.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2170bbb..2ffd06e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -27,8 +27,11 @@ jobs: - 'nightly' os: - ubuntu-latest + - windows-latest + - macOS-latest arch: - x64 + - x86 steps: - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v2 From 3f7ba3c705935541475108f1fecb86473fecea16 Mon Sep 17 00:00:00 2001 From: Jon Alm Eriksen Date: Fri, 11 Oct 2024 23:36:24 +0200 Subject: [PATCH 8/8] remove x86 from CI --- .github/workflows/CI.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2ffd06e..02a3a87 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -31,7 +31,6 @@ jobs: - macOS-latest arch: - x64 - - x86 steps: - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v2