Skip to content

Commit 475ddd1

Browse files
committed
initial commit
0 parents  commit 475ddd1

37 files changed

+4135
-0
lines changed

.github/workflows/docker.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Build docker container and push to GitHub registry
2+
name: Docker
3+
on:
4+
workflow_dispatch:
5+
6+
# Sets permissions of the GITHUB_TOKEN
7+
permissions:
8+
contents: read
9+
packages: write
10+
11+
env:
12+
REGISTRY: ghcr.io
13+
IMAGE_NAME: ${{ github.repository }}
14+
15+
# Build and push
16+
jobs:
17+
build-and-push-image:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v3
22+
- name: Log in to the Container registry
23+
uses: docker/login-action@v2
24+
with:
25+
registry: ${{ env.REGISTRY }}
26+
username: ${{ github.actor }}
27+
password: ${{ secrets.GITHUB_TOKEN }}
28+
- name: Extract Docker metadata
29+
id: meta
30+
uses: docker/metadata-action@v4
31+
with:
32+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
33+
tags: type=raw,value=latest,enable={{is_default_branch}}
34+
- name: Build and push Docker image
35+
uses: docker/build-push-action@v4
36+
with:
37+
context: ./docker
38+
push: true
39+
tags: ${{ steps.meta.outputs.tags }}
40+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/pages.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Build and deploy Sphinx docs to GitHub Pages
2+
name: Pages
3+
on:
4+
push:
5+
branches: ['main']
6+
workflow_dispatch:
7+
8+
# Sets permissions of the GITHUB_TOKEN
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
15+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
16+
concurrency:
17+
group: "pages"
18+
cancel-in-progress: false
19+
20+
jobs:
21+
# Build job
22+
build:
23+
runs-on: ubuntu-latest
24+
container:
25+
image: ghcr.io/genentech/signature:latest
26+
steps:
27+
- uses: actions/checkout@v3
28+
- name: Install dependencies
29+
run: |
30+
pip install -r docs/requirements.txt
31+
- name: Setup Pages
32+
id: pages
33+
uses: actions/configure-pages@v3
34+
- name: Sphinx build
35+
run: |
36+
sphinx-build -b html docs _build
37+
- name: Upload artifact
38+
uses: actions/upload-pages-artifact@v3
39+
with:
40+
path: ./_build
41+
# Deployment job
42+
deploy:
43+
environment:
44+
name: github-pages
45+
url: ${{ steps.deployment.outputs.page_url }}
46+
runs-on: ubuntu-latest
47+
needs: build
48+
steps:
49+
- name: Deploy to GitHub Pages
50+
id: deployment
51+
uses: actions/deploy-pages@v4
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Publish to PyPI
5+
6+
on:
7+
workflow_dispatch
8+
# push:
9+
# tags: '^[0-9]+.[0-9]+.[0-9]+'
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up Python 3.9
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: 3.9
21+
22+
- name: Install system dependencies
23+
run: |
24+
sudo apt install pandoc
25+
26+
- name: Install python dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install flake8 pytest tox
30+
31+
- name: Build package
32+
run: |
33+
python -m tox -e clean,build
34+
35+
- name: Publish package
36+
uses: pypa/gh-action-pypi-publish@release/v1
37+
with:
38+
user: __token__
39+
password: ${{ secrets.PYPI_TOKEN }}

.github/workflows/pypi-test.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Test the library
5+
6+
on:
7+
workflow_dispatch
8+
# push:
9+
# branches: [main]
10+
# pull_request:
11+
# branches: [main]
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
19+
20+
name: Python ${{ matrix.python-version }}
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Setup Python
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
cache: "pip"
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install flake8 pytest tox
32+
33+
# - name: Lint with flake8
34+
# run: |
35+
# # stop the build if there are Python syntax errors or undefined names
36+
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
37+
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
38+
# # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
39+
40+
- name: Test with tox
41+
run: |
42+
tox

.gitignore

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Temporary and binary files
2+
*~
3+
*.py[cod]
4+
*.so
5+
*.cfg
6+
!.isort.cfg
7+
!setup.cfg
8+
*.orig
9+
*.log
10+
*.pot
11+
__pycache__/*
12+
.cache/*
13+
.*.swp
14+
*/.ipynb_checkpoints/*
15+
.DS_Store
16+
17+
# Project files
18+
.ropeproject
19+
.project
20+
.pydevproject
21+
.settings
22+
.idea
23+
.vscode
24+
tags
25+
26+
# Package files
27+
*.egg
28+
*.eggs/
29+
.installed.cfg
30+
*.egg-info
31+
32+
# Unittest and coverage
33+
htmlcov/*
34+
.coverage
35+
.coverage.*
36+
.tox
37+
junit*.xml
38+
coverage.xml
39+
.pytest_cache/
40+
41+
# Build and docs folder/files
42+
build/*
43+
dist/*
44+
sdist/*
45+
docs/_rst/*
46+
docs/_build/*
47+
cover/*
48+
MANIFEST
49+
50+
# Per-project virtualenvs
51+
.venv*/
52+
.conda*/
53+
.python-version

LICENSE

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
Copyright Genentech, Inc., 2025.
2+
3+
Licensed under the Genentech Non-Commercial Software License Version 1.0, September 2022 (the "License"); you may not use the associated software except in compliance with the License.
4+
5+
Note the Genentech Non-Commercial Software License reuses most of the text of the Apache License, Version 2.0, except that it includes a restriction against commercial use. The full text of the Apache License, Version 2.0 can be found at https://www.apache.org/licenses/LICENSE-2.0.
6+
7+
Genentech Non-Commercial Software License Version 1.0, September 2022
8+
9+
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
10+
11+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
12+
13+
1. Definitions.
14+
15+
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
16+
17+
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
18+
19+
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
20+
21+
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
22+
23+
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
24+
25+
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
26+
27+
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work.
28+
29+
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
30+
31+
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
32+
33+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
34+
35+
"Commercial Use" shall mean (i) the sale of a product embodying or incorporating or generated through the use of the Work (ii) the provision to a third party of a service for commercial purposes using the Work or (iii) granting commercial licenses and/or assigning such commercial rights to the Work to a third party, (iv) use of the Work in the discovery, research, pre-clinical or clinical development, or related manufacturing of diagnostic, prognostic, prophylactic, or therapeutic treatments, (v) use of the Work to identify patient characteristics (e.g., genomic sequences or phenotypic traits) to monitor, target, or use in or with such therapies in the course of such discovery, research as well as preclinical or clinical development activities.
36+
37+
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form for any legal purpose that is not a Commercial Use.
38+
39+
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, import, and otherwise transfer the Work for any legal purpose that is not a Commercial Use, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
40+
41+
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
42+
43+
You must give any other recipients of the Work or Derivative Works a copy of this License; and
44+
45+
You must cause any modified files to carry prominent notices stating that You changed the files; and
46+
47+
You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
48+
49+
If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
50+
51+
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
52+
53+
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
54+
55+
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
56+
57+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
58+
59+
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
60+
61+
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
62+
63+
END OF TERMS AND CONDITIONS

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
exclude .gitignore
2+
recursive-exclude .github *
3+
recursive-exclude docker *

NEWS.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Release Notes
2+
========================================================================
3+
4+
Version 0.1.0: October 3, 2024
5+
------------------------------------------------------------------------
6+
7+
+ Initial public release.

README.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
SIGnature: Scoring the Importance of Genes
2+
================================================================================
3+
4+
**SIGnature** is a python package that enables the efficient generation and collection of gene attributions.
5+
6+
Attribution scores can be used for rapid gene signature scoring across database of 22 million single cell transcriptomes.
7+
8+
See the notebooks folder for tutorials on querying and generating attributions.

0 commit comments

Comments
 (0)