From fe8c87456f8ce30dba3ae604b50797f609a8370e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9mence=20R=C3=A9da?= Date: Tue, 14 May 2024 16:06:08 +0000 Subject: [PATCH] bioconda recipe; fix str cast when profiles are user-defined --- bioconda-recipes-nordic/LICENSE | 21 +++++++ bioconda-recipes-nordic/build.sh | 23 ++++++++ bioconda-recipes-nordic/meta.yaml | 92 +++++++++++++++++++++++++++++++ src/NORDic/NORDic_NI/functions.py | 2 +- 4 files changed, 137 insertions(+), 1 deletion(-) create mode 100644 bioconda-recipes-nordic/LICENSE create mode 100644 bioconda-recipes-nordic/build.sh create mode 100644 bioconda-recipes-nordic/meta.yaml diff --git a/bioconda-recipes-nordic/LICENSE b/bioconda-recipes-nordic/LICENSE new file mode 100644 index 0000000..08f13e3 --- /dev/null +++ b/bioconda-recipes-nordic/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright © 2023 Clémence Réda + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/bioconda-recipes-nordic/build.sh b/bioconda-recipes-nordic/build.sh new file mode 100644 index 0000000..887d0d7 --- /dev/null +++ b/bioconda-recipes-nordic/build.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +cd ${SRC_DIR}"/MaBoSS-2.0/engine/src/" + +make install \ + CC="${CC}" \ + CXX="${CXX}" \ + CFLAGS="${CFLAGS}" \ + CXXFLAGS="${CXXFLAGS}" \ + LDFLAGS="${LDFLAGS}" \ + prefix="${PREFIX}" + +cd ${SRC_DIR}"/mpbn-3.3/" + +"${PYTHON}" -m pip install --no-deps --no-build-isolation . -vvv + +cd ${SRC_DIR}"/bonesis-0.5.7/" + +"${PYTHON}" -m pip install --no-deps --no-build-isolation . -vvv + +cd ${SRC_DIR}"/NORDic-2.4.4/" + +"${PYTHON}" -m pip install --no-deps --no-build-isolation . -vvv \ No newline at end of file diff --git a/bioconda-recipes-nordic/meta.yaml b/bioconda-recipes-nordic/meta.yaml new file mode 100644 index 0000000..7fe723c --- /dev/null +++ b/bioconda-recipes-nordic/meta.yaml @@ -0,0 +1,92 @@ +{% set name = "nordic" %} +{% set ucname = "NORDic" %} +{% set version = "2.4.4" %} + +package: + name: "{{ name|lower }}" + version: "{{ version }}" + +source: + - url: "https://github.com/sysbio-curie/MaBoSS-env-2.0/archive/refs/heads/master.tar.gz" + sha256: 5952813f3c38e10bbc2f0d4bbb91936bc738c47bcf9941da298cea3bfb753d19 + folder: "MaBoSS-2.0" + - url: "https://files.pythonhosted.org/packages/f8/ff/4b5fd3c1968c99d59972da395c926be65e601d7306602ec6cc39c418e24f/mpbn-3.3.tar.gz" + sha256: 8831531216d94616e7303925c4571bfc40f5d750b33b69d0155edc8404223831 + folder: "mpbn-3.3" + - url: "https://files.pythonhosted.org/packages/fb/c9/8fa247a95e6d6b7c650f2d4f879e6027fbb9eeca2aaba8d97f999bfadcfd/bonesis-0.5.7.tar.gz" + sha256: 0ccef4daa089347f7fd4ac8355f7ab3a8eecf63757e6bf000cc66b7c54bfdb0a + folder: "bonesis-0.5.7" + - url: "https://files.pythonhosted.org/packages/f3/9b/817e2004a1e7f798b5f361dc04d28d7b99657cc469f26abde2d9095fd1e4/{{ ucname }}-{{ version }}.tar.gz" + sha256: 01a5d9fbc95c603e46e916a734dd6eecdc20dff914d36c91009337d62488d525 + folder: "{{ ucname }}-{{ version }}" + +build: + number: 0 + skip: True # [py < 38] + run_exports: + - {{ pin_subpackage(name, max_pin="x") }} + +requirements: + build: + - {{ compiler('c') }} + - {{ compiler('cxx') }} + - flex + - bison + - make + host: + - python + - pip + - clingo >=5.6.1 + - cmappy + - scikit-learn + - graphviz + - matplotlib-base + - numpy >=1.22.4 + - omnipath >=1.0.6 + - openpyxl >=3.0.10 + - pandas >=1.5.1 + - qnorm >=0.5.1 + - quadprog >=0.1.11 + - scipy >=1.6.2 + - seaborn >=0.12.1 + - tqdm >=4.62.3 + run: + - python + - clingo >=5.6.1 + - cmappy + - scikit-learn + - graphviz + - matplotlib-base + - numpy >=1.22.4 + - omnipath >=1.0.6 + - openpyxl >=3.0.10 + - pandas >=1.5.1 + - qnorm >=0.5.1 + - quadprog >=0.1.11 + - scipy >=1.6.2 + - seaborn >=0.12.1 + - tqdm >=4.62.3 + +test: + imports: + - NORDic + - NORDic.NORDic_DR + - NORDic.NORDic_DS + - NORDic.NORDic_NI + - NORDic.NORDic_PMR + - NORDic.UTILS + +about: + home: "https://github.com/clreda/NORDic" + license: MIT + license_family: MIT + license_file: LICENSE + summary: "NORDic: a Network-Oriented package for the Repurposing of Drugs" + doc_url: "https://github.com/clreda/NORDic/blob/main/README.md" + dev_url: "https://github.com/clreda/NORDic" + +extra: + recipe-maintainers: + - clreda + identifiers: + - doi:10.5281/zenodo.7239047 diff --git a/src/NORDic/NORDic_NI/functions.py b/src/NORDic/NORDic_NI/functions.py index 0243459..a7f6197 100644 --- a/src/NORDic/NORDic_NI/functions.py +++ b/src/NORDic/NORDic_NI/functions.py @@ -377,7 +377,7 @@ def solution_generation(file_folder, taxon_id, path_to_genes=None, disgenet_args profiles = pd.read_csv(profiles_fname, index_col=0, low_memory=False) if (not pd.isnull(profiles.values).all()): - nconds = len(set(["_".join([profiles.loc[v][c] for v in ["perturbed","perturbation","cell_line"]]) for c in profiles.columns])) + nconds = len(set(["_".join([str(profiles.loc[v][c]) for v in ["perturbed","perturbation","cell_line"]]) for c in profiles.columns])) else: nconds = 0 ngenes = len([p for p in profiles.index if (p not in add_rows_profiles)])