From df85d83b0c8180bdc06d41c53c89410aa096de21 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Fri, 25 Oct 2024 09:34:35 +0200 Subject: [PATCH 1/8] bump to 2.1 and add missing requirement --- recipes/phabox/meta.yaml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/recipes/phabox/meta.yaml b/recipes/phabox/meta.yaml index 014462e5a79f6..12d98e0845004 100644 --- a/recipes/phabox/meta.yaml +++ b/recipes/phabox/meta.yaml @@ -1,5 +1,5 @@ {% set name = "PhaBOX" %} -{% set version = "2.0.0" %} +{% set version = "2.1.0" %} package: name: "{{ name|lower }}" @@ -7,7 +7,7 @@ package: source: url: https://github.com/KennthShang/{{ name }}/archive/refs/tags/v{{ version }}.tar.gz - sha256: 3e120da4b6c37d1ae9f7291382365012a4efa0c4e704068c1ecd897e5fd8178a + sha256: 0ffe4da03ccc2aac77c17866033ce513f72a5ecdf9df108abbcdbfced438b04c patches: - setup.patch @@ -26,15 +26,19 @@ requirements: run: - python - biopython >=1.84 + - datasets >=3 + - kcounter >=0.1.1 + - fasttree >=2.1.11 + - mafft >=7.525 - networkx >=3.4 - numpy >=2 - pandas >=2 - - pprodigal >=1 - - scipy >=1.14 + - prodigal-gv >=2.11.0 + - pyarrow >=17 - pytorch >=2.4 + - scipy >=1.14 + - seaborn >=0.13.2 - transformers >=4.40 - - datasets >=3 - - pyarrow >=17 test: commands: From 5dfd510d116c9e3ae2b7b739bfc8f8e99a6b3ca0 Mon Sep 17 00:00:00 2001 From: Joshua Zhuang <71105179+mencian@users.noreply.github.com> Date: Fri, 25 Oct 2024 03:28:11 -0500 Subject: [PATCH 2/8] loosen dependencies --- recipes/phabox/meta.yaml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/recipes/phabox/meta.yaml b/recipes/phabox/meta.yaml index 12d98e0845004..a48cf0ea11d84 100644 --- a/recipes/phabox/meta.yaml +++ b/recipes/phabox/meta.yaml @@ -14,31 +14,33 @@ source: build: number: 0 noarch: python - script: "{{ PYTHON }} -m pip install . --no-deps --no-build-isolation -vvv" + script: "{{ PYTHON }} -m pip install . --no-deps --no-build-isolation --no-cache-dir -vvv" + entry_points: + - phabox2 = "phabox2.phabox2:main" run_exports: - {{ pin_subpackage('phabox', max_pin="x.x") }} requirements: host: - pip - - python + - python >=3.8 - setuptools run: - - python + - python >=3.8 - biopython >=1.84 - datasets >=3 - kcounter >=0.1.1 - fasttree >=2.1.11 - mafft >=7.525 - networkx >=3.4 - - numpy >=2 + - numpy >=1.26 - pandas >=2 - prodigal-gv >=2.11.0 - - pyarrow >=17 + - pyarrow >=16 - pytorch >=2.4 - scipy >=1.14 - - seaborn >=0.13.2 - - transformers >=4.40 + - seaborn-base >=0.13.2 + - transformers >=4 test: commands: @@ -52,7 +54,9 @@ about: home: https://github.com/KennthShang/PhaBOX license: AFL license_file: LICENSE.md - summary: Phage BOX is a Python library for phage-related tasks + summary: "Phage BOX is a Python library for phage-related tasks." + dev_url: https://github.com/KennthShang/PhaBOX + doc_url: https://phage.ee.cityu.edu.hk extra: recipe-maintainers: From 7db5e48a8e4d490055837b9d7a8a15cfed976953 Mon Sep 17 00:00:00 2001 From: Joshua Zhuang <71105179+mencian@users.noreply.github.com> Date: Fri, 25 Oct 2024 03:48:13 -0500 Subject: [PATCH 3/8] 2.1.0 release has no 'v' preceding version in source URL --- recipes/phabox/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/phabox/meta.yaml b/recipes/phabox/meta.yaml index a48cf0ea11d84..996128e244477 100644 --- a/recipes/phabox/meta.yaml +++ b/recipes/phabox/meta.yaml @@ -6,7 +6,7 @@ package: version: "{{ version }}" source: - url: https://github.com/KennthShang/{{ name }}/archive/refs/tags/v{{ version }}.tar.gz + url: https://github.com/KennthShang/{{ name }}/archive/refs/tags/{{ version }}.tar.gz sha256: 0ffe4da03ccc2aac77c17866033ce513f72a5ecdf9df108abbcdbfced438b04c patches: - setup.patch From b60eb816c6a34f2e13b905f8eb50833c2071d3bf Mon Sep 17 00:00:00 2001 From: Joshua Zhuang <71105179+mencian@users.noreply.github.com> Date: Fri, 25 Oct 2024 03:49:58 -0500 Subject: [PATCH 4/8] edit tests --- recipes/phabox/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/phabox/meta.yaml b/recipes/phabox/meta.yaml index 996128e244477..cef289df86f0a 100644 --- a/recipes/phabox/meta.yaml +++ b/recipes/phabox/meta.yaml @@ -44,7 +44,7 @@ requirements: test: commands: - - phabox --help + - phabox2 --help - Cherry_single --help - PhaGCN_single --help - PhaMer_single --help From d266c4ae221065ed75471400ea014d7c82d7648b Mon Sep 17 00:00:00 2001 From: Joshua Zhuang <71105179+mencian@users.noreply.github.com> Date: Fri, 25 Oct 2024 04:05:53 -0500 Subject: [PATCH 5/8] try without patch --- recipes/phabox/meta.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/phabox/meta.yaml b/recipes/phabox/meta.yaml index cef289df86f0a..dc06c646c633e 100644 --- a/recipes/phabox/meta.yaml +++ b/recipes/phabox/meta.yaml @@ -8,8 +8,8 @@ package: source: url: https://github.com/KennthShang/{{ name }}/archive/refs/tags/{{ version }}.tar.gz sha256: 0ffe4da03ccc2aac77c17866033ce513f72a5ecdf9df108abbcdbfced438b04c - patches: - - setup.patch + #patches: + #- setup.patch build: number: 0 From c3bbc019dfd9c2150026576a0c8bd8f570241bce Mon Sep 17 00:00:00 2001 From: Joshua Zhuang <71105179+mencian@users.noreply.github.com> Date: Fri, 25 Oct 2024 04:43:02 -0500 Subject: [PATCH 6/8] clean up meta.yaml --- recipes/phabox/meta.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/recipes/phabox/meta.yaml b/recipes/phabox/meta.yaml index dc06c646c633e..6147ee474f71d 100644 --- a/recipes/phabox/meta.yaml +++ b/recipes/phabox/meta.yaml @@ -8,8 +8,6 @@ package: source: url: https://github.com/KennthShang/{{ name }}/archive/refs/tags/{{ version }}.tar.gz sha256: 0ffe4da03ccc2aac77c17866033ce513f72a5ecdf9df108abbcdbfced438b04c - #patches: - #- setup.patch build: number: 0 From bde4126d5e24a0dcf35499a17118f7cd20ad35c4 Mon Sep 17 00:00:00 2001 From: M Bernt Date: Fri, 25 Oct 2024 12:07:56 +0200 Subject: [PATCH 7/8] Remove quotes for entry point --- recipes/phabox/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/phabox/meta.yaml b/recipes/phabox/meta.yaml index 6147ee474f71d..7c7d92df2c627 100644 --- a/recipes/phabox/meta.yaml +++ b/recipes/phabox/meta.yaml @@ -14,7 +14,7 @@ build: noarch: python script: "{{ PYTHON }} -m pip install . --no-deps --no-build-isolation --no-cache-dir -vvv" entry_points: - - phabox2 = "phabox2.phabox2:main" + - phabox2 = phabox2.phabox2:main run_exports: - {{ pin_subpackage('phabox', max_pin="x.x") }} From 8a60014ce1a7fe31544c2587222c90613c622b74 Mon Sep 17 00:00:00 2001 From: mencian Date: Fri, 25 Oct 2024 05:56:17 -0500 Subject: [PATCH 8/8] edit tests --- recipes/phabox/meta.yaml | 18 +-- recipes/phabox/setup.patch | 229 ------------------------------------- 2 files changed, 9 insertions(+), 238 deletions(-) delete mode 100644 recipes/phabox/setup.patch diff --git a/recipes/phabox/meta.yaml b/recipes/phabox/meta.yaml index 7c7d92df2c627..33d901868c12f 100644 --- a/recipes/phabox/meta.yaml +++ b/recipes/phabox/meta.yaml @@ -43,19 +43,19 @@ requirements: test: commands: - phabox2 --help - - Cherry_single --help - - PhaGCN_single --help - - PhaMer_single --help - - PhaTYP_single --help about: - home: https://github.com/KennthShang/PhaBOX - license: AFL - license_file: LICENSE.md + home: "https://phage.ee.cityu.edu.hk" + license: "AFL-3.0" + license_family: OTHER + license_file: "LICENSE.md" summary: "Phage BOX is a Python library for phage-related tasks." - dev_url: https://github.com/KennthShang/PhaBOX - doc_url: https://phage.ee.cityu.edu.hk + dev_url: "https://github.com/KennthShang/PhaBOX" + doc_url: "https://github.com/KennthShang/PhaBOX/wiki" extra: recipe-maintainers: - bernt-matthias + identifiers: + - doi:10.1093/bioadv/vbad101 + - biotools:phabox diff --git a/recipes/phabox/setup.patch b/recipes/phabox/setup.patch deleted file mode 100644 index b5213da9b8f34..0000000000000 --- a/recipes/phabox/setup.patch +++ /dev/null @@ -1,229 +0,0 @@ -diff -ruN PhaBOX-1.0.0-org/Cherry_single.py PhaBOX-1.0.0/Cherry_single.py ---- PhaBOX-1.0.0-org/Cherry_single.py 2024-09-30 10:20:05.496290778 +0200 -+++ PhaBOX-1.0.0/Cherry_single.py 2024-09-30 13:26:23.735605652 +0200 -@@ -16,21 +16,21 @@ - from torch import optim - from torch.nn import functional as F - --from scripts.ulity import * --from scripts.preprocessing import * --from scripts.cnnscript import * -+from phabox.scripts.ulity import * -+from phabox.scripts.preprocessing import * -+from phabox.scripts.cnnscript import * - from shutil import which - from collections import Counter - from Bio import SeqIO - from Bio.SeqRecord import SeqRecord - from Bio.Blast.Applications import NcbiblastnCommandline --from models.phamer import Transformer --from models.CAPCNN import WCNN --from models.PhaGCN import GCN --from models import Cherry --from draw import draw_network, drop_network -+from phabox.models.phamer import Transformer -+from phabox.models.CAPCNN import WCNN -+from phabox.models.PhaGCN import GCN -+from phabox.models import Cherry -+from phabox.draw import draw_network, drop_network - from scipy.special import softmax --from scripts.data import load_data, preprocess_features, preprocess_adj, sample_mask -+from phabox.scripts.data import load_data, preprocess_features, preprocess_adj, sample_mask - - - -diff -ruN PhaBOX-1.0.0-org/draw.py PhaBOX-1.0.0/draw.py ---- PhaBOX-1.0.0-org/draw.py 2024-09-30 10:20:05.500290882 +0200 -+++ PhaBOX-1.0.0/draw.py 2024-09-30 13:27:20.231425936 +0200 -@@ -4,8 +4,8 @@ - import numpy as np - import argparse - import subprocess --from scripts.ulity import * --from scripts.preprocessing import * -+from phabox.scripts.ulity import * -+from phabox.scripts.preprocessing import * - import math - import os - import pandas as pd -diff -ruN PhaBOX-1.0.0-org/main.py PhaBOX-1.0.0/main.py ---- PhaBOX-1.0.0-org/main.py 2024-09-30 10:20:05.500290882 +0200 -+++ PhaBOX-1.0.0/main.py 2024-09-30 13:27:33.651385105 +0200 -@@ -16,22 +16,22 @@ - from torch import optim - from torch.nn import functional as F - --from scripts.ulity import * --from scripts.preprocessing import * --from scripts.cnnscript import * -+from phabox.scripts.ulity import * -+from phabox.scripts.preprocessing import * -+from phabox.scripts.cnnscript import * - from shutil import which - from collections import Counter - from Bio import SeqIO - from Bio.SeqRecord import SeqRecord - from Bio.Blast.Applications import NcbiblastnCommandline --from models.phamer import Transformer --from models.CAPCNN import WCNN --from models.PhaGCN import GCN --from models import Cherry --from draw import draw_network, drop_network -+from phabox.models.phamer import Transformer -+from phabox.models.CAPCNN import WCNN -+from phabox.models.PhaGCN import GCN -+from phabox.models import Cherry -+from phabox.draw import draw_network, drop_network - from collections import Counter - from scipy.special import softmax --from scripts.data import load_data, preprocess_features, preprocess_adj, sample_mask -+from phabox.scripts.data import load_data, preprocess_features, preprocess_adj, sample_mask - - - -diff -ruN PhaBOX-1.0.0-org/PhaGCN_single.py PhaBOX-1.0.0/PhaGCN_single.py ---- PhaBOX-1.0.0-org/PhaGCN_single.py 2024-09-30 10:20:05.496290778 +0200 -+++ PhaBOX-1.0.0/PhaGCN_single.py 2024-09-30 13:26:46.099532952 +0200 -@@ -13,21 +13,21 @@ - import scipy.sparse as sparse - - --from scripts.ulity import * --from scripts.preprocessing import * --from scripts.cnnscript import * -+from phabox.scripts.ulity import * -+from phabox.scripts.preprocessing import * -+from phabox.scripts.cnnscript import * - from shutil import which - from collections import Counter - from Bio import SeqIO - from Bio.SeqRecord import SeqRecord - from Bio.Blast.Applications import NcbiblastnCommandline --from models.phamer import Transformer --from models.CAPCNN import WCNN --from models.PhaGCN import GCN --from models import Cherry --from draw import draw_network, drop_network -+from phabox.models.phamer import Transformer -+from phabox.models.CAPCNN import WCNN -+from phabox.models.PhaGCN import GCN -+from phabox.models import Cherry -+from phabox.draw import draw_network, drop_network - from scipy.special import softmax --from scripts.data import load_data, preprocess_features, preprocess_adj, sample_mask -+from phabox.scripts.data import load_data, preprocess_features, preprocess_adj, sample_mask - - from torch import nn - from torch import optim -diff -ruN PhaBOX-1.0.0-org/PhaMer_single.py PhaBOX-1.0.0/PhaMer_single.py ---- PhaBOX-1.0.0-org/PhaMer_single.py 2024-09-30 10:20:05.500290882 +0200 -+++ PhaBOX-1.0.0/PhaMer_single.py 2024-09-30 13:26:53.231510206 +0200 -@@ -16,20 +16,20 @@ - from torch import optim - from torch.nn import functional as F - --from scripts.ulity import * --from scripts.preprocessing import * --from scripts.cnnscript import * -+from phabox.scripts.ulity import * -+from phabox.scripts.preprocessing import * -+from phabox.scripts.cnnscript import * - from shutil import which - from collections import Counter - from Bio import SeqIO - from Bio.SeqRecord import SeqRecord - from Bio.Blast.Applications import NcbiblastnCommandline --from models.phamer import Transformer --from models.CAPCNN import WCNN --from models.PhaGCN import GCN --from models import Cherry -+from phabox.models.phamer import Transformer -+from phabox.models.CAPCNN import WCNN -+from phabox.models.PhaGCN import GCN -+from phabox.models import Cherry - from scipy.special import softmax --from scripts.data import load_data, preprocess_features, preprocess_adj, sample_mask -+from phabox.scripts.data import load_data, preprocess_features, preprocess_adj, sample_mask - - - -diff -ruN PhaBOX-1.0.0-org/PhaTYP_single.py PhaBOX-1.0.0/PhaTYP_single.py ---- PhaBOX-1.0.0-org/PhaTYP_single.py 2024-09-30 10:20:05.500290882 +0200 -+++ PhaBOX-1.0.0/PhaTYP_single.py 2024-09-30 13:27:03.755477016 +0200 -@@ -16,20 +16,20 @@ - from torch import optim - from torch.nn import functional as F - --from scripts.ulity import * --from scripts.preprocessing import * --from scripts.cnnscript import * -+from phabox.scripts.ulity import * -+from phabox.scripts.preprocessing import * -+from phabox.scripts.cnnscript import * - from shutil import which - from collections import Counter - from Bio import SeqIO - from Bio.SeqRecord import SeqRecord - from Bio.Blast.Applications import NcbiblastnCommandline --from models.phamer import Transformer --from models.CAPCNN import WCNN --from models.PhaGCN import GCN --from models import Cherry -+from phabox.models.phamer import Transformer -+from phabox.models.CAPCNN import WCNN -+from phabox.models.PhaGCN import GCN -+from phabox.models import Cherry - from scipy.special import softmax --from scripts.data import load_data, preprocess_features, preprocess_adj, sample_mask -+from phabox.scripts.data import load_data, preprocess_features, preprocess_adj, sample_mask - - - -diff -ruN PhaBOX-1.0.0-org/scripts/cnnscript.py PhaBOX-1.0.0/scripts/cnnscript.py ---- PhaBOX-1.0.0-org/scripts/cnnscript.py 2024-09-30 10:20:05.608293722 +0200 -+++ PhaBOX-1.0.0/scripts/cnnscript.py 2024-09-30 13:25:46.367731972 +0200 -@@ -3,7 +3,7 @@ - import numpy as np - import torch - import torch.utils.data as Data --from models.CAPCNN import WCNN -+from phabox.models.CAPCNN import WCNN - from Bio import SeqIO - from Bio.SeqRecord import SeqRecord - from torch import nn -diff -ruN PhaBOX-1.0.0-org/scripts/data.py PhaBOX-1.0.0/scripts/data.py ---- PhaBOX-1.0.0-org/scripts/data.py 2024-09-30 10:20:05.608293722 +0200 -+++ PhaBOX-1.0.0/scripts/data.py 2024-09-30 13:26:08.807655370 +0200 -@@ -2,6 +2,7 @@ - import pickle as pkl - import networkx as nx - import scipy.sparse as sp -+from scipy.sparse.linalg import eigsh - import sys - - -diff -ruN PhaBOX-1.0.0-org/setup.py PhaBOX-1.0.0/setup.py ---- PhaBOX-1.0.0-org/setup.py 2024-09-30 10:20:05.500290882 +0200 -+++ PhaBOX-1.0.0/setup.py 2024-09-30 10:21:12.297733200 +0200 -@@ -3,7 +3,20 @@ - setup( - name='phabox', - version='1.0', -- packages=find_packages(), -+ packages=["phabox"], -+ package_dir={'phabox': '.'}, -+ package_data={ -+ '': ['scripts/*.py', 'models/*.py', 'GTDB/*.py'] -+ }, -+ entry_points={ -+ 'console_scripts': [ -+ 'phabox=phabox.main:main', # Allows running the script with `phabox` command -+ 'Cherry_single=phabox.Cherry_single:main', -+ 'PhaGCN_single=phabox.PhaGCN_single:main', -+ 'PhaMer_single=phabox.PhaMer_single:main', -+ 'PhaTYP_single=phabox.PhaTYP_single:main', -+ ] -+ }, - install_requires=[ - 'numpy==1.21.2', - 'pandas==1.3.4',