generated from uab-cgds-worthey/cgds_repo_template
-
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 pull request #2 from uab-cgds-worthey/docker
Docker version
- Loading branch information
Showing
5 changed files
with
124 additions
and
24 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,14 @@ | ||
# .dockerignore | ||
**/__pycache__ | ||
**/*.pyc | ||
**/*.pyo | ||
**/*.pyd | ||
*/*~ | ||
.dockerignore | ||
.git | ||
.gitignore | ||
tests/ | ||
*.log | ||
*.csv | ||
*.json | ||
*.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,22 @@ | ||
# Use an official Python runtime as a parent image | ||
FROM python:3.11-slim-bookworm | ||
|
||
# Set environment variables | ||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
# Set work directory in the container | ||
WORKDIR /app | ||
|
||
# Install dependencies | ||
COPY requirements.txt /app/requirements.txt | ||
RUN pip install --no-cache-dir -r /app/requirements.txt | ||
|
||
# Copy the current directory contents into the container at /app | ||
COPY . /app/ | ||
|
||
# Expose port | ||
EXPOSE 8000 | ||
|
||
# Run the application: | ||
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8000"] |
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 |
---|---|---|
|
@@ -14,43 +14,108 @@ Repo for querying DITTO predictions for variants using FastAPI. | |
Following are required: | ||
|
||
- [git](https://git-scm.com/downloads) | ||
- python3.7+ & [python virtual environment](https://docs.python.org/3/tutorial/venv.html) | ||
- pip3 | ||
- python3.7+ | ||
- [Docker](https://www.docker.com/products/docker-desktop) | ||
|
||
## How to install | ||
## Installing | ||
|
||
Installation simply requires fetching the source code. | ||
|
||
To fetch source code, change in to directory of your choice and run: | ||
*1.* Clone the repository - change in to directory of your choice and run: | ||
|
||
```sh | ||
git clone https://github.com/uab-cgds-worthey/DITTO-API.git | ||
``` | ||
|
||
Change in to root directory and run the command below to install environment: | ||
*2.* Navigate to the project directory | ||
|
||
```sh | ||
# Create an environment. Needed only the first time. | ||
python3 -m venv ditto-api-env | ||
source ditto-api-env/bin/activate | ||
pip3 install -r requirements.txt | ||
cd DITTO-API | ||
``` | ||
|
||
## How to run | ||
*3.* Build the Docker image | ||
|
||
```sh | ||
docker build -t ditto-api . | ||
``` | ||
|
||
Run the below command to activate the API | ||
*4.* Run the Docker container | ||
|
||
```sh | ||
cd src | ||
uvicorn main:app --reload | ||
docker run -p 8000:8000 --name ditto-api ditto-api | ||
``` | ||
|
||
Test the app using this example as web address - | ||
*5.* Use this link in your browser to retrieve DITTO scores | ||
|
||
<!-- markdown-link-check-disable --> | ||
<http://localhost:8000/docs> | ||
<!-- markdown-link-check-enable --> | ||
and use this variant as example: 1-2406483-C-G | ||
|
||
## Expected result | ||
|
||
DITTO will output deleterious score by Ensemble transcript. Below is the output for the above test variant. To verify | ||
the scores, please query the variant in the [DITTO web app](https://cgds-ditto.streamlit.app/). | ||
<!-- markdown-link-check-enable --> | ||
|
||
```sh | ||
{ | ||
"scores_by_transcript": { | ||
"ENST00000288774.7": { | ||
"gene": "PEX10", | ||
"consequence": "intron_variant,splice_site_variant", | ||
"chrom": "chr1", | ||
"pos": "2406483", | ||
"ref_base": "C", | ||
"alt_base": "G", | ||
"DITTO": "1.0" | ||
}, | ||
"ENST00000447513.6": { | ||
"gene": "PEX10", | ||
"consequence": "intron_variant,splice_site_variant", | ||
"chrom": "chr1", | ||
"pos": "2406483", | ||
"ref_base": "C", | ||
"alt_base": "G", | ||
"DITTO": "1.0" | ||
}, | ||
"ENST00000507596.5": { | ||
"gene": "PEX10", | ||
"consequence": "intron_variant,splice_site_variant", | ||
"chrom": "chr1", | ||
"pos": "2406483", | ||
"ref_base": "C", | ||
"alt_base": "G", | ||
"DITTO": "1.0" | ||
}, | ||
"ENST00000510434.1": { | ||
"gene": "PEX10", | ||
"consequence": "2kb_downstream_variant,NMD_transcript_variant", | ||
"chrom": "chr1", | ||
"pos": "2406483", | ||
"ref_base": "C", | ||
"alt_base": "G", | ||
"DITTO": "1.0" | ||
}, | ||
"ENST00000378513.7": { | ||
"gene": "RER1", | ||
"consequence": "2kb_downstream_variant", | ||
"chrom": "chr1", | ||
"pos": "2406483", | ||
"ref_base": "C", | ||
"alt_base": "G", | ||
"DITTO": "1.0" | ||
}, | ||
"ENST00000605895.6": { | ||
"gene": "RER1", | ||
"consequence": "2kb_downstream_variant", | ||
"chrom": "chr1", | ||
"pos": "2406483", | ||
"ref_base": "C", | ||
"alt_base": "G", | ||
"DITTO": "1.0" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Contributing | ||
|
||
We welcome contributions! [See the docs for guidelines](./CONTRIBUTING.md). | ||
|
@@ -60,6 +125,6 @@ We welcome contributions! [See the docs for guidelines](./CONTRIBUTING.md). | |
For issues, please send an email with clear description to | ||
|
||
|Name | Email | | ||
------|--------| | ||
Tarun Mamidi | <[email protected]> | ||
Brandon Wilk | <[email protected]> | ||
|------|--------| | ||
|Tarun Mamidi | <[email protected]>| | ||
|Brandon Wilk | <[email protected]>| |
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
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