Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement snakemake analysis #472

Open
wants to merge 128 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 126 commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
ac033b0
testing snakemake functionality
adamcantor22 Jun 7, 2024
f9af3e8
anova and permanova metric-independent
adamcantor22 Jun 7, 2024
156ab51
restructuring
adamcantor22 Jun 11, 2024
0118422
starting new analysis structure
adamcantor22 Jun 14, 2024
2e660cf
seaborn install
adamcantor22 Jun 14, 2024
311b93e
seaborn install
adamcantor22 Jun 14, 2024
e11b3d8
analysis setup and pipeline working
adamcantor22 Jun 17, 2024
93cc607
replace tool_type with workflow_type. REMEMBER TO UPDATE MONGODB WITH…
adamcantor22 Jun 18, 2024
9b45d38
more generalizable workflow setup
adamcantor22 Jun 24, 2024
58322e1
folder restructuring
adamcantor22 Jun 24, 2024
41895a6
lefse workflow
adamcantor22 Jul 10, 2024
d070ded
lefse workflow file
adamcantor22 Jul 10, 2024
38c2cc4
lefse pipeline and modes
adamcantor22 Jul 12, 2024
8978c29
lefse plots
adamcantor22 Jul 16, 2024
3c036cb
versions
adamcantor22 Jul 16, 2024
93bc619
versions
adamcantor22 Jul 16, 2024
1a773eb
versions
adamcantor22 Jul 16, 2024
3457c77
versions
adamcantor22 Jul 16, 2024
abe222c
more versions
adamcantor22 Jul 17, 2024
1adcb0c
workflow updates
adamcantor22 Jul 17, 2024
bd82876
the conda environments work now, although not due to this code change
adamcantor22 Jul 17, 2024
0be7d6b
remove testing of old tools
adamcantor22 Jul 17, 2024
d7c0559
lefse analysis working as jobfile
adamcantor22 Jul 18, 2024
b6e054a
reorder module load
adamcantor22 Jul 18, 2024
1f2a4b2
standard pipeline working partial cases
adamcantor22 Jul 18, 2024
6d318f7
working on old tests
adamcantor22 Jul 18, 2024
9e0ba57
working old tests
adamcantor22 Jul 19, 2024
f4abb71
add dummy classifier to tests
adamcantor22 Jul 19, 2024
5bd8bfb
put it in the right spot
adamcantor22 Jul 19, 2024
02bdc66
don't check process length if none found
adamcantor22 Jul 19, 2024
d4fb501
increase how much time is spent checking current processes due to lon…
adamcantor22 Jul 19, 2024
a39aeb6
Actually do that instead of making an infinite loop
adamcantor22 Jul 19, 2024
6188497
Cleanup pipe after test_a
adamcantor22 Jul 19, 2024
2b1f554
Typo
adamcantor22 Jul 19, 2024
5e26e10
Debugging
adamcantor22 Jul 19, 2024
3dde727
new method checking current procs
adamcantor22 Jul 22, 2024
bf97168
debugging current procs
adamcantor22 Jul 22, 2024
88b1bce
show logger
adamcantor22 Jul 22, 2024
7415cd7
show logger on failure
adamcantor22 Jul 22, 2024
bb8b137
use existing action instead of echo/cat
adamcantor22 Jul 22, 2024
56bbdd0
debug
adamcantor22 Jul 22, 2024
7295d07
remove unimportant logs
adamcantor22 Jul 22, 2024
d374314
swap order
adamcantor22 Jul 22, 2024
2ba4564
use command
adamcantor22 Jul 22, 2024
5613bee
correct id
adamcantor22 Jul 22, 2024
6df53db
try action fork
adamcantor22 Jul 22, 2024
1119475
fixing analysis process
adamcantor22 Jul 22, 2024
725b46e
debugging
adamcantor22 Jul 23, 2024
a4b4ba1
pad runtimes
adamcantor22 Jul 23, 2024
c5dc533
revert permissions
adamcantor22 Jul 23, 2024
e9adf9c
updating jupyter env, this is not a good system
adamcantor22 Jul 23, 2024
972f9bf
updating pandas
adamcantor22 Jul 23, 2024
5f0f0d7
more versions
adamcantor22 Jul 23, 2024
26d3166
removing summaries testing, not implemented for new features
adamcantor22 Jul 23, 2024
345a0af
brackets around categories
adamcantor22 Jul 24, 2024
7ce6fe7
codecov v4
adamcantor22 Jul 24, 2024
d4dbc95
better lefse rules
adamcantor22 Jul 24, 2024
2125e08
tools in manifest
adamcantor22 Jul 24, 2024
87c18e9
correct dirs
adamcantor22 Jul 24, 2024
163c24d
token
adamcantor22 Jul 24, 2024
d64ffca
still create empty pdf
adamcantor22 Jul 24, 2024
6fc0a50
correct else
adamcantor22 Jul 24, 2024
97b839c
lefse readability
adamcantor22 Jul 24, 2024
778de4b
Merge branch 'Enhancement-SnakemakeAnalysis' of https://github.com/cl…
adamcantor22 Jul 24, 2024
48fac27
testing analysis
adamcantor22 Jul 25, 2024
1ce36d4
comment pdf summary setup
adamcantor22 Jul 25, 2024
d1f868a
testing sequencing runs in analysis
adamcantor22 Jul 25, 2024
df720d5
separate test users
adamcantor22 Jul 25, 2024
4bca62d
correct study name, wait for upload
adamcantor22 Jul 25, 2024
2e85fc5
reset permissions
adamcantor22 Aug 5, 2024
9bb6cfb
try to get concurrently running watcher process to be recorded in cod…
adamcantor22 Aug 5, 2024
168ae81
test revert
adamcantor22 Aug 5, 2024
9397f48
append to coverage
adamcantor22 Aug 5, 2024
657acd0
not for server tests
adamcantor22 Aug 5, 2024
8fb72b5
snakemake tests
adamcantor22 Aug 6, 2024
4c27630
test
adamcantor22 Aug 6, 2024
36d47b1
remove snakemake logs
adamcantor22 Aug 6, 2024
b1a8ad2
gitignore
adamcantor22 Aug 6, 2024
562a12a
add to pipeline
adamcantor22 Aug 6, 2024
8805679
install graphviz separately because it won't go into a /bin
adamcantor22 Aug 6, 2024
f2f2b03
add append to coverage run command
adamcantor22 Aug 6, 2024
11ce90c
try to get watcher to report its coverage
adamcantor22 Aug 6, 2024
096c26b
typo
adamcantor22 Aug 6, 2024
d3d001f
specify coverage file locations
adamcantor22 Aug 6, 2024
6ffca14
run watcher as a subprocess on github actions
adamcantor22 Aug 6, 2024
4eca2a4
dont make an infinite loop
adamcantor22 Aug 6, 2024
2e0c7f4
get spawn to track
adamcantor22 Aug 7, 2024
979423b
correct syntax
adamcantor22 Aug 7, 2024
93add91
coveragerc path
adamcantor22 Aug 7, 2024
8872446
folder breakdown by var
adamcantor22 Aug 7, 2024
b855e00
Merge branch 'Enhancement-SnakemakeAnalysis' of https://github.com/cl…
adamcantor22 Aug 7, 2024
9a474a9
correct paths
adamcantor22 Aug 7, 2024
eab32cf
test files
adamcantor22 Aug 7, 2024
1e45a90
pathing
adamcantor22 Aug 7, 2024
b6379c9
NAs in filenames
adamcantor22 Aug 7, 2024
1bd98e6
pathing in DAA
adamcantor22 Aug 7, 2024
23dbe02
remove tool class
adamcantor22 Aug 7, 2024
e4070c6
dont test something that doesnt exist
adamcantor22 Aug 7, 2024
6fa1859
cleanup
adamcantor22 Aug 7, 2024
5c4d9c9
job template
adamcantor22 Aug 7, 2024
61e8ffe
moving tool tests to analysis tests
adamcantor22 Aug 8, 2024
21174d5
moving files
adamcantor22 Aug 8, 2024
c51eb0e
fix object control
adamcantor22 Aug 8, 2024
e33eaa8
update workflow
adamcantor22 Aug 8, 2024
8894169
pip not apt
adamcantor22 Aug 8, 2024
976ccb3
adding lefse tests
adamcantor22 Aug 8, 2024
527a2ea
deprecating summaries for now
adamcantor22 Aug 8, 2024
faeb16e
cleaning up development stuff
adamcantor22 Aug 8, 2024
cc19791
changing pipeline name
adamcantor22 Aug 8, 2024
82b3919
changing pipeline name
adamcantor22 Aug 8, 2024
8d80f94
generalizing filter to two classes for both lefse and ancombc
adamcantor22 Aug 14, 2024
cd5490c
diversity output as directory
adamcantor22 Aug 14, 2024
44a3352
dashes for table filtering
adamcantor22 Aug 14, 2024
1ee83ec
limit ancombc filterings
adamcantor22 Aug 14, 2024
e847c91
handle ancombc edge case with two classes + nan, also make filtered t…
adamcantor22 Aug 14, 2024
c35d3f0
fix building phylo tree
adamcantor22 Aug 14, 2024
fcacec6
typos
adamcantor22 Aug 14, 2024
a51ff5a
fix table extraction ambiguity
adamcantor22 Aug 14, 2024
fbaa65a
typo
adamcantor22 Aug 14, 2024
45c0da7
give more complex process more memory
adamcantor22 Aug 14, 2024
70b7cab
fixing ancombc, did not need all those splits
adamcantor22 Aug 15, 2024
2831e0c
unneccesary resource management
adamcantor22 Aug 15, 2024
50af8ab
missing conda env spec
adamcantor22 Aug 16, 2024
33ce251
give ancombc more memory
adamcantor22 Aug 16, 2024
0149bf9
remove previous
adamcantor22 Aug 16, 2024
79ee4a6
verbose
adamcantor22 Aug 16, 2024
2d1dba6
unique() fix and template updates
adamcantor22 Aug 30, 2024
5125c48
dual barcodes updates
adamcantor22 Sep 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 44 additions & 17 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Set PYTHONPATH
run: echo "PYTHONPATH=." >> $GITHUB_ENV

- name: Install packages
run: pip install -U pip; pip install cryptography; pip install jupyter_client==6.1.12; pip install ipython_genutils==0.2.0; pip install nbconvert==5.6.1; pip install rpy2; pip install ipykernel; pip install pandas==1.2.3; pip install pillow; pip install -U Jinja2==3.0
run: pip install -U pip; pip install cryptography; pip install jupyter_client==6.1.12; pip install ipython_genutils==0.2.0; pip install nbconvert==5.6.1; pip install rpy2; pip install ipykernel; pip install pandas==1.2.3; pip install pillow; pip install -U Jinja2==3.0; pip install coverage;

- name: install pandoc
run: sudo apt-get install pandoc;
Expand All @@ -26,25 +30,28 @@ jobs:
- name: Mysql Setup
run: mysql -u root -proot < setup.sql
- name: Server data setup
run: mkdir /home/runner/mmeds_server_data; mkdir /home/runner/conda_envs; mkdir -p /home/runner/conda_env_files/pheniqs; mkdir -p /home/runner/.modules/modulefiles; cp -r ./test_files /home/runner/mmeds_server_data/.; cp ./mmeds/resources/mmeds_stats.yaml /home/runner/mmeds_server_data/.; cp -r ./modules/* /home/runner/.modules/modulefiles/.; cp -r ./conda_env_files/* /home/runner/conda_env_files/.;

run: mkdir /home/runner/mmeds_server_data; mkdir /home/runner/conda_envs; mkdir -p /home/runner/conda_env_files/pheniqs; mkdir -p /home/runner/.modules/modulefiles; cp -r ./test_files /home/runner/mmeds_server_data/.; cp ./mmeds/resources/mmeds_stats.yaml /home/runner/mmeds_server_data/.; cp -r ./modules/* /home/runner/.modules/modulefiles/.; cp -r ./conda_env_files/* /home/runner/conda_env_files/.; mkdir /home/runner/mmeds_server_data/taxonomic_databases; touch /home/runner/mmeds_server_data/taxonomic_databases/dummy_classifier.qza;
- name: Python install
run: sudo python setup.py install --verbose; pip install wheel; pip install git+https://github.com/clemente-lab/mmeds-meta@$GITHUB_REF_NAME;

- name: install jupyter
run: conda env create -f ./conda_env_files/jupyter_env-github.yaml -p /home/runner/conda_envs/jupyter;
#- name: install jupyter
#run: conda env create -f ./conda_env_files/jupyter_env-github.yaml -p /home/runner/conda_envs/jupyter;


- name: add bioconda channel for qiime
run: conda config --append channels conda-forge --append channels bioconda --append channels defaults

- name: install qiime
run: conda env create -f ./conda_env_files/qiime2-2020.8_env.yaml -p /home/runner/conda_envs/qiime2-2020.8

- name: install R
run: sudo apt install dirmngr gnupg apt-transport-https ca-certificates software-properties-common; sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9; sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'; sudo apt install r-base;

#- name: install R
#run: sudo apt install dirmngr gnupg apt-transport-https ca-certificates software-properties-common; sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9; sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'; sudo apt install r-base;

- name: install R dependencies
run: sudo Rscript -e 'install.packages("GGally",dependencies=TRUE)'; sudo Rscript -e 'install.packages("ggrepel",dependencies=TRUE)'; sudo Rscript -e 'install.packages("RColorBrewer",dependencies=TRUE)'; sudo Rscript -e 'install.packages("ggplot2",dependencies=TRUE)';
#- name: install R dependencies
#run: sudo Rscript -e 'install.packages("GGally",dependencies=TRUE)'; sudo Rscript -e 'install.packages("ggrepel",dependencies=TRUE)'; sudo Rscript -e 'install.packages("RColorBrewer",dependencies=TRUE)'; sudo Rscript -e 'install.packages("ggplot2",dependencies=TRUE)';


- name: install pheniqs
run: conda env create -f ./conda_env_files/pheniqs_env.yaml -p /home/runner/conda_envs/pheniqs
Expand All @@ -54,7 +61,6 @@ jobs:

- name: Unit Tests
run: |
coverage run --parallel-mode --concurrency=multiprocessing ./mmeds/host/manager.py&
coverage run --parallel-mode --concurrency=multiprocessing ./mmeds/tests/unit/test.py analysis demultiplex;

- uses: actions/upload-artifact@v3
Expand All @@ -63,7 +69,9 @@ jobs:
path: /home/runner/mmeds_server_data/test_files/test_study/Qiime2_0/summary/[email protected]

- name: Upload Unit coverage
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}

run-tests-simple:
runs-on: ubuntu-20.04
Expand All @@ -74,7 +82,10 @@ jobs:
with:
python-version: 3.9
- name: Install packages
run: pip install -U pip; sudo apt-get install tidy environment-modules -y; pip install cryptography;
run: pip install -U pip; sudo apt-get install tidy environment-modules -y; pip install cryptography; pip install coverage;

- name: Set PYTHONPATH
run: echo "PYTHONPATH=." >> $GITHUB_ENV

- name: Start Services
run: sudo systemctl start mysql.service; sudo systemctl start mongod.service;
Expand All @@ -83,21 +94,25 @@ jobs:
run: mysql -u root -proot < setup.sql

- name: Server data setup
run: mkdir /home/runner/mmeds_server_data; mkdir /home/runner/conda_envs; mkdir -p /home/runner/conda_env_files/pheniqs; mkdir -p /home/runner/.modules/modulefiles; cp -r ./test_files /home/runner/mmeds_server_data/.; cp ./mmeds/resources/mmeds_stats.yaml /home/runner/mmeds_server_data/.; cp -r ./modules/* /home/runner/.modules/modulefiles/.; cp -r ./conda_env_files/* /home/runner/conda_env_files/.;
run: mkdir /home/runner/mmeds_server_data; mkdir /home/runner/conda_envs; mkdir -p /home/runner/conda_env_files/pheniqs; mkdir -p /home/runner/.modules/modulefiles; cp -r ./test_files /home/runner/mmeds_server_data/.; cp ./mmeds/resources/mmeds_stats.yaml /home/runner/mmeds_server_data/.; cp -r ./modules/* /home/runner/.modules/modulefiles/.; cp -r ./conda_env_files/* /home/runner/conda_env_files/.; mkdir /home/runner/mmeds_server_data/taxonomic_databases; touch /home/runner/mmeds_server_data/taxonomic_databases/dummy_classifier.qza;

- name: Python install
run: sudo python setup.py install --verbose; pip install wheel; pip install git+https://github.com/clemente-lab/mmeds-meta@$GITHUB_REF_NAME;

- name: Install GraphViz
run: sudo apt-get install graphviz

- name: install pheniqs
run: conda env create -f ./conda_env_files/pheniqs_env.yaml -p /home/runner/conda_envs/pheniqs

- name: Unit Tests
run: |
coverage run --parallel-mode --concurrency=multiprocessing ./mmeds/host/manager.py&
coverage run --parallel-mode --concurrency=multiprocessing ./mmeds/tests/unit/test.py adder authentication database documents error formatter spawn tool tools uploader util validate;
coverage run --parallel-mode --concurrency=multiprocessing ./mmeds/tests/unit/test.py adder authentication database documents error formatter tools uploader util validate spawn snakemake;

- name: Upload Unit coverage
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Server Tests
run: |
Expand All @@ -106,8 +121,20 @@ jobs:
pytest --cov=mmeds -W ignore::DeprecationWarning -W ignore::FutureWarning -s ./mmeds/tests/server/test_server.py -x --durations=0;

- name: Upload Server Coverage
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Metadata Tests
run: pytest --cov=mmeds -W ignore::DeprecationWarning -W ignore::FutureWarning -s ./mmeds/tests/metadata/test_error_metadata.py;

- name: Load File Action
if: failure()
id: read_file
uses: guibranco/github-file-reader-action-v2@latest
with:
path: "/home/runner/mmeds_server_data/MMEDS_log.txt"

- name: Print MMEDS Logs
if: failure()
run: echo "${{ steps.read_file.outputs.contents }}"
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ htmlcov/

# My Git tags file
tags

# Snakemake work files
**/.snakemake
**/.snakemake/*
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ include mmeds/html/*
include mmeds/CSS/*
include mmeds/resources/*
include mmeds/test_files/*
include mmeds/tools/*
include mmeds/snakemake/*
include mmeds/snakemake/rules/*
include mmeds/snakemake/workflows/*
10 changes: 6 additions & 4 deletions conda_env_files/jupyter_env-github.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
name: jupyter
channels:
- conda-forge
- bioconda
dependencies:
- python=3.9
- jupyter_client=6.1.12
- nbconvert=5.6.1
- rpy2
- ipykernel
- pandas=1.2.3
- pandas=2.2.2
- pillow
- ipython_genutils=0.2.0
- Jinja2=3.0
- ipython_genutils
- Jinja2
- r-base=4.1
- r-ggrepel
- r-GGally
- pip
- pip:
- git+https://github.com/clemente-lab/mmeds-meta@Enhancement-PreviousChanges
- git+https://github.com/clemente-lab/mmeds-meta@Enhancement-SnakemakeAnalysis
# at the moment, I don't have a better solution other than changing this branch for each pull request


4 changes: 2 additions & 2 deletions conda_env_files/qiime2-2020.8_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ dependencies:
- scikit-bio=0.5.5
- scikit-learn=0.23.1
- scipy=1.5.2
- seaborn=0.10.1
- seaborn-base=0.10.1
- seaborn=0.11.1
- seaborn-base=0.11.1
- send2trash=1.5.0
- sepp=4.3.10
- setuptools=49.6.0
Expand Down
109 changes: 70 additions & 39 deletions mmeds/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import mmeds.secrets as sec
import mmeds.html as html
import mmeds.resources as resources
import mmeds.snakemake as snakemake
import mmeds
import hashlib
import re
Expand All @@ -20,16 +21,18 @@
IS_PRODUCTION = 'web01' in getfqdn().split('.')

# While this is false, users cannot be added, cannot upload, and cannot query from webpage
LIVE_PROD_ACCESS = False
LIVE_PROD_ACCESS = True

# Every MMEDs script imports config.py and thus tries to connect to the database even if it doesn't need to
# this flag is just to disable that behavior as necessary
DB_INSTALLED = True

ROOT = Path(mmeds.__file__).parent.resolve()
HTML_DIR = Path(html.__file__).parent.resolve()
STORAGE_DIR = Path(resources.__file__).parent.resolve()
SNAKEMAKE_DIR = Path(snakemake.__file__).parent.resolve()

if TESTING:
ROOT = Path(mmeds.__file__).parent.resolve()
HTML_DIR = Path(html.__file__).parent.resolve()
STORAGE_DIR = Path(resources.__file__).parent.resolve()
# If apache is trying to access apache's home directory for `mmeds_server_data` rather than your user account's home
# you may need to hardcode the path here
# TODO: Add mmeds configuration options for DATABASE_DIR
Expand All @@ -44,21 +47,13 @@
SERVER_PATH = 'http://localhost/myapp/'
CSS_DIR = 'http://localhost/CSS/'
IMAGE_PATH = str(CSS_DIR) + '/'

else:
# We're on web01 and using MMEDs out of if it's project diredctory
# OR, we're in the folder /sc/arion/projects/MMEDS
# TODO: this isn't great, means we have to be careful not naming folders, files as MMEDS
# However, it's a solution that doesn't add any dependancies, and I think we should rework config.py anyway
if 'matt' in Path.cwd().parts and 'clemej05a' in Path.cwd().parts:
DATABASE_DIR = Path('/hpc/users/stapym01') / 'mmeds_server_data'
ROOT = Path('/sc/arion/projects/clemej05a/matt/mmeds-meta/')
else:
DATABASE_DIR = Path('/sc/arion/projects/MMEDS/mmeds_server_data')
ROOT = Path('/hpc/users/mmedsadmin/www/mmeds-meta/')
DATABASE_DIR = Path('/sc/arion/projects/MMEDS/mmeds_server_data')

Check warning on line 54 in mmeds/config.py

View check run for this annotation

Codecov / codecov/patch

mmeds/config.py#L54

Added line #L54 was not covered by tests

HTML_DIR = ROOT / 'mmeds/html'
CSS_DIR = ROOT / 'mmeds/CSS'
STORAGE_DIR = ROOT / 'mmeds/resources'
CSS_DIR = ROOT / 'CSS'

Check warning on line 56 in mmeds/config.py

View check run for this annotation

Codecov / codecov/patch

mmeds/config.py#L56

Added line #L56 was not covered by tests
WWW_ROOT = "https://mmedsadmin.dmz.hpc.mssm.edu/"
SERVER_ROOT = WWW_ROOT + "mmeds_app/"
# Replace the old version
Expand All @@ -67,9 +62,13 @@
IMAGE_PATH = WWW_ROOT + 'mmeds/CSS/'


TOOLS_DIR = ROOT / 'tools'
STUDIES_DIR = DATABASE_DIR / 'studies'
SEQUENCING_DIR = DATABASE_DIR / 'sequencing_runs'
SESSION_PATH = DATABASE_DIR / 'CherryPySessions'
TAXONOMIC_DATABASE_DIR = DATABASE_DIR / "taxonomic_databases"
SNAKEMAKE_WORKFLOWS_DIR = SNAKEMAKE_DIR / "workflows"
SNAKEMAKE_RULES_DIR = SNAKEMAKE_DIR / "rules"

############################
# CONFIGURE SERVER GLOBALS #
Expand Down Expand Up @@ -263,23 +262,42 @@
'#': '#',
}

##########################
# CONFIGURE TOOL GLOBALS #
###########################


TOOL_FILES = {
'child_analysis': ['otu_table'],
'qiime1': ['data', 'for_reads', 'rev_reads', 'barcodes', 'for_barcodes', 'rev_barcodes', 'metadata'],
'qiime2': ['data', 'for_reads', 'rev_reads', 'barcodes', 'for_barcodes', 'rev_barcodes', 'metadata'],
'sparcc': ['otu_table'],
'cutie': ['otu_table'],
'lefse': ['lefse_table'],
'picrust1': ['otu_table'],
'picrust2': ['otu_table'],
'test': []
##############################
# CONFIGURE ANALYSIS GLOBALS #
##############################


WORKFLOWS = {
"core_pipeline_taxonomic": {
"parameters": [
'sampling_depth',
'metadata',
'alpha_metrics',
'beta_metrics',
'taxonomic_database',
'sequencing_runs',
'taxa_levels'
]
},
"lefse": {
"parameters": [
"tables",
"classes",
"subclasses"
]
}
}

TAXONOMIC_DATABASES = {
"greengenes": TAXONOMIC_DATABASE_DIR / "gg-13-8-99-nb-2020-8-0.qza",
"greengenes2": TAXONOMIC_DATABASE_DIR / "greengenes2.2020-10.nb-classifier.qza",
"silva": TAXONOMIC_DATABASE_DIR / "silva-138-99-nb-classifier.qza"
}

if TESTING:
TAXONOMIC_DATABASES["test"] = TAXONOMIC_DATABASE_DIR / "dummy_classifier.qza"


UPLOADED_FP = 'uploaded_file'
ERROR_FP = 'error_log.tsv'

Expand Down Expand Up @@ -332,17 +350,13 @@

CURRENT_PROCESSES = DATABASE_DIR / 'current_processes.yaml'
CONFIG_PARAMETERS = {
'qiime2': [
'core_pipeline_taxonomic': [
'sampling_depth',
'metadata',
'taxa_levels',
'abundance_threshold',
'font_size',
'sub_analysis',
'additional_analysis',
'iterations',
'permutations',
'type'],
'alpha_metrics',
'beta_metrics',
'sequencing_runs',
'taxa_levels'],
'cutie': [
'statistic',
'feature_table',
Expand All @@ -360,6 +374,18 @@
'permutations'],
'test': []
}

CONFIG_LISTS = [
'metadata',
'taxa_levels',
'alpha_metrics',
'beta_metrics',
'sequencing_runs',
'tables',
'classes',
'subclasses'
]

CONTACT_EMAIL = '[email protected]'
MMEDS_EMAIL = '[email protected]'
TEST_EMAIL = '[email protected]'
Expand Down Expand Up @@ -400,6 +426,7 @@
TEST_CODE_SHORT = 'singlereadsshort'
TEST_CODE_PAIRED = 'pairedreads'
TEST_CODE_DEMUX = 'demuxedreads'
TEST_CODE_MIXED = 'mixedstudy'
TEST_CODE_OTU = 'otutable'
TEST_CODE_LEFSE = 'lefsetable'
TEST_MIXS = str(TEST_PATH / 'test_MIxS.tsv')
Expand All @@ -422,6 +449,7 @@
str(TEST_PATH / 'test_stripped_1'),
str(TEST_PATH / 'test_stripped_2')
]
TEST_SNAKEMAKE_DIR = str(TEST_PATH / 'test_snakemake')
TEST_PHENIQS_MAPPING = str(TEST_PATH / 'test_pheniqs_mapping_file.tsv')
TEST_STUDY = str(TEST_PATH / 'test_study')
TEST_SPECIMEN = str(TEST_PATH / 'test_specimen.tsv')
Expand All @@ -443,6 +471,7 @@
TEST_ADD_SUBJECT = str(TEST_PATH / 'test_add_subject.tsv')
TEST_ANIMAL_SUBJECT = str(TEST_PATH / 'test_animal_subject.tsv')
TEST_MIXED_SUBJECT = str(TEST_PATH / 'test_mixed_subject.tsv')
TEST_MIXED_SPECIMEN = str(TEST_PATH / 'test_mixed_specimen.tsv')
TEST_SUBJECT_ERROR = str(TEST_PATH / 'validation_files/test_subject_error.tsv')
TEST_SUBJECT_WARN = str(TEST_PATH / 'validation_files/test_subject_warn.tsv')
TEST_SUBJECT_ALT = str(TEST_PATH / 'test_subject_alt.tsv')
Expand Down Expand Up @@ -478,6 +507,8 @@
SPECIMEN_TEMPLATE = str(TEST_PATH / 'specimen_template.tsv')
CONFIG_EXAMPLE = str(TEST_PATH / 'config_example.yaml')

TEST_SEQUENCING_NAME = "TEST_RUN"


# Defaults
QIIME_SAMPLE_ID_CATS = ('#SampleID', '#q2:types')
Expand Down
Loading
Loading