Skip to content

Commit

Permalink
DITTO API using FastAPI (#1)
Browse files Browse the repository at this point in the history
* initial endpoint layout

* readMe update

* updates readme

* annotations from API

* copied scripts and configs for parsing and predictions

* predictions are working

* getting scores by transcript

* working app so far

* verifies if the variant info is actually valid

* changelog and license

* formatting changes using black

* linting URL in header fix

* changelog lint fix

* adding __init__.py to src and utils

* change query functionality to utils package

* remove unused imports

Co-authored-by: Brandon M Wilk <[email protected]>

* adds python version to the readme

Co-authored-by: Brandon M Wilk <[email protected]>

* Update src/utils/query.py to remove unused import

Co-authored-by: Brandon M Wilk <[email protected]>

* Update README.md for linting

Co-authored-by: James Scherer <[email protected]>

* localhost link change

* dead link workaround 1

* workaround 2

* removes dead code

---------

Co-authored-by: Brandon M. Wilk <[email protected]>
Co-authored-by: James Scherer <[email protected]>
  • Loading branch information
3 people authored Jan 10, 2024
1 parent 34655f6 commit f393450
Show file tree
Hide file tree
Showing 22 changed files with 2,473 additions and 76 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
Expand Down Expand Up @@ -58,8 +57,9 @@ target/
# DotEnv configuration
.env

# conda
# conda/pip
.conda
ditto-api-env

# Database
*.db
Expand Down
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
Here is a changelog format you could use. Feel free to choose a format that works for the repo.

```txt
YYYY-MM-DD John Doe
2024-01-08 Tarun Mamidi
* Big Change 1
* Another Change 2
* Added functionality from [DITTO-UI](https://github.com/uab-cgds-worthey/DITTO-UI) repo
to query OpenCravat for annotations and make DITTO predictions.
* Uses FastAPI
```

---
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

20 changes: 0 additions & 20 deletions LICENSE.md

This file was deleted.

94 changes: 43 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,73 +1,65 @@
# CGDS Repository Template [:pencil2: Edit this title]
# DITTO-API

<!-- markdown-link-check-disable -->
[![Perform linting -
Markdown](https://github.com/uab-cgds-worthey/cgds_repo_template/actions/workflows/linting.yml/badge.svg)](https://github.com/uab-cgds-worthey/cgds_repo_template/actions/workflows/linting.yml)
Markdown](https://github.com/uab-cgds-worthey/DITTO-API/actions/workflows/linting.yml/badge.svg)](https://github.com/uab-cgds-worthey/DITTO-API/actions/workflows/linting.yml)
<!-- markdown-link-check-enable -->

:pencil2: Add description of the project here.
***!!! For research purposes only !!!***

Repo for querying DITTO predictions for variants using FastAPI.

## Requirements

:pencil2: What are the requirements to install and run the project.
Following are required:

- [git](https://git-scm.com/downloads)
- python3.7+ & [python virtual environment](https://docs.python.org/3/tutorial/venv.html)
- pip3

## How to install

:pencil2: Add installation instructions here.
Installation simply requires fetching the source code.

## How to run
To fetch source code, change in to directory of your choice and run:

:pencil2: Add run instructions here. This includes necessary configurations as well as the commands used.

## Repo's directory structure
```sh
git clone https://github.com/uab-cgds-worthey/DITTO-API.git
```

The directory structure below shows the nature of files/directories used in this repo.
Change in to root directory and run the command below to install environment:

```sh
$ tree -a cgds_repo_template/
cgds_repo_template
├── CHANGELOG.md <- Log of changes made
├── CONTRIBUTING.md <- Contribution guidelines
├── LICENSE.md <- License for the repo
├── README.md
├── .gitignore <- Specifies intentionally untracked files to ignore by git
├── .editorconfig <- Helps maintain consistent coding styles for multiple users working on the same project across
│ various editors and IDEs. See https://editorconfig.org/ for more info
├── .markdownlint.json <- Markdown linting config
├── .pylintrc <- Python linting config
├── configs <- Dir to store config files. Conda env, requirements.txt, etc.
├── data <- Dir structure from http://drivendata.github.io/cookiecutter-data-science. Please give it a read.
│   ├── external <- Data from third party sources
│   ├── interim <- Intermediate data that has been transformed
│   ├── processed <- The final, canonical datasets and results
│   └── raw <- The original, immutable data dump
├── notebooks <- Dir to store Jupyter, R Markdown notebooks, etc.
├── src <- Dir to store source code for use in this project
├── .github
│   ├── ISSUE_TEMPLATE <- Github issue templates
│   │   ├── bug_report.md
│   │   └── feature_request.md
│   ├── PULL_REQUEST_TEMPLATE <- Github PR templates
│   │   └── pull_request_template.md
│   └── workflows <- Github actions workflows for automated processes (eg. linting, etc)
│   └── linting.yml
└── logs <- Dir to store log files
# 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
```

## How to run

Run the below command to activate the API

```sh
cd src
uvicorn main:app --reload
```

Test the app using this example as web address -
<!-- markdown-link-check-disable -->
<http://localhost:8000/docs>
<!-- markdown-link-check-enable -->
and use this variant as example: 1-2406483-C-G

## Contributing

We welcome contributions! [See the docs for guidelines](./CONTRIBUTING.md).

## Contact information

For issues, please send an email with clear description to

|Name | Email |
------|--------|
Tarun Mamidi | <[email protected]>
Brandon Wilk | <[email protected]>
Loading

0 comments on commit f393450

Please sign in to comment.