Skip to content

Commit

Permalink
Merge pull request #233 from monarch-initiative/release-0.2.0
Browse files Browse the repository at this point in the history
Make release `0.2.0`
  • Loading branch information
ielis authored Aug 27, 2024
2 parents 1b3d85d + 7ce3fa9 commit 8505fbf
Show file tree
Hide file tree
Showing 2,120 changed files with 114,063 additions and 3,705,366 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[*]
max_line_length = 120
trim_trailing_whitespace = true
insert_final_newline = true
15 changes: 15 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[flake8]
max-line-length = 120

# F405 - ignore error if class is imported in `*` import.
# W293 - blank line contains whitespace
# W503 - line break before binary operator
ignore = F405,W293,W503

exclude =
.git,
__pycache__,
docs/conf.py,
build,
dist,
venv,
8 changes: 4 additions & 4 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
touch gh-pages/.nojekyll
function build_docs {
# The function will checkout a branch and build the Javadoc & documentation
# into provided documentation directory.
# The function will checkout a branch and build the API docs & documentation
# into provided directory.
BRANCH=${1}
DOCDIR=${2}
Expand All @@ -50,8 +50,8 @@ jobs:
printf "Building the %s documentation\n" ${DOCDIR}
cd docs
sphinx-apidoc --separate --module-first -d 2 -H "API reference" --follow-links -o apidocs ../src/genophenocorr
make html
sphinx-apidoc --separate --module-first -d 2 -H "API reference" --follow-links -o apidocs ../src/gpsea
make clean html
mv _build/html/* ../gh-pages/${DOCDIR}
cd ..
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/python_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ on:
branches: [ main, develop ]

jobs:
build:
run-ci:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v4
- name: Initialize Python 3.11
- name: Initialize Python
uses: actions/[email protected]
with:
python-version: "3.11"
python-version: ${{ matrix.python-version }}
- name: Install package
run: |
python3 -m pip install .[test,docs]
python3 -m pip install --editable .[test]
- name: Run pytest tests
run: |
export MPLBACKEND=Agg
export GPSEA_CACHEDIR=.gpsea_ci_cachedir
pytest
- name: Run documentation tests
run: |
cd docs
sphinx-apidoc --separate --module-first -d 2 -H "API reference" -o apidocs ../src/genophenocorr
make doctest
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Cache with transcript/protein pickle files
.gpsea_cache

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -29,7 +32,6 @@ share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
phenopackets
notebooks/KBG/Backup/
notebooks/KBG/phenopackets_extraHPO/
notebooks/KBG/pickledVariants/
Expand Down Expand Up @@ -131,6 +133,10 @@ venv.bak/
# PyCharm
.idea/

# VsCode
*.code-workspace
.vscode

# mkdocs documentation
/site

Expand Down
Binary file added .gpsea_ci_cachedir/protein_cache/NP_852259.1.pickle
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
8 changes: 4 additions & 4 deletions HOW_TO_RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# How to release

The document describes how to release `genophenocorr` to *PyPi*.
The document describes how to release `gpsea` to *PyPi*.

## Release checklist

Expand All @@ -9,7 +9,7 @@ The document describes how to release `genophenocorr` to *PyPi*.
- remove deprecated methods targeted for removal in this version. The `TODO` markers are labeled using
the target version (e.g. `TODO[v0.3.0]`)
- bump versions to a release:
- `src/genophenocorr/__init__.py`
- `src/gpsea/__init__.py`
- `docs/conf.py`
- ensure the CI passes
- deploy to PyPi (described below)
Expand Down Expand Up @@ -52,11 +52,11 @@ Store the token into `$HOME/.pypirc` file with `-rw-------` permissions. The fil
Now we're ready to publish packages!

### Deploy
Run the following to deploy `genophenocorr` to PyPi:
Run the following to deploy `gpsea` to PyPi:

```bash
# Ensure you're on the release branch
cd genophenocorr
cd gpsea

# Build the package
python3 -m build
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include src/gpsea/model/genome/GCF_*.tsv
include src/gpsea/view/templates/*.html
51 changes: 30 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,50 @@
[![Build status](https://github.com/monarch-initiative/genophenocorr/workflows/CI/badge.svg)](https://github.com/monarch-initiative/genophenocorr/actions/workflows/python_ci.yml)
![PyPi downloads](https://img.shields.io/pypi/dm/genophenocorr.svg?label=Pypi%20downloads)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/genophenocorr)
[![Build status](https://github.com/monarch-initiative/gpsea/workflows/CI/badge.svg)](https://github.com/monarch-initiative/gpsea/actions/workflows/python_ci.yml)
[![GitHub release](https://img.shields.io/github/release/monarch-initiative/gpsea.svg)](https://github.com/monarch-initiative/gpsea/releases)
![PyPi downloads](https://img.shields.io/pypi/dm/gpsea.svg?label=Pypi%20downloads)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/gpsea)

Genophenocorr is a Python library for genotype-phenotype association analysis.
GPSEA is a Python library for discovery of genotype-phenotype associations.

An example of simple genotype-phenotype association analysis

```python
# Load HPO
import hpotk
hpo = hpotk.load_minimal_ontology('http://purl.obolibrary.org/obo/hp.json')

# Load a cohort of phenopackets
from genophenocorr.data import get_toy_cohort
store = hpotk.configure_ontology_store()
hpo = store.load_minimal_hpo()

# Load a cohort of phenopackets
from gpsea.data import get_toy_cohort

cohort = get_toy_cohort()

# Analyze genotype-phenotype associations
from genophenocorr.analysis import CohortAnalysis
from genophenocorr.constants import VariantEffect
# Analyze genotype-phenotype associations
from gpsea.analysis import configure_cohort_analysis
from gpsea.analysis.predicate import PatientCategories

from gpsea.model import VariantEffect

cohort_analysis = configure_cohort_analysis(cohort, hpo)
frameshift = cohort_analysis.compare_by_variant_effect(VariantEffect.FRAMESHIFT_VARIANT, tx_id='NM_1234.5')

cohort_analysis = CohortAnalysis(cohort, 'NM_1234.5', hpo)
frameshift = cohort_analysis.compare_by_variant_type(VariantEffect.FRAMESHIFT_VARIANT)
print(frameshift)
frameshift.summarize(hpo, category=PatientCategories.YES)
```

prints a table with genotype-phenotype correlations:
provides a pandas data frame with genotype-phenotype correlations:

```text
With frameshift_variant Without frameshift_variant
Count Percent Count Percent p-value
HP:0001166 (Arachnodactyly) 4 30.77% 10 76.92% 0.04718
HP:0001250 (Seizure) 11 84.62% 9 69.23% 0.64472
HP:0001257 (Spasticity) 8 61.54% 9 69.23% 1.00000
FRAMESHIFT_VARIANT on NM_1234.5 No Yes
Count Percent Count Percent p value Corrected p value
Arachnodactyly [HP:0001166] 1/10 10% 13/16 81% 0.000781 0.020299
Abnormality of the musculature [HP:0003011] 6/6 100% 11/11 100% 1.000000 1.000000
Abnormal nervous system physiology [HP:0012638] 9/9 100% 15/15 100% 1.000000 1.000000
... ... ... ... ... ... ...
```

## Documentation

Check out the User guide and the API reference for more info:

- [Stable documentation](https://monarch-initiative.github.io/genophenocorr/stable/) (last release on `main` branch)
- [Latest documentation](https://monarch-initiative.github.io/genophenocorr/latest) (bleeding edge, latest commit on `development` branch)
- [Stable documentation](https://monarch-initiative.github.io/gpsea/stable/) (last release on `main` branch)
- [Latest documentation](https://monarch-initiative.github.io/gpsea/latest) (bleeding edge, latest commit on `develop` branch)
Loading

0 comments on commit 8505fbf

Please sign in to comment.