Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates & polishing #4

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
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
50 changes: 50 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Ignore Git repository files
.git
.gitignore

# Ignore Python virtual environments
.venv/
env/
venv/

# Ignore log files
*.log

# Ignore Python cache and compiled files
__pycache__/
*.py[cod]
*$py.class

# Ignore pytest cache
.pytest_cache/

# Ignore mypy cache
.mypy_cache/

# Ignore coverage reports
.coverage
htmlcov/

# Ignore temporary files
*.swp
*~
*.tmp
*.temp

# Ignore build artifacts
build/
dist/
.eggs/
*.egg-info/

# Ignore IDE/editor configurations
.vscode/
.idea/

# Ignore macOS Finder files
.DS_Store

# Ignore other system files
Thumbs.db
desktop.ini

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ coverage.xml
.ropeproject

# Django stuff:
*.log
*.pot

# Sphinx documentation
Expand Down
32 changes: 16 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
# Use the official Ubuntu 24.04 LTS as the base image
FROM ubuntu:24.04
# --------------------- Stage 1: Build the wheel ---------------------
# Use the official Ubuntu 23.04 as the base image for the builder
FROM ubuntu:23.04 AS builder

# Set environment variables
ENV PYTHONUNBUFFERED=1 \
POETRY_VIRTUALENVS_CREATE=false \
POETRY_NO_INTERACTION=1

# Update and install system dependencies
# Update and install system dependencies for building
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
curl \
wget \
git \
python3.12 \
python3.12-venv \
python3.12-dev \
samtools \
bedtools \
python3.11 \
python3.11-venv \
python3.11-dev \
&& rm -rf /var/lib/apt/lists/*

# Ensure python3 and pip3 are the default
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1 && \
update-alternatives --install /usr/bin/pip3 pip3 /usr/bin/pip3.12 1
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.11 10

# Install Poetry
RUN curl -sSL https://install.python-poetry.org | python3 -
Expand All @@ -36,11 +33,14 @@ WORKDIR /app
# Copy pyproject.toml and poetry.lock if available
COPY pyproject.toml poetry.lock* /app/

# Install project dependencies
RUN poetry install --no-root --only main
# Install project dependencies without installing the package itself
RUN poetry install --only main

# Copy the rest of the project files
COPY . /app

# Install the project
RUN poetry install --no-dev
# Install the package
RUN poetry install

# Set the entrypoint to ldsc
ENTRYPOINT ["poetry", "run"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ Key publications:
Run the help command to verify that LDSC is installed correctly:

```bash
python ldsc.py -h
python munge_sumstats.py -h
ldsc -h
munge_sumstats -h
```

If these commands display help messages with available options, the installation was successful.
Expand Down
7 changes: 5 additions & 2 deletions ldsc.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ def ldscore(args, log):
array_snps,
keep_snps=keep_snps,
keep_indivs=keep_indivs,
mafMin=args.maf,
)

# filter annot_matrix down to only SNPs passing MAF cutoffs
Expand Down Expand Up @@ -780,8 +779,8 @@ def ldscore(args, log):
help="Population prevalence of binary phenotype (for conversion to liability scale).",
)

if __name__ == "__main__":

def main():
args = parser.parse_args()
if args.out is None:
raise ValueError("--out is required.")
Expand Down Expand Up @@ -861,3 +860,7 @@ def ldscore(args, log):
log.log("Analysis finished at {T}".format(T=time.ctime()))
time_elapsed = round(time.time() - start_time, 2)
log.log("Total time elapsed: {T}".format(T=sec_to_str(time_elapsed)))


if __name__ == "__main__":
main()
Loading
Loading