-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/gymrek-lab/pheno_sim into n…
…ew_plotting
- Loading branch information
Showing
30 changed files
with
4,172 additions
and
2,813 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
name: Tests | ||
|
||
on: [pull_request, workflow_call] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
tests: | ||
name: ${{ matrix.session }} / ${{ matrix.python }} / ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- { python: "3.11", os: "ubuntu-latest", session: "tests" } | ||
- { python: "3.12", os: "ubuntu-latest", session: "tests" } | ||
|
||
env: | ||
NOXSESSION: ${{ matrix.session }} | ||
FORCE_COLOR: "1" | ||
PRE_COMMIT_COLOR: "always" | ||
|
||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Mambaforge | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
activate-environment: citrus | ||
miniforge-variant: Mambaforge | ||
auto-activate-base: false | ||
miniforge-version: latest | ||
use-mamba: true | ||
|
||
- name: Get Date | ||
id: get-date | ||
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT | ||
shell: bash | ||
|
||
- name: Cache Conda env | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ env.CONDA }}/envs | ||
key: | ||
conda-${{ runner.os }}--${{ runner.arch }}--${{ steps.get-date.outputs.today }}-${{ hashFiles('dev-env.yml') }}-${{ env.CACHE_NUMBER }} | ||
env: | ||
# Increase this value to reset cache if dev-env.yml has not changed | ||
CACHE_NUMBER: 0 | ||
id: cache | ||
|
||
- name: Install dev environment | ||
run: | ||
mamba env update -n citrus -f dev-env.yml | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
|
||
- name: Try to build citrus | ||
shell: bash -el {0} | ||
run: | | ||
poetry build --no-ansi | ||
- name: Check distribution size | ||
if: matrix.session == 'size' | ||
run: | | ||
du -csh dist/* | ||
tar -ztvf dist/*.tar.gz | ||
# check that the generated dist/ directory does not exceed 0.3 MB | ||
# if this check fails, it's because you forgot to list large files in the "exclude" section of our pyproject.toml | ||
# https://python-poetry.org/docs/pyproject/#include-and-exclude | ||
[ $(du -b dist | cut -f1) -lt 300000 ] | ||
- name: Check code coverage | ||
if: matrix.session == 'coverage' | ||
shell: bash -el {0} | ||
run: | | ||
export NOXSESSION=tests | ||
# check that code coverage is not lower than specific percent | ||
nox --verbose --python=${{ matrix.python }} -- --cov=. --cov-report=term-missing --cov-fail-under=0 # TODO update!! | ||
- name: Run tests with nox | ||
if: matrix.session == 'tests' | ||
shell: bash -el {0} | ||
run: | | ||
nox --verbose --python=${{ matrix.python }} | ||
large-files: | ||
name: File sizes | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check for large files | ||
uses: actionsdesk/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} # Optional | ||
filesizelimit: 500000b | ||
labelName: large-files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,57 @@ | ||
# CITRUS🍊: A phenotype simulation tool with the flexibility to model complex interactions | ||
|
||
CITRUS, the CIs and Trans inteRaction nUmerical Simulator, is a tool for simulating phenotypes with complex genetic archetectures that go beyond simple models that assume linear, additive contributions of individual SNPs. The goal of this tool is to provide better simulations for benchmarking GWAS/PRS models. | ||
CITRUS, the CIs and Trans inteRaction nUmerical Simulator, is a collection of tools for simulating phenotypes with complex genetic architectures that go beyond simple models that assume linear, additive contributions of individual SNPs. The goal of CITRUS is to provide better simulations for benchmarking GWAS/PRS models. | ||
|
||
## Getting Started | ||
The key component of CITRUS is the ability to specify custom models relating genotypes to phenotypes. See the [designing simulations](doc/designing_simulations.md) for details on specifying models. Example models are provided in `example-files/`. | ||
|
||
[User Guide](doc/user_guide.md) | ||
CITRUS provides multiple command line utilities for performing and analyzing simulations: | ||
|
||
[Designing Simulations](doc/designing_simulations.md) | ||
* [citrus simulate](doc/cli.md#simulate): Perform a simulation using a given model | ||
* [citrus plot](doc/cli.md#plot): Visualize a phenotype model | ||
* [citrus shap](doc/cli.md#shap): Generate SHAP values for a model | ||
|
||
[Command Line Interface](doc/cli.md) | ||
## Installation | ||
|
||
### With conda | ||
|
||
## Installation | ||
**TODO - conda install instructions** | ||
|
||
### With pip | ||
|
||
**TODO - pip install instructions** | ||
|
||
### From source | ||
|
||
To install from source (only recommended for development), clone the CITRUS repository and checkout the branch you're interested in: | ||
|
||
```bash | ||
git clone https://github.com/gymrek-lab/CITRUS.git | ||
cd CITRUS/ | ||
pip install . | ||
cd CITRUS | ||
``` | ||
|
||
Now, create 1) a conda environment with our development tools and 2) a virtual environment with our dependencies and an editable install of CITRUS: | ||
|
||
``` | ||
conda env create -n citrus -f dev-env.yml | ||
conda run -n citrus poetry install | ||
conda activate citrus | ||
``` | ||
|
||
Note, for plotting models, you will need to have [graphviz](https://graphviz.org/) installed. | ||
|
||
## Quickstart | ||
|
||
``` | ||
# Visualize a model | ||
citrus plot -c example-files/linear_additive.json | ||
``` | ||
|
||
## Full documentation | ||
|
||
[Command Line Interface](doc/cli.md) | ||
|
||
[User Guide](doc/user_guide.md) | ||
|
||
[Designing Simulations](doc/designing_simulations.md) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from importlib.metadata import version, PackageNotFoundError | ||
|
||
try: | ||
__version__ = version(__name__) | ||
except PackageNotFoundError: | ||
__version__ = "unknown" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.