Skip to content

Commit 95680d0

Browse files
committed
pivot back to microSALT
1 parent 8e0de4d commit 95680d0

31 files changed

+276
-272
lines changed

.github/pull_request_template.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Description
2+
23
_##Remove elements in cursive as needed.##_
34

45
_The features of this PR primarily concerns end-users/bioinformaticians/internals_
@@ -8,33 +9,38 @@ _Summary of the changes made:_
89
_If not self-evident, mention what prompted the change._
910

1011
## Primary function of PR
11-
- [ ] Hotfix
12-
- [ ] Patch
13-
- [ ] Minor functionality improvement
14-
- [ ] New type of analysis
15-
- [ ] Backward-breaking functionality improvement
16-
- [ ] This change requires internal documents to be updated
17-
- [ ] This change requires another repository to be updated
12+
13+
- [ ] Hotfix
14+
- [ ] Patch
15+
- [ ] Minor functionality improvement
16+
- [ ] New type of analysis
17+
- [ ] Backward-breaking functionality improvement
18+
- [ ] This change requires internal documents to be updated
19+
- [ ] This change requires another repository to be updated
1820

1921
# Testing
22+
2023
_If the update is a hotfix, it is sufficient to rely on the development testing along with the Travis self-test automatically applied to the PR._
2124

2225
_Test routine to verify the stability of the PR:_
23-
- _`bash /home/proj/production/servers/resources/hasta.scilifelab.se/install-microsalt-stage.sh BRANCHNAME`_
24-
- _`us`_
25-
- _`conda activate S_microSALT`_
26-
- _(SITUATIONAL) `export MICROSALT_CONFIG=/home/proj/dropbox/microSALT.json`_
27-
- _Select a relevant subset of the following:_
28-
- _`microsalt analyse project MIC3109`_
29-
- _`microsalt analyse project MIC4107`_
30-
- _`microsalt analyse project MIC4109`_
31-
- _`microsalt analyse project ACC5551`_
26+
27+
- _`bash /home/proj/production/servers/resources/hasta.scilifelab.se/install-microSALT-stage.sh BRANCHNAME`_
28+
- _`us`_
29+
- _`conda activate S_microSALT`_
30+
- _(SITUATIONAL) `export MICROSALT_CONFIG=/home/proj/dropbox/microSALT.json`_
31+
- _Select a relevant subset of the following:_
32+
- _`microSALT analyse project MIC3109`_
33+
- _`microSALT analyse project MIC4107`_
34+
- _`microSALT analyse project MIC4109`_
35+
- _`microSALT analyse project ACC5551`_
3236

3337
_Verify that the results for projects MIC3109, MIC4107, MIC4109 & ACC5551 are consistent with the results attached to AMSystem doc 1490, Microbial_WGS.xlsx_
3438

3539
## Test results
40+
3641
_These are the results of the tests, and necessary conclusions, that prove the stability of the PR._
3742

3843
# Sign-offs
39-
- [ ] Code tested by @octocat
40-
- [ ] Approved to run at Clinical-Genomics by @karlnyr
44+
45+
- [ ] Code tested by @octocat
46+
- [ ] Approved to run at Clinical-Genomics by @karlnyr

.github/workflows/run_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
3939
- name: Test with pytest
4040
run: |
41-
pytest --cov=microsalt tests
41+
pytest --cov=microSALT tests
4242
- name: Run Coveralls
4343
run: |
4444
coveralls

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.DS_Store
22

3-
microsalt/__pycache__
4-
microsalt.log
3+
microSALT/__pycache__
4+
microSALT.log
55
instance/sqlalchemy_config.py
66
instance/paths.yml
77
unique_references/*.n*

DEPLOYMENT.md

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,32 @@ When all tests done and successful and PR is approved by codeowners, follow thes
55
1. Ensure that you update the version in `microSALT/__init__.py`
66
2. Select "Squash and merge" to merge branch into default branch (master).
77
3. Deploy master to stage:
8-
1. Log in to appropriate server `ssh <server.scilifelab.se>`
9-
2. `us`
10-
3. Install microSALT using **one** of the following commands
11-
1. If you have updated the `environment.yml`:
12-
```shell
13-
sudo -iu hiseq.clinical
14-
us
15-
bash /home/proj/production/servers/resources/hasta.scilifelab.se/install-microsalt-stage.sh master
16-
```
17-
2. Otherwise run:
18-
```shell
19-
bash /home/proj/production/servers/resources/hasta.scilifelab.se/update-tool-stage.sh -e S_microSALT -t microSALT -b master
20-
```
21-
4. Make sure that the installation was successful
8+
1. Log in to appropriate server `ssh <server.scilifelab.se>`
9+
2. `us`
10+
3. Install microSALT using **one** of the following commands
11+
1. If you have updated the `environment.yml`:
12+
```shell
13+
sudo -iu hiseq.clinical
14+
us
15+
bash /home/proj/production/servers/resources/hasta.scilifelab.se/install-microSALT-stage.sh master
16+
```
17+
2. Otherwise run:
18+
```shell
19+
bash /home/proj/production/servers/resources/hasta.scilifelab.se/update-tool-stage.sh -e S_microSALT -t microSALT -b master
20+
```
21+
4. Make sure that the installation was successful
2222
4. Deploy master to production:
23-
1. Log in to appropriate server `ssh <server.scilifelab.se>`
24-
2. `up`
25-
3. Install microSALT using **one** of the following commands
26-
1. If you have updated the `environment.yml`:
27-
```shell
28-
sudo -iu hiseq.clinical
29-
up
30-
bash /home/proj/production/servers/resources/hasta.scilifelab.se/install-microsalt-prod.sh
31-
```
32-
2. Otherwise run:
33-
```shell
34-
bash /home/proj/production/servers/resources/hasta.scilifelab.se/update-tool-prod.sh -e P_microSALT -t microSALT -b master
35-
```
36-
4. Make sure that the installation was successful
37-
23+
1. Log in to appropriate server `ssh <server.scilifelab.se>`
24+
2. `up`
25+
3. Install microSALT using **one** of the following commands
26+
1. If you have updated the `environment.yml`:
27+
```shell
28+
sudo -iu hiseq.clinical
29+
up
30+
bash /home/proj/production/servers/resources/hasta.scilifelab.se/install-microSALT-prod.sh
31+
```
32+
2. Otherwise run:
33+
```shell
34+
bash /home/proj/production/servers/resources/hasta.scilifelab.se/update-tool-prod.sh -e P_microSALT -t microSALT -b master
35+
```
36+
4. Make sure that the installation was successful

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
[![Build status](https://github.com/clinical-genomics/microsalt/actions/workflows/run_tests.yml/badge.svg)](https://github.com/clinical-genomics/microsalt/actions/workflows/run_tests.yml)
1+
[![Build status](https://github.com/clinical-genomics/microSALT/actions/workflows/run_tests.yml/badge.svg)](https://github.com/clinical-genomics/microSALT/actions/workflows/run_tests.yml)
22
[![Coverage Status](https://coveralls.io/repos/github/Clinical-Genomics/microSALT/badge.svg?branch=master)](https://coveralls.io/github/Clinical-Genomics/microSALT?branch=master)
33
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4026043.svg)](https://doi.org/10.5281/zenodo.4026043)
44

55
<p align="center">
66
<a href="https://github.com/sylvinite/microSALT">
7-
<img width="1000" height="250" src="artwork/microsalt.jpg"/>
7+
<img width="1000" height="250" src="artwork/microSALT.jpg"/>
88
</a>
99
</p>
1010

11-
__Microbial Sequence Analysis and Loci-based Typing pipeline__
11+
**Microbial Sequence Analysis and Loci-based Typing pipeline**
1212

1313
_The microbial sequence analysis and loci-based typing pipeline (microSALT) is
14-
used to analyse microbial samples. It produces a quality control of the
14+
used to analyse microbial samples. It produces a quality control of the
1515
sample, determines a sample's organism specific sequence type, and its
1616
resistance pattern. microSALT also provides a database storage solution and
1717
report generation of these results._
@@ -42,17 +42,17 @@ cp configExample.json /MY/FAV/FOLDER/config.json
4242
export MICROSALT_CONFIG=/MY/FAV/FOLDER/config.json
4343
```
4444

45-
__Then edit the fields to match your environment__.
45+
**Then edit the fields to match your environment**.
4646

4747
## Usage
4848

49-
- `microsalt analyse` contains functions to start sbatch job(s) & produce
50-
output to `folders['results']`. Afterwards the parsed results are uploaded
51-
to the SQL back-end and produce reports (HTML), which are then automatically
52-
e-mailed to the user.
53-
- `microsalt utils` contains various functionality, including generating the
54-
sample description json, manually adding new reference organisms and
55-
re-generating reports.
49+
- `microSALT analyse` contains functions to start sbatch job(s) & produce
50+
output to `folders['results']`. Afterwards the parsed results are uploaded
51+
to the SQL back-end and produce reports (HTML), which are then automatically
52+
e-mailed to the user.
53+
- `microSALT utils` contains various functionality, including generating the
54+
sample description json, manually adding new reference organisms and
55+
re-generating reports.
5656

5757
## Databases
5858

@@ -71,14 +71,14 @@ Any definitions will work, as long as they retain the same formatting.
7171

7272
### Hardware
7373

74-
- A [SLURM](https://slurm.schedmd.com) enabled HPC system
75-
- A (clarity) LIMS server
74+
- A [SLURM](https://slurm.schedmd.com) enabled HPC system
75+
- A (clarity) LIMS server
7676

7777
### Software
7878

79-
- [Conda](https://conda.io)
80-
- Python 3.6
81-
- [SQLite](https://www.sqlite.org)
79+
- [Conda](https://conda.io)
80+
- Python 3.6
81+
- [SQLite](https://www.sqlite.org)
8282

8383
## Contributing to this repo
8484

@@ -87,7 +87,7 @@ For more information, see https://guides.github.com/introduction/flow/
8787

8888
## Credits
8989

90-
- Isak Sylvin - Lead developer
91-
- Emma Sernstad - Accreditation ready reports
92-
- Tanja Normark - Various issues
93-
- Maya Brandi - Various issues
90+
- Isak Sylvin - Lead developer
91+
- Emma Sernstad - Accreditation ready reports
92+
- Tanja Normark - Various issues
93+
- Maya Brandi - Various issues

configExample.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"_comment": "Report collection folder",
2323
"reports": "/tmp/MLST/reports/",
2424
"_comment": "Log file position and name",
25-
"log_file": "/tmp/microsalt.log",
25+
"log_file": "/tmp/microSALT.log",
2626
"_comment": "Root folder for input fasta sequencing data",
2727
"seqdata": "/tmp/projects/",
2828
"_comment": "ST profiles. Each ST profile file under 'profiles' have an identicial folder under references",
@@ -38,7 +38,7 @@
3838
},
3939
"_comment": "Database/Flask configuration",
4040
"database": {
41-
"SQLALCHEMY_DATABASE_URI": "sqlite:////tmp/microsalt.db",
41+
"SQLALCHEMY_DATABASE_URI": "sqlite:////tmp/microSALT.db",
4242
"SQLALCHEMY_TRACK_MODIFICATIONS": "False",
4343
"DEBUG": "True"
4444
},

microSALT/cli.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
import sys
1010
import logging
1111

12-
from microsalt import __version__
13-
from microsalt.store.database import initialize_database
14-
from microsalt.store.db_manipulator import DB_Manipulator
15-
from microsalt.server.app import initialize_app, get_app
16-
from microsalt.utils.config_loader import load_config
17-
from microsalt.utils.scraper import Scraper
18-
from microsalt.utils.job_creator import Job_Creator
19-
from microsalt.utils.reporter import Reporter
20-
from microsalt.utils.referencer import Referencer
12+
from microSALT import __version__
13+
from microSALT.store.database import initialize_database
14+
from microSALT.store.db_manipulator import DB_Manipulator
15+
from microSALT.server.app import initialize_app, get_app
16+
from microSALT.utils.config_loader import load_config
17+
from microSALT.utils.scraper import Scraper
18+
from microSALT.utils.job_creator import Job_Creator
19+
from microSALT.utils.reporter import Reporter
20+
from microSALT.utils.referencer import Referencer
2121

2222
default_sampleinfo = {
2323
"CG_ID_project": "XXX0000",
@@ -461,7 +461,7 @@ def overwrite(ctx, sample_name, force):
461461

462462
@root.command()
463463
def init_db():
464-
from microsalt.store.orm_models import db
464+
from microSALT.store.orm_models import db
465465

466466
app = get_app()
467467
db.init_app(app)

microSALT/server/app.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import logging
32
import os
43
from pathlib import Path
@@ -7,12 +6,14 @@
76
import sys
87

98
from flask import Flask
10-
from microsalt.server.views import bp
11-
from microsalt.store.orm_models import db
9+
from microSALT.server.views import bp
10+
from microSALT.store.orm_models import db
11+
1212
logger = logging.getLogger("main_logger")
1313

1414
APP: Flask = None
1515

16+
1617
def initialize_app(config: dict) -> None:
1718
global APP
1819
APP = Flask(__name__, template_folder="templates")
@@ -23,11 +24,13 @@ def initialize_app(config: dict) -> None:
2324
db.init_app(APP)
2425
APP.register_blueprint(bp)
2526

27+
2628
def get_app() -> Flask:
2729
if not APP:
2830
raise ValueError("App not initialized")
2931
return APP
3032

33+
3134
def create_path(path: str, logger: logging.Logger):
3235
if not Path(path).exists():
3336
os.makedirs(path)
@@ -37,7 +40,7 @@ def create_path(path: str, logger: logging.Logger):
3740

3841

3942
def handle_config_entry(entry, value, logger):
40-
43+
4144
if isinstance(value, str) and "/" in value and entry not in ["genologics"]:
4245
if os.path.abspath(value) == "/path":
4346
logger.error(f"Path for {entry} is not set.")
@@ -76,6 +79,7 @@ def check_database_integrity(db_file, logger):
7679

7780
logger.info("Database integrity check passed.")
7881

82+
7983
def _setup_app_from_config(app: Flask, config: dict):
8084
app.config.update(config["database"])
8185
app.config["folders"] = config.get("folders", {})
@@ -87,23 +91,23 @@ def _setup_app_from_config(app: Flask, config: dict):
8791
app.config["mlst_span_threshold"] = config["threshold"]["mlst_span"]
8892
app.config["motif_id_threshold"] = config["threshold"]["motif_id"]
8993
app.config["motif_span_threshold"] = config["threshold"]["motif_span"]
90-
91-
92-
94+
9395
# Create paths mentioned in config
9496
create_paths(app.config["folders"], logger)
95-
97+
9698
# Integrity check database
9799
db_file = re.search(
98100
"sqlite:///(.+)",
99101
config["database"]["SQLALCHEMY_DATABASE_URI"],
100102
)[1]
101103
check_database_integrity(db_file, logger)
102104

105+
103106
if __name__ == "__main__":
104-
107+
105108
from microSALT.utils.config_loader import load_config
106-
config = load_config('/Users/karlnyren/github/microSALT/tests/testdata/config.json')
109+
110+
config = load_config("/Users/karlnyren/github/microSALT/tests/testdata/config.json")
107111
initialize_app(config)
108112
app = get_app()
109113
app.run(host="127.0.0.1", port=5001, debug=True, use_reloader=False)

microSALT/server/templates/STtracker_page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<!-- Summary pages -->
77
<footer>
88
<div class="panel"><div class="panel-body">
9-
<a href="https://github.com/Clinical-Genomics/microSALT"><img src="https://github.com/Clinical-Genomics/microSALT/blob/master/artwork/microsalt.jpg?raw=true" alt="MicroSALT Logo" align="left" style="position:absolute;left:15px;width:400px;height:100px;display:flex;"></a>
9+
<a href="https://github.com/Clinical-Genomics/microSALT"><img src="https://github.com/Clinical-Genomics/microSALT/blob/master/artwork/microSALT.jpg?raw=true" alt="MicroSALT Logo" align="left" style="position:absolute;left:15px;width:400px;height:100px;display:flex;"></a>
1010
<!--<img src="swedac.jpg" alt="Swedac Logo" align="right" style="display:flex;">-->
1111
<h2 class="page-header">
1212
<small><br><br><br>Sekvenstypsuppdateringar</small>

microSALT/server/templates/alignment_page.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<footer>
88
<div class="panel"><div class="panel-body">
99
<a href="https://github.com/Clinical-Genomics/microSALT">
10-
<img src="https://github.com/Clinical-Genomics/microSALT/blob/master/artwork/microsalt.jpg?raw=true" \
10+
<img src="https://github.com/Clinical-Genomics/microSALT/blob/master/artwork/microSALT.jpg?raw=true" \
1111
alt="MicroSALT Logo" align="left" \
1212
style="position:absolute;left:15px;width:400px;height:100px;display:flex;"></a>
1313
{% if 'MW' in topsample.application_tag %}
@@ -35,8 +35,8 @@ <h4>{{topsample.projects.Customer_ID}}</h4><br>
3535
</address>
3636
<address>
3737
<strong>microSALT-teamet</strong><br>
38-
<abbr title="F&ouml;rslagsl&aring;da">E:</abbr><a href="mailto:microsalt-suggestions@scilifelab.se?subject=F&ouml;rb&auml;ttringsf&ouml;rslag">
39-
microsalt-suggestions@scilifelab.se
38+
<abbr title="F&ouml;rslagsl&aring;da">E:</abbr><a href="mailto:microSALT-suggestions@scilifelab.se?subject=F&ouml;rb&auml;ttringsf&ouml;rslag">
39+
microSALT-suggestions@scilifelab.se
4040
</a>
4141
</address>
4242
</div>
@@ -237,7 +237,7 @@ <h3>Analysbegr&auml;nsningar f&ouml;r: {{topsample.application_tag}}<br></h3>
237237

238238
<h3>F&ouml;rb&auml;ttringsf&ouml;rslag<br></h3>
239239
<p>
240-
Alla typer av f&ouml;rb&auml;ttringsf&ouml;rslag mailas med f&ouml;rdel till microsalt-suggestions@scilifelab.se<br>
240+
Alla typer av f&ouml;rb&auml;ttringsf&ouml;rslag mailas med f&ouml;rdel till microSALT-suggestions@scilifelab.se<br>
241241
Din &aring;terkopplling uppskattas!
242242
</p>
243243

0 commit comments

Comments
 (0)