https://github.com/broadinstitute/scp-ingest-pipeline
File Ingest Pipeline for Single Cell Portal
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
8 of 11 committers (72.7%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.2%) to scientific vocabulary
Keywords from Contributors
Repository
File Ingest Pipeline for Single Cell Portal
Basic Info
Statistics
- Stars: 5
- Watchers: 7
- Forks: 0
- Open Issues: 1
- Releases: 0
Metadata Files
README.md
scp-ingest-pipeline
File Ingest Pipeline for Single Cell Portal
The SCP Ingest Pipeline is an ETL pipeline for single-cell RNA-seq data.
Prerequisites
- Python 3.10
- Google Cloud Platform project
- Suitable service account (SA) and MongoDB VM in GCP. SA needs roles "Editor", "Genomics Pipelines Runner", and "Storage Object Admin". Broad Institute engineers: see instructions here.
- SAMtools, if using
ingest/make_toy_data.py - Tabix, if using
ingest/genomes/genomes_pipeline.py
Install
Native
Fetch the code, boot your virtualenv, install dependencies:
git clone git@github.com:broadinstitute/scp-ingest-pipeline.git
cd scp-ingest-pipeline
python3 -m venv env --copies
source env/bin/activate
pip install -r requirements.txt
source scripts/setup-mongo-dev.sh
Docker
With Docker running and gcloud authenticated on your local machine, run:
scripts/docker-compose-setup.sh
If on Apple silicon Mac (e.g. M1), and performance seems poor, consider generating a docker image using the arm64 base. Example test image: gcr.io/broad-singlecellportal-staging/single-cell-portal:development-2.2.0-arm64, usage:
scripts/docker-compose-setup.sh -i development-2.2.0-arm64
To update dependencies when in Docker, you can pip install from within the Docker Bash shell after adjusting your requirements.txt.
If you close your shell after that, your newly installed dependencies will be lost. Dependencies only persist after merging your
new requirements.txt into development. TODO (SCP-4941): Add entry-point script to run pip install.
Optional
To use ingest/make_toy_data.py:
brew install samtools
To use ingest/genomes/genomes_pipeline.py:
brew install tabix
Git hooks
After installing Ingest Pipeline, add Git hooks to help ensure code quality:
pre-commit install && pre-commit install -t pre-push
The hooks will expect that git-secrets has been set up. If you are a Broad Institute employee who has not done this yet, please see: broadinstitute/singlecellportal_configs for specific guidance.
Bypass hooks
In rare cases, you might need to skip Git hooks, like so:
- Skip commit hooks:
git commit ... --no-verify - Skip pre-push hooks:
git push ... --no-verify
Test
After installing:
``` source env/bin/activate cd tests
Run all tests
pytest ```
Some common pytest usage examples (run in /tests):
```
Run all tests and see print() output
pytest -s
Run only tests in test_ingest.py
pytest test_ingest.py
Run all tests, show code coverage metrics
pytest --cov=../ingest/ ```
For more, see https://docs.pytest.org/en/stable/usage.html.
Testing in Docker locally
If you have difficulties installing and configuring scp-ingest-pipeline due to hardware issues (e.g. Mac M1 chips),
you can alternatively test locally by building the Docker image and then running any commands inside the container.
There are some extra steps required, but this sidesteps the need to install packages locally.
1. Build the image
Run the following command to build the testing Docker image locally (make sure Docker is running first). This build command will incorporate any changes in the local instance of your repo, committed or not:
docker build -t ingest-pipeline:test-candidate .
Note - the base Ubuntu image used in the Dockerfile comes from Google Container Registry (GCR, aka gcr.io), if this is your first time doing docker build you may need to configure Docker to use the Google Cloud CLI to authenticate requests to Container Registry:
gcloud auth configure-docker
Pro-Tip: For local builds, you can try adding docker build options --progress=plain (for more verbose build info) and/or --no-cache (when you want to ensure a build with NO cached layers)
2. Set up environment variables
Run the following to pull database-specific secrets out of Google Secrets Manager (GSM):
source scripts/setup-mongo-dev.sh
Now run env to make sure you've set the following values:
MONGODB_USERNAME=single_cell
DATABASE_NAME=single_cell_portal_development
MONGODB_PASSWORD=<password>
DATABASE_HOST=<ip address>
3. Print out your service account keyfile
Run the following to export out your default service account JSON keyfile:
GOOGLE_PROJECT=$(gcloud info --format="value(config.project)")
gcloud secrets versions access latest --project=$GOOGLE_PROJECT --secret=default-sa-keyfile | jq > /tmp/keyfile.json
4. Start the Docker container
Run the container, passing in the proper environment variables:
docker run --name scp-ingest-test -e MONGODB_USERNAME="$MONGODB_USERNAME" -e DATABASE_NAME="$DATABASE_NAME" \
-e MONGODB_PASSWORD="$MONGODB_PASSWORD" -e DATABASE_HOST="$DATABASE_HOST" \
-e GOOGLE_APPLICATION_CREDENTIALS=/tmp/keyfile.json --rm -it \
ingest-pipeline:test-candidate bash
Note: on an M1 machine, you may see this message:
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
5. Copy keyfile to running container
In a separate terminal window, copy the JSON keyfile from above to the expected location:
docker cp /tmp/keyfile.json scp-ingest-test:/tmp
You can now run any ingest_pipeline.py command you wish inside the container.
Use
Run this every time you start a new terminal to work on this project:
source env/bin/activate
See ingest_pipeline.py for usage examples.
Troubleshooting during set up
If you run into an error like: "... [SSL: CERTIFICATEVERIFYFAILED] certificate verify failed ... " try:
- Open terminal
cdto where python is installed- Run the certificates command with
/Applications/Python\ < Your Version of Python Here >/Install\ Certificates.command
If you run into an error like "ModuleNotFoundError: No module named 'google'" try:
- Open terminal
- Run
pip install --upgrade google-api-python-client
Owner
- Name: Broad Institute
- Login: broadinstitute
- Kind: organization
- Location: Cambridge, MA
- Website: http://www.broadinstitute.org/
- Twitter: broadinstitute
- Repositories: 1,083
- Profile: https://github.com/broadinstitute
Broad Institute of MIT and Harvard
GitHub Events
Total
- Release event: 10
- Delete event: 29
- Issue comment event: 21
- Push event: 77
- Pull request review comment event: 24
- Pull request event: 57
- Pull request review event: 77
- Create event: 31
Last Year
- Release event: 10
- Delete event: 29
- Issue comment event: 21
- Push event: 77
- Pull request review comment event: 24
- Pull request event: 57
- Pull request review event: 77
- Create event: 31
Committers
Last synced: about 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Eno Akpan | e****i@b****g | 956 |
| jlchang | j****g@b****g | 601 |
| Eric Weitz | e****z@b****g | 525 |
| bistline | b****e@b****g | 174 |
| michelle-vel | m****p@g****m | 44 |
| Michelle Velyunskiy | m****s@b****g | 36 |
| Devon Bush | d****h@b****g | 26 |
| github-actions | g****s@g****m | 12 |
| dependabot[bot] | 4****] | 9 |
| ehanna4 | e****a@b****g | 7 |
| Scott Longley | s****y@b****g | 4 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 1
- Total pull requests: 213
- Average time to close issues: 4 days
- Average time to close pull requests: 5 days
- Total issue authors: 1
- Total pull request authors: 8
- Average comments per issue: 1.0
- Average comments per pull request: 0.87
- Merged pull requests: 203
- Bot issues: 0
- Bot pull requests: 11
Past Year
- Issues: 1
- Pull requests: 58
- Average time to close issues: 4 days
- Average time to close pull requests: 4 days
- Issue authors: 1
- Pull request authors: 4
- Average comments per issue: 1.0
- Average comments per pull request: 0.78
- Merged pull requests: 52
- Bot issues: 0
- Bot pull requests: 2
Top Authors
Issue Authors
- bistline (1)
Pull Request Authors
- jlchang (104)
- bistline (72)
- eweitz (32)
- dependabot[bot] (15)
- michelle-vel (7)
- ehanna4 (7)
- devonbush (5)
- knapii-developments (5)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 49 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 12
- Total maintainers: 1
pypi.org: scp-ingest-pipeline
ETL pipeline for single-cell RNA-seq data
- Homepage: https://github.com/broadinstitute/scp-ingest-pipeline
- Documentation: https://scp-ingest-pipeline.readthedocs.io/
- License: BSD License
-
Latest release: 1.12.2
published over 4 years ago
Rankings
Maintainers (1)
Dependencies
- google-auth ==1.5.1
- google-cloud-storage ==1.13.0
- backoff ==1.10.0
- black ==19.3b0
- colorama ==0.4.1
- coverage ==4.5.3
- dataclasses ==0.6
- flake8 ==3.7.8
- google-cloud-bigquery ==1.24.0
- google-cloud-logging ==1.14.0
- google-cloud-storage ==1.28.1
- google-cloud-trace ==0.23.0
- grpcio ==1.29.0
- jsonschema ==3.0.1
- mypy-extensions ==0.4.1
- numpy ==1.21.5
- opencensus ==0.7.6
- opencensus-context ==0.1.1
- opencensus-ext-stackdriver ==0.7.2
- pandas ==1.3.5
- pandocfilters ==1.4.2
- pre-commit ==1.18.1
- pymongo ==3.9.0
- pytest ==5.0.1
- pytest-cov ==2.8.1
- pytest-xdist ==1.29.0
- requests ==2.22.0
- scanpy ==1.8.2
- scipy ==1.5.2
- sentry-sdk ==0.16.1
- backoff *
- colorama *
- dataclasses *
- google-cloud-bigquery *
- google-cloud-storage *
- google-cloud-trace *
- grpcio *
- jsonschema *
- loompy *
- mypy_extensions *
- numpy *
- opencensus *
- opencensus-context *
- opencensus-ext-stackdriver *
- pandas *
- pandocfilters *
- pymongo *
- requests *
- scipy *
- sentry-sdk *
- marketplace.gcr.io/google/ubuntu1804 latest build