Skip to content

GenoTracker is a FastAPI and Streamlit-based application for managing and visualizing genomic cohort data. The backend service is implemented using FastAPI, and the frontend is created with Streamlit. The application can read cohort data from both local CSV files and Google Cloud Storage (GCS).

License

Notifications You must be signed in to change notification settings

dvitale199/GenoTracker

Repository files navigation

GenoTracker

GenoTracker is a FastAPI and Streamlit-based application for managing and visualizing genomic cohort data. The backend service is implemented using FastAPI, and the frontend is created with Streamlit. The application can read cohort data from both local CSV files and Google Cloud Storage (GCS).

Features

  • Load and visualize genomic cohort data.
  • Supports reading data from local files and GCS.
  • Interactive data exploration using Streamlit.
  • Dockerized for easy deployment and scalability.
  • Supports secure configuration using Docker secrets.

Project Structure

genotracker/
│
├── genotracker/
│   ├── __init__.py
│   ├── api/
│   │   └── endpoints.py
│   ├── models/
│   │   └── cohort_data.py
│   ├── services/
│   │   └── data_service.py
│   │
│   ├── tests/
│   ├── __init__.py
│   ├── test_data_service.py
│   └── test_main.py
├── Dockerfile.fastapi
├── Dockerfile.streamlit
├── docker-compose.yml
├── pyproject.toml
└── README.md

Getting Started

Prerequisites

  • Python 3.11+
  • Docker
  • Docker Compose
  • Google Cloud SDK (for accessing GCS)

Installation

  1. Clone the repository:

    git clone https://github.com/dvitale199/genotracker.git
    cd genotracker
  2. Install dependencies:

    Using Poetry:

    poetry install

    Or using pip:

    pip install -r requirements.txt
  3. Set up Google Cloud credentials:

    Ensure you have a service account JSON key and set the GOOGLE_APPLICATION_CREDENTIALS environment variable:

    export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/service-account-file.json"

Running Locally

Using Docker Compose

  1. Build and start the services:

    docker-compose up --build
  2. Access the services:

Running Tests

  1. Run tests using pytest:

    pytest

Configuration

Environment Variables

  • GOOGLE_APPLICATION_CREDENTIALS: Path to the Google Cloud service account JSON key.

Docker Secrets

For secure handling of sensitive information, Docker secrets are used. Ensure your docker-compose.yml is set up correctly to use the secret:

secrets:
  gcloud-service-account:
    file: ./secrets/gp2-release-terra-e65c1b67820b.json

Deploying to Google Cloud Run

  1. Build the Docker images:

    docker build -t gcr.io/your-project-id/genotracker-fastapi -f Dockerfile.fastapi .
    docker build -t gcr.io/your-project-id/genotracker-streamlit -f Dockerfile.streamlit .
  2. Push the images to Google Container Registry:

    docker push gcr.io/your-project-id/genotracker-fastapi
    docker push gcr.io/your-project-id/genotracker-streamlit
  3. Deploy the services to Cloud Run:

    gcloud run deploy genotracker-fastapi --image gcr.io/your-project-id/genotracker-fastapi --platform managed --region your-region --service-account [email protected]
    
    gcloud run deploy genotracker-streamlit --image gcr.io/your-project-id/genotracker-streamlit --platform managed --region your-region --service-account [email protected]

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

About

GenoTracker is a FastAPI and Streamlit-based application for managing and visualizing genomic cohort data. The backend service is implemented using FastAPI, and the frontend is created with Streamlit. The application can read cohort data from both local CSV files and Google Cloud Storage (GCS).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published