Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
FROM ubuntu:22.04
MAINTAINER Mingxun Wang "mwang87@gmail.com"
LABEL maintainer="Mingxun Wang <mwang87@gmail.com>"

WORKDIR /app
RUN apt-get update -y && \
apt-get install -y libxrender-dev && \
apt-get install -y git-core libarchive-dev build-essential wget vim curl

# Install Mamba
ENV CONDA_DIR /opt/conda
ENV CONDA_DIR=/opt/conda
RUN wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh -O ~/miniforge.sh && /bin/bash ~/miniforge.sh -b -p /opt/conda
ENV PATH=$CONDA_DIR/bin:$PATH
RUN echo "export PATH=$CONDA_DIR:$PATH" >> ~/.bashrc

RUN mamba create -y -n usi -c conda-forge -c bioconda -c defaults celery==5.3.6 \
dash=1.20.0 dash-bootstrap-components=0.9.2 flask gunicorn \
joblib matplotlib==3.6.3 numba numpy openssl qrcode rdkit requests \
requests-cache scipy spectrum_utils==0.3.5 werkzeug==2.0.0
requests-cache scipy setuptools spectrum_utils==0.3.5 werkzeug==2.0.0 \
python=3.11


# install redis with pypi
RUN /bin/bash -c 'source activate usi && pip install redis'
RUN /bin/bash -c 'source activate usi && pip install redis "setuptools<81"'

# installing hash
RUN /bin/bash -c 'source activate usi && pip install "git+https://github.com/berlinguyinca/spectra-hash.git#subdirectory=python" && pip install celery-once'
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ server-compose-interactive:
docker-compose --compatibility build
docker-compose --compatibility up

server-compose-autotest-interactive:
docker-compose --compatibility build
docker-compose -f docker-compose.yml -f docker-compose-autotest.yml --compatibility up

server-compose:
docker-compose --compatibility build
docker-compose --compatibility up -d
Expand Down
16 changes: 16 additions & 0 deletions docker-compose-autotest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
services:
metabolomicsusi-web:
command: /app/run_dev_server.sh
restart: "no"

metabolomicsusi-api1:
restart: "no"

metabolomicsusi-worker:
restart: "no"


networks:
nginx-net:
name: nginx-net
external: true
5 changes: 2 additions & 3 deletions docker-compose-production.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3'
services:
metabolomicsusi-web:
networks:
Expand Down Expand Up @@ -64,5 +63,5 @@ services:

networks:
nginx-net:
external:
name: nginx-net
name: nginx-net
external: true
5 changes: 2 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3'
services:
metabolomicsusi-web:
build:
Expand Down Expand Up @@ -72,6 +71,6 @@ services:

networks:
nginx-net:
external:
name: nginx-net
name: nginx-net
external: true

1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ redis
requests
requests_cache
scipy
setuptools
umami-analytics
spectrum_utils
werkzeug==2.0.0
Expand Down
19 changes: 19 additions & 0 deletions test/debug_script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import functools
import json
import sys

sys.path.insert(0, "../") # Add the parent directory to the path

from metabolomics_spectrum_resolver import parsing, similarity, views



def debug():
usi = "mzspec:GNPS:GNPS-LIBRARY:accession:CCMSLIB00017443251"
# Parse the USI
parsed_usi = parsing.parse_usi(usi)
print("Parsed USI:", parsed_usi)


if __name__ == "__main__":
debug()
2 changes: 2 additions & 0 deletions test/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,3 +491,5 @@ def test_cosine():
+ intensity[2] * intensity[3]
)
assert peak_matches == [(2, 3), (1, 1), (0, 0)]


Loading