-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor with fixes, features and improved directory structure (#39)
* 🎨 Apply black formatting * 🎨⬆️🤠 refactor to use dash-extensions DashBlueprints * Significantly simplified code base with modular components that are each passed their own page's app (DashBlueprint) * components and layouts are standardized to use render function that may receive the app with or without arguments * 🔥 Remove (now) unnecessary index.py * ⬆️ Pin dash-extensions to first major release * ⬆️ Pin dash to 2.10 * ⬆️ Add dash-mantine-components * ⬆️ Add dash-iconify * 📝 Add contributing docs * 🎨🐛📝🐳 Fix docs, prop id and docker specs * 🐳 Add quotes around ports per docker-compose spec * 📝🎨🔥 add Development resources 🎨🔥 Add icons to not found page and remove unnecessary text * 🎨 Refactor mag refinement page components * 🎨 Refactor marker symbols legend to use icons rather than naming shapes * 🎨 Restyle save selections and settings buttons * 🎨 Refactor mag-refinement offsettings canvas components * 🎨 Add minimum example contig_cytoscape component * 🎨 Add specific backend configurations * 🎨 Add REDIS_BACKEND details to .env * 🎨 Add specific backend params to Serverside(..., backend=...) from automappa.data.db import {redis,file_system}_backend * 📝🔥 Refactor dash components to DashProxy components * ⬆️ pin dash-mantine-components to 0.12 in env using pip rather than conda * 🎨 Add icons in page registry with blueprints * 🎨 Add coverage range slider component * 🎨 Add Refinement model to track contig cluster refinements * 🎨 Implement data source to connect MAG refinements table * 🎨 Add methods to get latest user refinements contig headers * 🎨 Add interaction b/w coverage range slider and scatterplot2d * 🎨 Connect download refinements button to data source * 🎨 Hide MAG refinements switch is now disabled when there are no user refinements that have been made * 🎨 Refinements table has been styled with new timestamp string and removed 'initial_cluster' column * 🎨 Refinements table now only retrieves user refinements (i.e. excludes initial clusters) * 🎨 Add refinements clear button * Add working data source for completeness/purity boxplot * 🎨 Add minimal working AgGrid for MAG Summary * 🎨 Replace dbc.Offcanvas with dmc.Drawer * 🎨 Replace many of the Dropdowns in Offcanvas with RadioGroup Radio options (less clicks for the user) * 🥕🐰 Add logic for modular task-queue * 📝 Add documentation for tasks in CONTRIBUTING and reference tasks README.md * 🥕 Add minimum working example for task submission, progress display for a task status badge * 🥕 Add task discovery for home page task in celeryconfig.py * 🐳🐍 Replace base image of miniforge with mambaforge * 🥕🎨 Notification system tells user of current state of tasks processing * 🐛🎨 Move dcc.Store(...) within respective du.Upload component * 🎨 Add tasks store for getting tasks statuses * 🐰🥕 Add tasks in home for handling sample data ingestion * 🎨 Add mag length sum computations * 🎨 Add MIMAG cluster count computations * 🎨 Add metadata to sample data card info * 🐛 Replace na values from cluster col during contig loader pre-processing * 🎨🔥 Add sample removal feature * 🎨 Affix settings and save mag buttons
- Loading branch information
1 parent
bc82dd4
commit 763ec7c
Showing
117 changed files
with
8,805 additions
and
3,434 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 |
---|---|---|
|
@@ -3,4 +3,5 @@ test | |
Automappa.egg-info | ||
build | ||
dist | ||
.vscode | ||
.vscode | ||
.pytest_cache |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,8 @@ build | |
Automappa.egg-info | ||
.env | ||
data | ||
db-data | ||
!automappa/data | ||
db-data | ||
file_system_backend | ||
*.db | ||
uploads |
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 |
---|---|---|
@@ -1,20 +1,17 @@ | ||
FROM condaforge/miniforge3:latest | ||
FROM condaforge/mambaforge:latest | ||
|
||
RUN conda install --prune --name base mamba --yes | ||
|
||
COPY environment.yml ./environment.yml | ||
|
||
RUN mamba env update --name base --file=./environment.yml \ | ||
&& mamba clean --all --force-pkgs-dirs --yes | ||
COPY environment.yml /tmp/environment.yml | ||
RUN mamba env update -n base -f /tmp/environment.yml && \ | ||
mamba clean --all --force-pkgs-dirs --yes | ||
|
||
COPY . /usr/src/app | ||
WORKDIR /usr/src/app | ||
|
||
RUN python -m pip install . --ignore-installed --no-deps -vvv | ||
# Test command is functional | ||
RUN automappa -h | ||
|
||
# Create an unprivileged user for running our Python code. | ||
# Create an unprivileged user for automappa celery worker | ||
RUN adduser --disabled-password --gecos '' automappa | ||
RUN mkdir -p /usr/src/app/uploads && \ | ||
chown -R automappa:automappa /usr/src/app | ||
|
||
# CMD [ "-h" ] | ||
# ENTRYPOINT [ "automappa" ] | ||
# CMD ["automappa", "-h"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
web: gunicorn index:server | ||
web: gunicorn app:server --workers 4 | ||
queue: celery --concurrency=2 --app=automappa.tasks.queue worker --loglevel=INFO --uid automappa -E |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,29 @@ | ||
import dash_bootstrap_components as dbc | ||
|
||
from dash_extensions.enrich import ( | ||
DashProxy, | ||
ServersideOutputTransform, | ||
) | ||
import dash_uploader as du | ||
from automappa.data.database import redis_backend, file_system_backend | ||
from automappa import settings | ||
|
||
from dash_extensions.enrich import DashProxy | ||
from flask_caching import Cache | ||
from automappa.settings import server,celery | ||
# from automappa.tasks import long_callback_manager | ||
|
||
app = DashProxy( | ||
name=__name__, | ||
title="Automappa", | ||
external_stylesheets=[dbc.themes.LUX, dbc.icons.BOOTSTRAP], | ||
update_title="Automapping...", | ||
suppress_callback_exceptions=True, | ||
# long_callback_manager=long_callback_manager, | ||
prevent_initial_callbacks=False, | ||
use_pages=True, | ||
pages_folder="", | ||
transforms=[ | ||
ServersideOutputTransform( | ||
default_backend=[file_system_backend], | ||
backends=[redis_backend, file_system_backend], | ||
), | ||
], | ||
) | ||
cache = Cache(app.server, config={ | ||
# try 'filesystem' if you don't want to setup redis | ||
'CACHE_TYPE': 'redis', | ||
'CACHE_REDIS_URL': celery.backend_url | ||
}) | ||
du.configure_upload(app=app, folder=server.root_upload_folder) | ||
|
||
du.configure_upload(app=app, folder=settings.server.root_upload_folder) |
Oops, something went wrong.