Skip to content

Commit

Permalink
test v0.1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
andyjslee committed Oct 2, 2024
1 parent e8da6ec commit 362ab0b
Show file tree
Hide file tree
Showing 84 changed files with 1,713 additions and 194 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/antigen_presentation_prediction.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: alignment
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Free disk space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true

- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
activate-environment: test-env
python-version: "3.10"

- name: Install dependencies
shell: bash -l {0}
run: |
# Remove tmp files
sudo rm -rf /tmp/*
# Install conda packages
conda env list
conda info
conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge
conda config --set channel_priority strict
conda install pandas
conda install nextflow==23.10.0
conda install pylint
conda install coveralls
conda install pytest
conda install pytest-cov
# Install nexus
pip install . --verbose
- name: Run linter
shell: bash -l {0}
run: |
chmod +x lint.sh
bash lint.sh
- name: Run unit tests
shell: bash -l {0}
run: |
chmod +x scripts/unittests/unittest_antigen_presentation_prediction.sh
bash scripts/unittests/unittest_antigen_presentation_prediction.sh
93 changes: 49 additions & 44 deletions README.md

Large diffs are not rendered by default.

83 changes: 83 additions & 0 deletions docker/dysgu/v1.6.7/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Use Ubuntu 22.04 LTS as the base image
FROM ubuntu:22.04

# Set noninteractive installation to avoid getting stuck during build
ARG DEBIAN_FRONTEND=noninteractive

# Install necessary packages for Miniconda installation
RUN apt-get update && \
apt-get install -y --no-install-recommends \
autoconf \
automake \
build-essential \
bzip2 \
ca-certificates \
cmake \
curl \
gcc-12 \
gfortran \
git \
libarchive-dev \
libncurses-dev \
libpng-dev \
libpcre3 \
libpcre3-dev \
libssl-dev \
libbz2-dev \
lzma-dev \
liblzma-dev \
libssl-dev \
libpcre2-dev \
libcurl4-openssl-dev \
make \
ncurses-dev \
openssl \
tzdata \
wget \
zlib1g \
zlib1g-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Download and Install Miniconda
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py311_24.7.1-0-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh

# Add Miniconda to PATH
ENV PATH=/opt/conda/bin:$PATH
ENV PATH=/opt/conda/lib:$PATH

# Test conda installation by updating conda
RUN conda update conda

# Install samtools
RUN wget https://github.com/samtools/samtools/releases/download/1.18/samtools-1.18.tar.bz2 && \
tar -xvjf samtools-1.18.tar.bz2 && \
cd samtools-1.18/ && \
mkdir bin && \
./configure --prefix=$(pwd) && \
make && \
make install

# Add samtools to PATH
ENV PATH /samtools-1.18:$PATH

# Install bcftools
RUN wget https://github.com/samtools/bcftools/releases/download/1.18/bcftools-1.18.tar.bz2 && \
tar -xvjf bcftools-1.18.tar.bz2 && \
cd bcftools-1.18/ && \
mkdir bin && \
./configure --prefix=$(pwd) && \
make && \
make install

# Add bcftools to PATH
ENV PATH /bcftools-1.18:$PATH

# Install dysgu
RUN conda install -c conda-forge libgcc=13 openssl
RUN conda install -c bioconda dysgu==1.6.7

# Clean up to reduce Docker image size
RUN apt-get clean
69 changes: 69 additions & 0 deletions docker/mhcflurry2/v2.1.4/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Use Ubuntu 22.04 LTS as the base image
FROM ubuntu:22.04

# Set noninteractive installation to avoid getting stuck during build
ARG DEBIAN_FRONTEND=noninteractive

# Install necessary packages for Miniconda installation
RUN apt-get update && \
apt-get install -y --no-install-recommends \
autoconf \
automake \
build-essential \
bzip2 \
ca-certificates \
cmake \
curl \
gcc-12 \
gfortran \
git \
libarchive-dev \
libncurses-dev \
libpng-dev \
libpcre3 \
libpcre3-dev \
libssl-dev \
libbz2-dev \
lzma-dev \
liblzma-dev \
libssl-dev \
libpcre2-dev \
libcurl4-openssl-dev \
make \
ncurses-dev \
openssl \
tzdata \
wget \
zlib1g \
zlib1g-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Download and Install Miniconda
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py311_24.7.1-0-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh

# Add Miniconda to PATH
ENV PATH=/opt/conda/bin:$PATH
ENV PATH=/opt/conda/lib:$PATH

# Test conda installation by updating conda
RUN conda update conda

# Install mhcflurry
RUN conda config --set solver classic
RUN conda install conda-forge::six==1.16.0
RUN conda install pandas==2.2.2
RUN conda install conda-forge::tensorflow==2.17.0
RUN conda install conda-forge::keras==3.5.0
RUN conda install conda-forge::appdirs==1.4.4
RUN conda install anaconda::scikit-learn==1.5.1
RUN conda install anaconda::pyyaml==6.0.1
RUN conda install conda-forge::tqdm==4.66.5
RUN pip install mhcgnomes==1.8.6
RUN pip install mhcflurry
RUN mhcflurry-downloads fetch

# Clean up to reduce Docker image size
RUN apt-get clean
59 changes: 59 additions & 0 deletions docker/nanomonsv/v0.7.2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Use Ubuntu 22.04 LTS as the base image
FROM ubuntu:22.04

# Set noninteractive installation to avoid getting stuck during build
ARG DEBIAN_FRONTEND=noninteractive

# Install necessary packages for Miniconda installation
RUN apt-get update && \
apt-get install -y --no-install-recommends \
autoconf \
automake \
build-essential \
bzip2 \
ca-certificates \
cmake \
curl \
gcc-12 \
gfortran \
git \
libarchive-dev \
libncurses-dev \
libpng-dev \
libpcre3 \
libpcre3-dev \
libssl-dev \
libbz2-dev \
lzma-dev \
liblzma-dev \
libssl-dev \
libpcre2-dev \
libcurl4-openssl-dev \
make \
ncurses-dev \
openssl \
tzdata \
wget \
zlib1g \
zlib1g-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Download and Install Miniconda
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py311_24.7.1-0-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh

# Add Miniconda to PATH
ENV PATH=/opt/conda/bin:$PATH
ENV PATH=/opt/conda/lib:$PATH

# Test conda installation by updating conda
RUN conda update conda

# Install nanomonsv
RUN conda install -c conda-forge libgcc=13 openssl
RUN conda install -c bioconda nanomonsv==0.7.2

# Clean up to reduce Docker image size
RUN apt-get clean
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ requires = [

[project]
name = "nexus"
version = "0.1.6"
version = "0.1.7"
description = "NEXflow's Ultimate Streamliner"
requires-python = ">=3.10"
readme = "README.md"
Expand Down
11 changes: 10 additions & 1 deletion scripts/data/bam/align_hg38_long_read_dna_fastq_files.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
nexus run --nf-workflow long_read_alignment_minimap2.nf \
-c /Users/leework/Documents/Research/projects/project_nexus/nexus/test/data/nextflow/nextflow_test_docker.config \
-w /Users/leework/Documents/Research/projects/project_nexus/data/processed/work/long_read_alignment_minimap2/ \
--samples_tsv_file /Users/leework/Documents/Research/projects/project_nexus/nexus/scripts/data/bam/samples_long_read_dna_fastq_files.tsv \
--samples_tsv_file /Users/leework/Documents/Research/projects/project_nexus/nexus/scripts/data/bam/samples_long_read_dna_fastq_files_1.tsv \
--reference_genome_fasta_file /Users/leework/Documents/Research/projects/project_nexus/nexus/test/data/fasta/hg38_chr17_1-8M_chr18_1-9M_hpv16.fa.gz \
--reference_genome_fasta_fai_file /Users/leework/Documents/Research/projects/project_nexus/nexus/test/data/fasta/hg38_chr17_1-8M_chr18_1-9M_hpv16.fa.gz.fai \
--params_minimap2 '"-ax map-hifi --cs --eqx -Y -L"' \
--output_dir /Users/leework/Documents/Research/projects/project_nexus/nexus/test/data/bam/

nexus run --nf-workflow long_read_alignment_minimap2.nf \
-c /Users/leework/Documents/Research/projects/project_nexus/nexus/test/data/nextflow/nextflow_test_docker.config \
-w /Users/leework/Documents/Research/projects/project_nexus/data/processed/work/long_read_alignment_minimap2/ \
--samples_tsv_file /Users/leework/Documents/Research/projects/project_nexus/nexus/scripts/data/bam/samples_long_read_dna_fastq_files_2.tsv \
--reference_genome_fasta_file /Users/leework/Documents/Research/projects/project_nexus/nexus/test/data/fasta/hg38_chr17_1-8M_chr18_1-9M_hpv16.fa.gz \
--reference_genome_fasta_fai_file /Users/leework/Documents/Research/projects/project_nexus/nexus/test/data/fasta/hg38_chr17_1-8M_chr18_1-9M_hpv16.fa.gz.fai \
--params_minimap2 '"-ax map-hifi --cs -Y -L"' \
--output_dir /Users/leework/Documents/Research/projects/project_nexus/nexus/test/data/bam/
3 changes: 3 additions & 0 deletions scripts/data/bam/samples_long_read_dna_fastq_files_2.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sample_id fastq_file
sample001normal2 /Users/leework/Documents/Research/projects/project_nexus/nexus/test/data/fastq/sample001normal_long_read_dna.fastq.gz
sample001tumor2 /Users/leework/Documents/Research/projects/project_nexus/nexus/test/data/fastq/sample001tumor_long_read_dna.fastq.gz
10 changes: 10 additions & 0 deletions scripts/data/csv/create_sample900_mhcflurry2_input_csv_file.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import pandas as pd

if __name__ == '__main__':
data = {
'peptide': ['SIINFEKL',
'SIINFEKL'],
'allele': ['H-2-Kb',
'H-2-Db']
}
pd.DataFrame(data).to_csv('../../../test/data/csv/sample900_mhcflurry2_input.csv', index=False)
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def create_fastq_file(
# Step 2. Normal
sequence = fasta.fetch("NC_000017.11:c7687490-7668421", 0, fasta.lengths[0])
sequence = list(str(sequence))
sequence = sequence[0:2000] + sequence[2099:]
sequence = ''.join(sequence)

create_fastq_file(
Expand Down
6 changes: 6 additions & 0 deletions scripts/unittests/unittest_antigen_presentation_prediction.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pytest \
-s \
--cov-report=term-missing \
--cov=nexuslib \
test/ \
-k "test_antigen_presentation_prediction_mhcflurry2"
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ optional arguments:
`-c`
* Nextflow `config` file can be downloaded [here](https://github.com/pirl-unc/nexus/tree/main/nextflow)

`--sample_tsv_file`
`--samples_tsv_file`
* A TSV (tab-separated values) file with the following headers:

| Header | Description |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ optional arguments:
`-c`
* Nextflow `config` file can be downloaded [here](https://github.com/pirl-unc/nexus/tree/main/nextflow)

`--sample_tsv_file`
`--samples_tsv_file`
* A TSV (tab-separated values) file with the following headers:

| Header | Description |
| ---------- |------------------------------|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ optional arguments:
`-c`
* Nextflow config file can be downloaded [here](https://github.com/pirl-unc/nexus/tree/main/nextflow)

`--sample_tsv_file`
`--samples_tsv_file`
* A TSV (tab-separated values) file with the following headers:

| Header | Description |
| ------------ |---------------------------------|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ optional arguments:
`-c`
* Nextflow config file can be downloaded [here](https://github.com/pirl-unc/nexus/tree/main/nextflow)

`--sample_tsv_file`
`--samples_tsv_file`
* A TSV (tab-separated values) file with the following headers:

| Header | Description |
| ------------ |---------------------------------|
Expand Down
Loading

0 comments on commit 362ab0b

Please sign in to comment.