Skip to content

Updates to documentation #938

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__pycache__/
.DS_Store
**.DS_Store
.ruff_cache/
.vscode/
*.orig
Expand All @@ -12,9 +12,10 @@ dist/
jquery/
Pipfile
Pipfile.lock
run_dir/genosqlrc.yaml
**genosqlrc.yaml
run_dir/qc_reports/
run_dir/settings.yaml
run_dir/settings/
status.egg-info/
tests/test_items.yaml
**orderportal_cred.yaml
155 changes: 117 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,86 @@

Genomics Status is a Tornado web app for visualizing information and statistics regarding operations by NGI Stockholm at SciLifeLab.

Genomics Status interfaces with StatusDB; the CouchDB database instance used to store metadata in various forms. Documentation about CouchDB can be found [here](http://guide.couchdb.org/).
Genomics Status interfaces with StatusDB, which is a [CouchDB](http://guide.couchdb.org/) database instance used to store metadata in various forms.

## Installing and running genomics status

**NOTE**: These steps assume that:
### Requirements

* you're either running a python virtualenv or you do have root permissions.
* you're running python version 3.6 or later (dicts are ordered by default)
* you have access to both StatusDB and Genologics LIMS

1 - Clone the repository with the `--recursive` option (this will also download [nvd3](http://nvd3.org/) library):
### Installation

```
Clone the repository with the `--recursive` option (this will also download [nvd3](http://nvd3.org/) library):

```bash
git clone --recursive https://github.com/NationalGenomicsInfrastructure/genomics-status.git
```

2 - Install the package (the `pip install -r requirements_dev.txt` can be skipped on a production server)
<details>

<summary>Note on `conda` environments</summary>

#### Create the environment with the correct dependencies

If you decide to use a conda environment, create one making sure to use the `conda_requirements.yml` file with the following command:

```bash
conda env create -n <env_name> -f conda_requirements.yml
```

where `<env_name>` is the name of the environment you want to create. Then, activate the environment with:

```bash
conda activate <env_name>
```
cd status

</details>

Install the dependencies and the package (the `pip install -r requirements_dev.txt` can be skipped on a production server)

```bash
pip install -r requirements.txt
pip install -r requirements_dev.txt
python setup.py install
```

3 - You'll need to install genologics package separately:
<details>

<summary>Note on MacOS installations</summary>

### Fix library issues

If you are using MacOS, you might run into some issues with the libraries when running the app.

In case you get the `OSError: cannot load library 'gobject-2.0-0'` error (or similar), install `glib` and `pango` via [Homebrew](https://brew.sh/):

```bash
brew install glib
brew install pango
```
pip install git+https://github.com/SciLifeLab/genologics.git

and then symlink the libraries to `/usr/local/lib`:

```bash
sudo ln -s /opt/homebrew/opt/glib/lib/libgobject-2.0.0.dylib /usr/local/lib/gobject-2.0
sudo ln -s /opt/homebrew/opt/pango/lib/libpango-1.0.dylib /usr/local/lib/pango-1.0
sudo ln -s /opt/homebrew/opt/harfbuzz/lib/libharfbuzz.dylib /usr/local/lib/harfbuzz
sudo ln -s /opt/homebrew/opt/fontconfig/lib/libfontconfig.1.dylib /usr/local/lib/fontconfig-1
sudo ln -s /opt/homebrew/opt/pango/lib/libpangoft2-1.0.dylib /usr/local/lib/pangoft2-1.0
```

4 - For running, it requires a `settings.yaml` file which points to the CouchDB server to use, and which port to
serve the web app to. You will also need a .genologicsrc file with the API credentials for our Genologics LIMS. The files should look like these:
</details>


### Configuration

Before running the app, you need to configure it. This is done by creating the`settings.yaml` file, which points to
the CouchDB server to use and defines which port to serve the web app to. You will also need to create a `.genologicsrc`
file with the API credentials for our Genologics LIMS, and a `orderportal_cred.yaml` file with the credentials for the
order portal. The files should look like these:

`<status_dir>/run_dir/settings.yaml`:
```yaml
Expand All @@ -42,68 +90,98 @@ username: <tools_username> # same as input above
password: <tools_password> # same as input above
port: 9761
redirect_uri: http://localhost:9761/login
cookie_secret:
couch_url: https://ngi-statusdb-dev.scilifelab.se

# Data Centre's pro subscription
font_awesome_url: https://kit.fontawesome.com/<subscription_id>.js

lims_backend_credential_location: <genologicsrc_location>

order_portal_credential_location: orderportal_cred.yaml

# This can be left like this as long as --testing_mode is used
google_oauth:
key_old: write
key: anything
secret: here
key: <google_oauth_key>
secret: <google_oauth_secret>

zendesk:
url: any
username: thing
token: goes
url: https://ngisweden.zendesk.com
username: <zendesk_username>
token: <zendesk_token>

sftp:
login: will
password: code

contact_person: [email protected]
contact_person: <contact_person_email>

instruments:
HiSeq:
INSTRUMENT_ID: INSTRUMENT_NAME
INSTRUMENT_ID: <Instrument_Name>
MiSeq:
INSTRUMENT_ID: INSTRUMENT_NAME
INSTRUMENT_ID: <Instrument_Name>

slack:
token: <slack_token>

jira:
url: https://scilifelab.atlassian.net
user: <jira_user>
api_token: <jira_api_token>
project_key: NSD

# Trello suggestion box update log
sb_log: suggestion_box.log # Optional

password_seed: not_needed_for_development
psul_log: /home/hiseq.bioinfo/log/LIMS2DB/lims2db_projects.log
charon:
url: https://charon-dev.scilifelab.se
api_token:

# You Trello API credentials, you need a board named "Suggestion Box"
trello:
api_key: <trello_api_key>
api_secret: <trello_api_secret>
token: <trello_token>
# LIMS Dashboard
lims_dashboard_url: https://lims-dashboard.scilifelab.se

uppmax_projects
- proj_id1
- proj_id2
server_status:
instruments:
<instrument_address>: <instrument_name>
<instrument_address>: <instrument_name>
<instrument_address>: <instrument_name>

reports_path: <reports_path>
```

`~/.genologicsrc`:
`.genologicsrc`:
```yaml
[genologics]
BASEURI=https://ngi-lims-stage.scilifelab.se:8443
USERNAME=<lims_api_username>
PASSWORD=<lims_api_password>
```
5 - Run the tornado app from run_dir :

`orderportal_cred.yaml`:
```yaml
order_portal:
api_get_order_url: 'https://ngisweden.scilifelab.se/orders/api/v1/order'
api_token: <order_portal_api_token>
```

### Usage

Run the tornado app from `run_dir`:
```bash
cd run_dir
python ../status_app.py --testing_mode
```

`--testing_mode` will skip the google authentication, which is convenient for testing
The `--testing_mode` flag will skip the google authentication, which is convenient for testing.

The status web app both provides the HTML web interface, and a RESTful api for accessing the data being
visualized on the various pages.

If you've used the `settings.yaml` template above, you should now be able to access the site at `http://localhost:9761/` or `http://localhost:9761/login`


## Generating the custom bootstrap css file
The bootstrap css file is customised to use a smaller font size.
To replicate this, use the following snippet:

```
```bash
conda create -n nodejs
conda activate nodejs
conda install nodejs
Expand All @@ -114,7 +192,7 @@ cd run_dir/static/scss

Then modify the `custom.scss` file, especially the hard-coded path according to your needs, and run the compilation:

```
```bash
sass custom.scss custom-bootstrap-5-alpha.css
```

Expand Down Expand Up @@ -171,6 +249,7 @@ On Genomics Status, templates are located in `status/run_dir/design`


TODO:

- [ ] Fix links to old project page vs new project page
- [ ] Add link to project cards from menu and front page

4 changes: 0 additions & 4 deletions status_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,10 +524,6 @@ def __init__(self, settings):
# Load password seed
self.password_seed = settings.get("password_seed")

# load logins for the genologics sftp
self.genologics_login = settings["sftp"]["login"]
self.genologics_pw = settings["sftp"]["password"]

# Location of the psul log
self.psul_log = settings.get("psul_log")

Expand Down