Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
safiyecelik committed Oct 25, 2023
2 parents bf4fdc6 + e64437b commit f3be685
Show file tree
Hide file tree
Showing 22 changed files with 373 additions and 77 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# For more information see:
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
* @recursionpharma/cartography
* @recursionpharma/cartography
30 changes: 30 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish Python Package

on:
push:
tags:
- "v*"

permissions:
contents: read

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build --sdist --wheel
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/quality.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Quality
on: [push]
jobs:
tests:
name: Quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: 3.8
- name: update pip
run: |
pip install -U wheel
pip install -U setuptools
python -m pip install -U pip
- run: pip install tox
- run: tox -e style
44 changes: 44 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Test
on: [push]
jobs:
tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
minor_version: [8, 9, 10, 11]
os: [ubuntu-latest, windows-latest, macos-latest]
exclude:
# exclude Windows on Python 3.8 due to Jaxlib incompatibility
# (might be able to fix by using system-dependent lockfile, but not worth our time)
- os: windows-latest
minor_version: 8
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: 3.${{ matrix.minor_version }}
- name: update pip
run: |
pip install -U wheel
pip install -U setuptools
python -m pip install -U pip
- run: pip install tox
- run: tox -e py3${{ matrix.minor_version }}
- uses: actions/upload-artifact@v3
with:
name: coverage.${{ matrix.os }}.py3${{ matrix.minor_version }}
path: ./.coverage.py3${{ matrix.minor_version }}
# coverage:
# needs: tests
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/download-artifact@v3
# with:
# path: .
# - run: pip install coverage
# - run: |
# coverage combine coverage*/
# coverage report --fail-under=0
18 changes: 7 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# pre-commit autoupdate
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: detect-private-key
Expand All @@ -19,45 +19,41 @@ repos:
- id: mixed-line-ending
- id: end-of-file-fixer

- repo: https://github.com/asottile/seed-isort-config
rev: v2.2.0
hooks:
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.10.1
hooks:
- id: isort

- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py38-plus]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.991
rev: v1.6.1
hooks:
- id: mypy
args: [--ignore-missing-imports, --python-version=3.8, --install-types, --non-interactive]

- repo: https://github.com/PyCQA/flake8
rev: '6.0.0'
rev: '6.1.0'
hooks:
- id: flake8

- repo: https://github.com/PyCQA/bandit
rev: '1.7.4'
rev: '1.7.5'
hooks:
- id: bandit
exclude: tests/.*$

- repo: https://github.com/psf/black
rev: 23.1.0
rev: 23.10.1
hooks:
- id: black
language_version: python3.8

- repo: https://github.com/abravalheri/validate-pyproject
rev: main
rev: v0.15
hooks:
- id: validate-pyproject
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include efaar_benchmarking/benchmark_annotations/*
include efaar_benchmarking/benchmark_annotations/*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# EFAAR_benchmarking

This library enables computation and retrieval of metrics to benchmark a whole-genome perturbative map created by the pipeline.
Metrics that can be computed using this repo are pairwise gene-gene recall for the reactome, corum, and humap datasets which
Metrics that can be computed using this repo are pairwise gene-gene recall for the reactome, corum, and humap datasets which
are publicly available.

By default, we do not filter on perturbation fingerprint, although filtering is available through the parameters to the `benchmark` function.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
MAJOR="0"
MINOR="0"
MINOR="1"
1 change: 0 additions & 1 deletion efaar_benchmarking/data_loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import scanpy as sc
import numpy as np


def load_replogle(gene_type, data_type, data_path="data/"):
"""
Load Replogle et al. 2020 single-cell RNA-seq data for K562 cells.
Expand Down
5 changes: 3 additions & 2 deletions efaar_benchmarking/efaar.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import numpy as np
import pandas as pd
import efaar_benchmarking.constants as cst
from scvi.model import SCVI
import scanpy as sc
from scvi.model import SCVI
from sklearn.utils import Bunch

import efaar_benchmarking.constants as cst


def embed_by_scvi(adata, BATCH_KEY="gem_group", N_LATENT=128, N_HIDDEN=256):
"""
Expand Down
10 changes: 6 additions & 4 deletions efaar_benchmarking/utils.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from sklearn.utils import Bunch
from sklearn.metrics.pairwise import cosine_similarity
import efaar_benchmarking.constants as cst
from typing import Optional

import numpy as np
import pandas as pd
from typing import Optional
from sklearn.metrics.pairwise import cosine_similarity
from sklearn.utils import Bunch

import efaar_benchmarking.constants as cst


def compute_process_cosine_sim(
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,20 @@ dependencies = [

[project.optional-dependencies]
dev = [
"bandit",
"bandit[toml]",
"black",
"coverage",
"docstr-coverage",
"flake8",
"isort",
"mypy",
"pre-commit",
"pytest",
"pytest-cov",
"pyupgrade",
"radon",
"types-pkg_resources",
"types-setuptools",
"tox",
"validate-pyproject[all]",
"jupyterlab",
Expand Down
43 changes: 35 additions & 8 deletions requirements/dev_3.10.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ backcall==0.2.0
# via ipython
backoff==2.2.1
# via lightning
bandit==1.7.5
bandit[toml]==1.7.5
# via efaar-benchmarking (pyproject.toml)
beautifulsoup4==4.12.2
# via
# lightning
# nbconvert
black==23.10.0
black==23.10.1
# via efaar-benchmarking (pyproject.toml)
bleach==6.1.0
# via nbconvert
Expand Down Expand Up @@ -187,18 +187,37 @@ fsspec[http]==2023.10.0
# pytorch-lightning
# s3fs
# torch
gcsfs==0.8.0
gcsfs==2023.10.0
# via efaar-benchmarking (pyproject.toml)
gitdb==4.0.11
# via gitpython
gitpython==3.1.40
# via bandit
google-api-core==2.12.0
# via
# google-cloud-core
# google-cloud-storage
google-auth==2.23.3
# via
# gcsfs
# google-api-core
# google-auth-oauthlib
# google-cloud-core
# google-cloud-storage
google-auth-oauthlib==1.1.0
# via gcsfs
google-cloud-core==2.3.3
# via google-cloud-storage
google-cloud-storage==2.12.0
# via gcsfs
google-crc32c==1.5.0
# via
# google-cloud-storage
# google-resumable-media
google-resumable-media==2.6.0
# via google-cloud-storage
googleapis-common-protos==1.61.0
# via google-api-core
h11==0.14.0
# via uvicorn
h5py==3.10.0
Expand Down Expand Up @@ -229,6 +248,8 @@ ipython==8.16.1
# via ipykernel
isoduration==20.11.0
# via jsonschema
isort==5.12.0
# via efaar-benchmarking (pyproject.toml)
itsdangerous==2.1.2
# via starsessions
jax==0.4.19
Expand Down Expand Up @@ -531,7 +552,10 @@ prometheus-client==0.17.1
prompt-toolkit==3.0.39
# via ipython
protobuf==4.24.4
# via orbax-checkpoint
# via
# google-api-core
# googleapis-common-protos
# orbax-checkpoint
psutil==5.9.6
# via
# ipykernel
Expand Down Expand Up @@ -639,6 +663,8 @@ requests==2.31.0
# via
# fsspec
# gcsfs
# google-api-core
# google-cloud-storage
# jupyterlab-server
# lightning
# lightning-cloud
Expand Down Expand Up @@ -674,7 +700,7 @@ scanpy==1.9.5
# via efaar-benchmarking (pyproject.toml)
scikit-image==0.22.0
# via efaar-benchmarking (pyproject.toml)
scikit-learn==1.3.1
scikit-learn==1.3.2
# via
# efaar-benchmarking (pyproject.toml)
# pynndescent
Expand Down Expand Up @@ -759,6 +785,7 @@ tokenize-rt==5.2.0
# via pyupgrade
tomli==2.0.1
# via
# bandit
# black
# coverage
# jupyterlab
Expand Down Expand Up @@ -821,6 +848,8 @@ types-pkg-resources==0.1.3
# via efaar-benchmarking (pyproject.toml)
types-python-dateutil==2.8.19.14
# via arrow
types-setuptools==68.2.0.0
# via efaar-benchmarking (pyproject.toml)
typing-extensions==4.8.0
# via
# async-lru
Expand All @@ -840,8 +869,6 @@ typing-extensions==4.8.0
# uvicorn
tzdata==2023.3
# via pandas
ujson==5.8.0
# via gcsfs
umap-learn==0.5.4
# via scanpy
uri-template==1.3.0
Expand All @@ -858,7 +885,7 @@ uvicorn==0.23.2
# lightning-cloud
validate-pyproject[all]==0.15
# via efaar-benchmarking (pyproject.toml)
virtualenv==20.24.5
virtualenv==20.24.6
# via
# pre-commit
# tox
Expand Down
Loading

0 comments on commit f3be685

Please sign in to comment.