From 13f78e318b1d84d3251216a63aee12cf54d31da0 Mon Sep 17 00:00:00 2001 From: muppi1993 Date: Fri, 26 Aug 2022 15:04:12 +0100 Subject: [PATCH 01/11] change manifest to include microreact.pkl --- MANIFEST.in | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST.in b/MANIFEST.in index 4e5b847c..c695b8ff 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,6 @@ recursive-include scripts *.py recursive-include PopPUNK/data *.gz +recursive-include PopPUNK/data *.pkl recursive-include vendor * recursive-include src * include CMakeLists.txt From 9cc2df269c509bf47d507a9950f02719425c9d80 Mon Sep 17 00:00:00 2001 From: muppi1993 Date: Fri, 26 Aug 2022 15:05:01 +0100 Subject: [PATCH 02/11] remove condition to prevent UnboundLocalError --- PopPUNK/visualise.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PopPUNK/visualise.py b/PopPUNK/visualise.py index 0237efc4..58915733 100644 --- a/PopPUNK/visualise.py +++ b/PopPUNK/visualise.py @@ -290,7 +290,7 @@ def generate_visualisations(query_db, combined_seq = rlist # Fill in qq-distances if required - if self == False and tree != "none": + if self == False: sys.stderr.write("Note: Distances in " + distances + " are from assign mode\n" "Note: Distance will be extended to full all-vs-all distances\n" "Note: Re-run poppunk_assign with --update-db to avoid this\n") From 5febc24dd944a21a0a4f1b7ce7677d10b84e005d Mon Sep 17 00:00:00 2001 From: muppi1993 Date: Wed, 31 Aug 2022 13:42:58 +0100 Subject: [PATCH 03/11] add dependencies to setup.py --- setup.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/setup.py b/setup.py index 2519ef45..3dad2af6 100755 --- a/setup.py +++ b/setup.py @@ -103,6 +103,19 @@ def build_extension(self, ext): 'Programming Language :: Python :: 3.8', ], python_requires='>=3.8.0', + install_requires=['biopython', + 'h5py', + 'hdbscan', + 'matplotlib', + # 'mandrake', #uncomment when on PyPI + 'networkx', + 'pandas', + 'pp-sketchlib', + 'requests', + 'scikit-learn', + 'tqdm', + 'treeswift', + ], keywords='bacteria genomics population-genetics k-mer', packages=['PopPUNK'], entry_points={ From 70b2d3e219cf37af4c1835a3fb6c2da63573d5f3 Mon Sep 17 00:00:00 2001 From: muppi1993 Date: Wed, 31 Aug 2022 13:54:48 +0100 Subject: [PATCH 04/11] install requirements automatically via pip --- docker2/Dockerfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/docker2/Dockerfile b/docker2/Dockerfile index 9f895932..796e7527 100644 --- a/docker2/Dockerfile +++ b/docker2/Dockerfile @@ -33,11 +33,8 @@ RUN add-apt-repository https://downloads.skewed.de/apt && \ ln -s /usr/lib/python3/dist-packages/graph_tool \ /usr/local/lib/python3.10/site-packages -COPY requirements.txt /tmp/requirements.txt -RUN pip install pybind11 && \ - pip install -r /tmp/requirements.txt && \ - rm -f /tmp/requirements.txt +RUN pip install pybind11 COPY . /src WORKDIR /src -RUN python setup.py install +RUN pip install . From e0105685d33e56880d27d53879f97490ead81a13 Mon Sep 17 00:00:00 2001 From: muppi1993 Date: Thu, 1 Sep 2022 15:33:33 +0100 Subject: [PATCH 05/11] add mandrake installation --- docker2/Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docker2/Dockerfile b/docker2/Dockerfile index 796e7527..9f57354e 100644 --- a/docker2/Dockerfile +++ b/docker2/Dockerfile @@ -15,6 +15,11 @@ RUN git clone https://github.com/somme89/rapidNJ.git && \ mv ./bin/rapidnj /usr/bin &&\ cd .. && rm -r rapidNJ +RUN git clone https://github.com/bacpop/mandrake.git && \ + cd mandrake && \ + python setup.py install && \ + cd .. && rm -r mandrake + # Special snowflake treatment for graph_tool because the maintainer # refuses to make the package pip-installable, meaning we can't depend # on it in a sane way. Least pain seems to be to install via apt, even @@ -33,7 +38,7 @@ RUN add-apt-repository https://downloads.skewed.de/apt && \ ln -s /usr/lib/python3/dist-packages/graph_tool \ /usr/local/lib/python3.10/site-packages -RUN pip install pybind11 +RUN pip install pybind11 plotly ffmpeg COPY . /src WORKDIR /src From 54888c7c9df90dc5b41a19aa6e7ed90f780a070b Mon Sep 17 00:00:00 2001 From: muppi1993 Date: Thu, 1 Sep 2022 16:33:17 +0100 Subject: [PATCH 06/11] use higher cmake version from pip for mandrake installation --- docker2/Dockerfile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docker2/Dockerfile b/docker2/Dockerfile index 9f57354e..0107cb68 100644 --- a/docker2/Dockerfile +++ b/docker2/Dockerfile @@ -15,10 +15,7 @@ RUN git clone https://github.com/somme89/rapidNJ.git && \ mv ./bin/rapidnj /usr/bin &&\ cd .. && rm -r rapidNJ -RUN git clone https://github.com/bacpop/mandrake.git && \ - cd mandrake && \ - python setup.py install && \ - cd .. && rm -r mandrake + # Special snowflake treatment for graph_tool because the maintainer # refuses to make the package pip-installable, meaning we can't depend @@ -38,7 +35,12 @@ RUN add-apt-repository https://downloads.skewed.de/apt && \ ln -s /usr/lib/python3/dist-packages/graph_tool \ /usr/local/lib/python3.10/site-packages -RUN pip install pybind11 plotly ffmpeg +RUN pip install pybind11 plotly ffmpeg cmake + +RUN git clone https://github.com/bacpop/mandrake.git && \ + cd mandrake && \ + python setup.py install && \ + cd .. && rm -r mandrake COPY . /src WORKDIR /src From d9feff9fbd1305fa02f29be09a622bd16d91a9ce Mon Sep 17 00:00:00 2001 From: muppi1993 Date: Thu, 1 Sep 2022 17:18:07 +0100 Subject: [PATCH 07/11] Update Dockerfile --- docker2/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker2/Dockerfile b/docker2/Dockerfile index 0107cb68..62f872c2 100644 --- a/docker2/Dockerfile +++ b/docker2/Dockerfile @@ -2,13 +2,15 @@ FROM python:3.10 RUN apt-get update && \ apt-get install -y --no-install-recommends \ - cmake \ gfortran \ libarmadillo-dev \ libeigen3-dev \ libopenblas-dev \ software-properties-common +RUN pip install cmake pybind11[global] plotly ffmpeg + + RUN git clone https://github.com/somme89/rapidNJ.git && \ cd rapidNJ && \ make && \ @@ -16,7 +18,6 @@ RUN git clone https://github.com/somme89/rapidNJ.git && \ cd .. && rm -r rapidNJ - # Special snowflake treatment for graph_tool because the maintainer # refuses to make the package pip-installable, meaning we can't depend # on it in a sane way. Least pain seems to be to install via apt, even @@ -35,7 +36,6 @@ RUN add-apt-repository https://downloads.skewed.de/apt && \ ln -s /usr/lib/python3/dist-packages/graph_tool \ /usr/local/lib/python3.10/site-packages -RUN pip install pybind11 plotly ffmpeg cmake RUN git clone https://github.com/bacpop/mandrake.git && \ cd mandrake && \ From 8b87fc27f09d67ce71709f5cd4c134a8aaefd776 Mon Sep 17 00:00:00 2001 From: muppi1993 Date: Thu, 1 Sep 2022 17:59:58 +0100 Subject: [PATCH 08/11] add boost installation --- docker2/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker2/Dockerfile b/docker2/Dockerfile index 62f872c2..c99b552e 100644 --- a/docker2/Dockerfile +++ b/docker2/Dockerfile @@ -6,7 +6,8 @@ RUN apt-get update && \ libarmadillo-dev \ libeigen3-dev \ libopenblas-dev \ - software-properties-common + software-properties-common \ + libboost-all-dev RUN pip install cmake pybind11[global] plotly ffmpeg From 2cca9af96f121d7867a8a957651907d603ac7885 Mon Sep 17 00:00:00 2001 From: muppi1993 Date: Fri, 2 Sep 2022 07:05:39 +0100 Subject: [PATCH 09/11] update Dockerfile --- docker2/Dockerfile | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/docker2/Dockerfile b/docker2/Dockerfile index c99b552e..8ac4ee40 100644 --- a/docker2/Dockerfile +++ b/docker2/Dockerfile @@ -2,15 +2,12 @@ FROM python:3.10 RUN apt-get update && \ apt-get install -y --no-install-recommends \ + cmake \ gfortran \ libarmadillo-dev \ libeigen3-dev \ libopenblas-dev \ - software-properties-common \ - libboost-all-dev - -RUN pip install cmake pybind11[global] plotly ffmpeg - + software-properties-common RUN git clone https://github.com/somme89/rapidNJ.git && \ cd rapidNJ && \ @@ -18,7 +15,6 @@ RUN git clone https://github.com/somme89/rapidNJ.git && \ mv ./bin/rapidnj /usr/bin &&\ cd .. && rm -r rapidNJ - # Special snowflake treatment for graph_tool because the maintainer # refuses to make the package pip-installable, meaning we can't depend # on it in a sane way. Least pain seems to be to install via apt, even @@ -37,12 +33,15 @@ RUN add-apt-repository https://downloads.skewed.de/apt && \ ln -s /usr/lib/python3/dist-packages/graph_tool \ /usr/local/lib/python3.10/site-packages +RUN pip install pybind11[global] + +COPY . /src +WORKDIR /src +RUN pip install . + +RUN pip install cmake plotly ffmpeg RUN git clone https://github.com/bacpop/mandrake.git && \ cd mandrake && \ python setup.py install && \ cd .. && rm -r mandrake - -COPY . /src -WORKDIR /src -RUN pip install . From 99fef1e58ae8eb14cd51b488794a09699fc890b2 Mon Sep 17 00:00:00 2001 From: muppi1993 Date: Fri, 2 Sep 2022 07:30:16 +0100 Subject: [PATCH 10/11] update Dockerfile --- docker2/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker2/Dockerfile b/docker2/Dockerfile index 8ac4ee40..9b7cabcf 100644 --- a/docker2/Dockerfile +++ b/docker2/Dockerfile @@ -7,7 +7,8 @@ RUN apt-get update && \ libarmadillo-dev \ libeigen3-dev \ libopenblas-dev \ - software-properties-common + software-properties-common \ + libboost-all-dev RUN git clone https://github.com/somme89/rapidNJ.git && \ cd rapidNJ && \ From e79f19aa83df4740a3985679ca27d9f625cd362e Mon Sep 17 00:00:00 2001 From: muppi1993 Date: Tue, 6 Sep 2022 09:34:13 +0100 Subject: [PATCH 11/11] remove boost installation as now included in mandrake --- docker2/Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docker2/Dockerfile b/docker2/Dockerfile index 9b7cabcf..5649e5cc 100644 --- a/docker2/Dockerfile +++ b/docker2/Dockerfile @@ -7,8 +7,7 @@ RUN apt-get update && \ libarmadillo-dev \ libeigen3-dev \ libopenblas-dev \ - software-properties-common \ - libboost-all-dev + software-properties-common RUN git clone https://github.com/somme89/rapidNJ.git && \ cd rapidNJ && \ @@ -42,7 +41,7 @@ RUN pip install . RUN pip install cmake plotly ffmpeg -RUN git clone https://github.com/bacpop/mandrake.git && \ +RUN git clone -b bacpop-49 https://github.com/bacpop/mandrake.git && \ cd mandrake && \ python setup.py install && \ cd .. && rm -r mandrake