Skip to content

Commit

Permalink
Merge pull request #139 from AlexandrovLab/container
Browse files Browse the repository at this point in the history
Add Docker Container
  • Loading branch information
mdbarnesUCSD authored Aug 21, 2024
2 parents 8bf4694 + 8321345 commit 3b98292
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 36 deletions.
11 changes: 8 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Changelog

All notable changes to this project will be documented in this file.
Expand All @@ -7,6 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## [0.1.8] - 2024-08-20

### Added
- Added a Dockerfile to the repository for containerization. Documentation on how to use the Dockerfile needs to be added to the README.

### Changed
- Removed unnecessary imports from `setup.py` to clean up the codebase.

## [0.1.7] - 2024-06-21

### Added
Expand All @@ -18,5 +25,3 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Changed
- Improved input_type value check mechanism to use .lower() before checking against values 'vcf' or 'matrix'.
- Updated dependency from PyPDF2 to pypdf to increase compatibility and resolve installation issues on bioconda.


31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Start with a base Ubuntu image and install Python
FROM ubuntu:22.04

# Avoid prompts from apt
ARG DEBIAN_FRONTEND=noninteractive

# Install Python and other dependencies, and apply updates
RUN apt-get update && apt-get upgrade -y && \
apt-get install -y python3-pip python3-dev git && \
apt-get clean && rm -rf /var/lib/apt/lists/*

# Set the working directory in the container
WORKDIR /usr/src/app

# Clone the specific branch of the repository
RUN git clone https://github.com/AlexandrovLab/SigProfilerAssignment.git .

# Install the dependencies from the requirements.txt in the cloned repository
RUN pip3 install --no-cache-dir -r requirements.txt

# Install the SigProfilerAssignment package from PyPI
RUN pip3 install SigProfilerAssignment==0.1.8

# Create a non-root user named 'spm_user'
RUN useradd -m -s /bin/bash spm_user

# Change the ownership of the /usr/src/app directory and its contents to the new non-root user
RUN chown -R spm_user:spm_user /usr/src/app

# Switch to the non-root user for subsequent commands and when running the container
USER spm_user
8 changes: 0 additions & 8 deletions SigProfilerAssignment/decompose_subroutines.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,12 @@
import numpy as np
import os, sys

# from matplot,pdblib.backends.backend_pdf import PdfPages
import pandas as pd
import matplotlib.pyplot as plt

plt.switch_backend("agg")
from matplotlib.backends.backend_pdf import PdfPages

# from sklearn import metrics
# import time
# import multiprocessing
# from multiprocessing import current_process
# from functools import partial
# from numpy import linalg as LA
import sigProfilerPlotting as plot
from SigProfilerAssignment.DecompositionPlots import PlotDecomposition as sp
from sigProfilerPlotting import plotActivity as plot_ac
Expand All @@ -30,7 +23,6 @@
import pypdf
import scipy

# import SigProfilerAssignment as sspro
from pypdf import PdfMerger
import SigProfilerAssignment as spa
from SigProfilerAssignment import single_sample as ss
Expand Down
3 changes: 0 additions & 3 deletions SigProfilerAssignment/decomposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@
@author: mishugeb
"""

# from SigProfilerExtractor import subroutines as sub

from cmath import cos
import datetime
import platform

# from torch import sign
from SigProfilerAssignment import decompose_subroutines as sub
from SigProfilerAssignment.DecompositionPlots import PlotDecomposition as plot_decomp
import SigProfilerAssignment
Expand Down
106 changes: 94 additions & 12 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,94 @@
scipy
numpy
pandas
SigProfilerMatrixGenerator
sigProfilerPlotting
pillow
statsmodels
scikit-learn
psutil
reportlab
pypdf
alive_progress
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile setup.py
#
about-time==4.2.1
# via alive-progress
alive-progress==3.1.5
# via SigProfilerAssignment (setup.py)
chardet==5.2.0
# via reportlab
contourpy==1.2.1
# via matplotlib
cycler==0.12.1
# via matplotlib
fonttools==4.53.1
# via matplotlib
grapheme==0.6.0
# via alive-progress
joblib==1.4.2
# via scikit-learn
kiwisolver==1.4.5
# via matplotlib
matplotlib==3.9.2
# via
# sigprofilermatrixgenerator
# sigprofilerplotting
numpy==1.26.4
# via
# SigProfilerAssignment (setup.py)
# contourpy
# matplotlib
# pandas
# patsy
# scikit-learn
# scipy
# sigprofilermatrixgenerator
# statsmodels
packaging==24.1
# via
# matplotlib
# statsmodels
pandas==1.5.3
# via
# SigProfilerAssignment (setup.py)
# sigprofilermatrixgenerator
# sigprofilerplotting
# statsmodels
patsy==0.5.6
# via statsmodels
pillow==10.4.0
# via
# matplotlib
# reportlab
# sigprofilerplotting
pymupdf==1.24.9
# via SigProfilerAssignment (setup.py)
pymupdfb==1.24.9
# via pymupdf
pyparsing==3.1.2
# via matplotlib
pypdf==4.3.1
# via SigProfilerAssignment (setup.py)
python-dateutil==2.9.0.post0
# via
# matplotlib
# pandas
pytz==2024.1
# via pandas
reportlab==4.2.2
# via SigProfilerAssignment (setup.py)
scikit-learn==1.5.1
# via sigprofilerplotting
scipy==1.14.0
# via
# SigProfilerAssignment (setup.py)
# scikit-learn
# sigprofilermatrixgenerator
# statsmodels
sigprofilermatrixgenerator==1.2.28
# via SigProfilerAssignment (setup.py)
sigprofilerplotting==1.3.24
# via
# SigProfilerAssignment (setup.py)
# sigprofilermatrixgenerator
six==1.16.0
# via
# patsy
# python-dateutil
statsmodels==0.14.2
# via sigprofilermatrixgenerator
threadpoolctl==3.5.0
# via scikit-learn
16 changes: 6 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
if os.path.exists("dist"):
shutil.rmtree("dist")

VERSION = "0.1.7"
VERSION = "0.1.8"


def write_version_py(filename="SigProfilerAssignment/version.py"):
Expand All @@ -15,7 +15,7 @@ def write_version_py(filename="SigProfilerAssignment/version.py"):
# THIS FILE IS GENERATED FROM SigProfilerAssignment SETUP.PY
short_version = '%(version)s'
version = '%(version)s'
Update = 'v0.1.7: Update CLI, add pytest, and update pypdf dependency.'
Update = 'v0.1.8: Add Dockerfile and remove uncessary dependencies'
"""
Expand All @@ -34,18 +34,14 @@ def write_version_py(filename="SigProfilerAssignment/version.py"):

requirements = [
"scipy>=1.6.3",
"numpy>=1.21.2",
"numpy>=1.21.2,<2.0.0",
"pandas>=1.2.4,<2.0.0",
"SigProfilerMatrixGenerator>=1.2.17",
"sigProfilerPlotting>=1.3.23",
"statsmodels>=0.9.0",
"scikit-learn>=0.24.2",
"psutil>=5.6.1",
"SigProfilerMatrixGenerator>=1.2.28",
"sigProfilerPlotting>=1.3.24",
"reportlab>=3.5.42",
"pypdf>=3.1.0",
"alive_progress>=2.4.1",
"pdf2image>=1.16.0",
"PyMuPDF>=1.21.0",
"PyMuPDF>=1.21.0", # required for package "fitz"
]

write_version_py()
Expand Down

0 comments on commit 3b98292

Please sign in to comment.