Skip to content

Commit

Permalink
Merge branch 'optimize-training' of github.com:PMBio/deeprvat into mo…
Browse files Browse the repository at this point in the history
…dular-model

Resolved conflicts.
  • Loading branch information
meyerkm committed Dec 12, 2023
2 parents 5813428 + b985e77 commit 29d3951
Show file tree
Hide file tree
Showing 386 changed files with 4,879 additions and 414 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/autoblack_pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# GitHub Action that uses Black to reformat the Python code in an incoming pull request.
# If all Python code in the pull request is complient with Black then this Action does nothing.
# Othewrwise, Black is run and its changes are committed back to the incoming pull request.
# https://github.com/cclauss/autoblack

name: autoblack_pull_request
on: [ pull_request ]
jobs:
black-code:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- run: pip install black
- run: black --check .
- name: If needed, commit black changes to the pull request
if: failure()
run: |
printenv | grep GITHUB
git config --global user.name 'PMBio'
git config --global user.email 'PMBio@users.noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git remote -v
git branch
git status
black .
git status
echo ready to commit
git commit -am "fixup! Format Python code with psf/black pull_request"
echo ready to push
git push
123 changes: 116 additions & 7 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: DeepRVAT
run-name: DeepRVAT 🧬🧪💻🧑‍🔬
on: [ push ]

jobs:
DeepRVAT-Pipeline-Smoke-Tests:
runs-on: ubuntu-latest
Expand All @@ -12,19 +13,127 @@ jobs:
with:
directory: 'example'
snakefile: 'pipelines/training_association_testing.snakefile'
args: '-j 1 -n'
stagein: 'pip install -e ${{ github.workspace }}'
args: '-j 2 -n'
- name: Link pretrained models
run: cd ${{ github.workspace }}/example && ln -s ../pretrained_models
- name: Association Testing Pretrained Smoke Test
uses: snakemake/snakemake-github-action@v1.24.0
with:
directory: 'example'
snakefile: 'pipelines/association_testing_pretrained.snakefile'
args: '-j 2 -n'
- name: Seed Gene Discovery Smoke Test
uses: snakemake/snakemake-github-action@v1.24.0
with:
directory: 'example'
snakefile: 'pipelines/seed_gene_discovery.snakefile'
args: '-j 1 -n'
args: '-j 2 -n'

DeepRVAT-Pipeline-Tests:
runs-on: ubuntu-latest
needs: DeepRVAT-Pipeline-Smoke-Tests
steps:
- name: Check out repository code
uses: actions/checkout@v3
- uses: mamba-org/setup-micromamba@v1.4.3
with:
environment-name: deeprvat-gh-action
environment-file: ${{ github.workspace }}/deeprvat_env_no_gpu.yml
cache-environment: true
cache-downloads: true
- name: Install DeepRVAT
run: pip install -e ${{ github.workspace }}
shell: micromamba-shell {0}
# There are no GPUs on the gh worker, so we disable it in the config
- name: Update config to use no gpus
run: "sed -i 's/gpus: 1/gpus: 0/' ${{ github.workspace }}/example/config.yaml"
shell: bash -el {0}
- name: Run training_association_testing pipeline
run: |
python -m snakemake -j 2 --directory ${{ github.workspace }}/example \
--snakefile ${{ github.workspace }}/pipelines/training_association_testing.snakefile --show-failed-logs
shell: micromamba-shell {0}
- name: Link pretrained models
run: cd ${{ github.workspace }}/example && ln -s ../pretrained_models
- name: Association Testing Pretrained Smoke Test
shell: bash -el {0}
- name: Run association_testing_pretrained pipeline
run: |
python -m snakemake -j 2 --directory ${{ github.workspace }}/example \
--snakefile ${{ github.workspace }}/pipelines/association_testing_pretrained.snakefile --show-failed-logs
shell: micromamba-shell {0}
- name: Copy seed gene discovery snakemake config
run: cd ${{ github.workspace }}/example && cp ../deeprvat/seed_gene_discovery/config.yaml .
shell: bash -el {0}
- name: Run seed_gene_discovery pipeline
run: |
python -m snakemake -j 2 --directory ${{ github.workspace }}/example \
--snakefile ${{ github.workspace }}/pipelines/seed_gene_discovery.snakefile --show-failed-logs
shell: micromamba-shell {0}


DeepRVAT-Preprocessing-Pipeline-Smoke-Tests:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Preprocessing Smoke Test
uses: snakemake/snakemake-github-action@v1.24.0
with:
directory: 'example'
snakefile: 'pipelines/association_testing_pretrained.snakefile'
args: '-j 1 -n'
directory: 'example/preprocess'
snakefile: 'pipelines/preprocess.snakefile'
args: '-j 2 -n --configfile pipelines/config/deeprvat_preprocess_config.yaml'
stagein: 'touch example/preprocess/workdir/reference/GRCh38.primary_assembly.genome.fa'


DeepRVAT-Annotation-Pipeline-Smoke-Tests:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Annotations Smoke Test
uses: snakemake/snakemake-github-action@v1.25.1
with:
directory: 'example/annotations'
snakefile: 'pipelines/annotations.snakefile'
args: '-j 2 -n --configfile pipelines/config/deeprvat_annotation_config.yaml'


DeepRVAT-Preprocessing-Pipeline-Tests:
runs-on: ubuntu-latest
needs: DeepRVAT-Preprocessing-Pipeline-Smoke-Tests
steps:

- name: Check out repository code
uses: actions/checkout@v3
- uses: mamba-org/setup-micromamba@v1.4.3
with:
environment-name: deeprvat-preprocess-gh-action
environment-file: ${{ github.workspace }}/deeprvat_preprocessing_env.yml
cache-environment: true
cache-downloads: true

- name: Install DeepRVAT
run: pip install -e ${{ github.workspace }}
shell: micromamba-shell {0}

- name: Cache Fasta file
id: cache-fasta
uses: actions/cache@v3
with:
path: example/preprocess/workdir/reference
key: ${{ runner.os }}-reference-fasta

- name: Download and unpack fasta data
if: steps.cache-fasta.outputs.cache-hit != 'true'
run: |
cd ${{ github.workspace }}/example/preprocess && \
wget https://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_44/GRCh38.primary_assembly.genome.fa.gz \
-O workdir/reference/GRCh38.primary_assembly.genome.fa.gz \
&& gzip -d workdir/reference/GRCh38.primary_assembly.genome.fa.gz
- name: Run preprocessing pipeline
run: |
python -m snakemake -j 2 --directory ${{ github.workspace }}/example/preprocess \
--snakefile ${{ github.workspace }}/pipelines/preprocess.snakefile \
--configfile ${{ github.workspace }}/pipelines/config/deeprvat_preprocess_config.yaml --show-failed-logs
shell: micromamba-shell {0}
25 changes: 25 additions & 0 deletions .github/workflows/test-runner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: DeepRVAT test runner
run-name: DeepRVAT Tests 🧑🏼‍💻✅
on: [ push ]

jobs:
DeepRVAT-Tests-Runner:
runs-on: ubuntu-latest
steps:

- name: Check out repository code
uses: actions/checkout@v3
- uses: mamba-org/setup-micromamba@v1.4.3
with:
environment-name: deeprvat-preprocess-gh-action
environment-file: ${{ github.workspace }}/deeprvat_preprocessing_env.yml
cache-environment: true
cache-downloads: true

- name: Install DeepRVAT
run: pip install -e ${{ github.workspace }}
shell: micromamba-shell {0}

- name: Run pytest
run: pytest -v ${{ github.workspace }}/tests
shell: micromamba-shell {0}
168 changes: 166 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,166 @@
deeprvat.egg-info
*.pyc

example/**/.snakemake/**
example/**/.snakemake_*
example/preprocess/workdir/reference/*.fa


# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/
Loading

0 comments on commit 29d3951

Please sign in to comment.