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

Release/v.1.0.0 #17

Merged
merged 105 commits into from
Jul 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
ae3374e
lots
Jan 6, 2020
605a153
Create LICENSE
nienkevanunen Jan 6, 2020
184fae4
server-sided table manipulation with datatables.js and pymongo
Jan 8, 2020
e555cc4
list all variants (not entirely functional with datatables since not …
Feb 26, 2020
6179bdc
only use pymongo, etc
Mar 2, 2020
e056436
update to newer datatables.js post format
Mar 3, 2020
09dfbad
change structure completely
Mar 4, 2020
115dfde
fix login and register
Mar 25, 2020
4f46dc1
check if user exists before registering
Mar 25, 2020
efe01d5
Update README
nienkevanunen Jun 18, 2020
7de86bb
Rename README to README.md
nienkevanunen Jun 18, 2020
5cba996
Update README.md
nienkevanunen Jun 18, 2020
ea98270
update to requirements
Jun 18, 2020
0d1a148
Merge branch 'dev' of github.com:poofcakes/VUSualizer into dev
Jun 18, 2020
235e1f5
wsgi support
Jun 18, 2020
67c3a4e
remove unused reqs from requirements.txt
Jun 22, 2020
d952c39
WSGIMiddleware addition
Jun 24, 2020
9817aff
use flask_pymongo in datatable.py, fix font awesome errors
Jun 24, 2020
701ae4c
Update run.py
Jun 25, 2020
5432e99
remove a / from readme
nienkevanunen Jul 9, 2020
cd8480c
Update requirements.txt
FiniDG Jul 22, 2020
652f6d3
update progressbar
FiniDG Jul 22, 2020
5d57051
couple bugfixes
Jul 28, 2020
f4d1ebb
Update README.md
nienkevanunen Jul 28, 2020
3132b10
Merge branch 'dev' of https://github.com/UMCUGenetics/VUSualizer into…
FiniDG Jul 29, 2020
f43488a
copied from old vusualiser on dwergeik
FiniDG Jan 6, 2021
24a2ee3
Bump jinja2 from 2.11.2 to 2.11.3
dependabot[bot] Mar 20, 2021
97e0372
updated gitignore for macfiles like DS_store
FiniDG Mar 24, 2021
3e6b9ad
data only visible when logged in
FiniDG Apr 13, 2021
7e6b673
added argparse to get file(s) as parameter instead of input folder
FiniDG May 12, 2021
d63f8f3
Merge pull request #5 from UMCUGenetics/dependabot/pip/jinja2-2.11.3
FiniDG May 18, 2021
9b90a57
changes based on comments pullrequest #6
FiniDG May 18, 2021
8edcd45
argparse import change based on comment pull request
FiniDG May 19, 2021
833972d
Merge pull request #6 from UMCUGenetics/make_login
FiniDG May 19, 2021
3005200
added simple working admin page with UserView
FiniDG May 26, 2021
ce6c97c
updated requirements.txt for admin page (flask-admin)
FiniDG May 26, 2021
093b2e5
added that only admin role can go to userview adminpage
FiniDG Jun 2, 2021
26ba9db
applied Roberts comments about placement + fixed bug import, where DB…
FiniDG Jun 4, 2021
b71e9af
only active user can see the data
FiniDG Jun 7, 2021
652fba8
changed the check for the active status and updated the account_page
FiniDG Jun 9, 2021
8e62971
changed some scripts to make it work on testserver + added logging of…
FiniDG Jun 17, 2021
2c668a3
changed 1 header and e-mail
FiniDG Jun 24, 2021
87e748b
changes based on pull request#8 comments
FiniDG Jun 28, 2021
0f4874e
Merge pull request #8 from UMCUGenetics/feature/make_admin_login
FiniDG Jun 29, 2021
d3cc38d
added functionality to replace data in mongoDB with updated files
FiniDG Jun 30, 2021
9e43870
first format changes according to PEP8
FiniDG Jul 5, 2021
ff517aa
added/deleted comments and removed get_all_fields(), which isn't refe…
FiniDG Jul 6, 2021
c4a83c2
reformatted HTML and removed unnessesary and unfunctional scripts
FiniDG Jul 6, 2021
04c2aff
applied max line length of 127
FiniDG Jul 7, 2021
0b4879a
forgot 2 lines in 127 line rule
FiniDG Jul 7, 2021
0a9bcfb
changes according to pull request #9 suggestions
FiniDG Jul 13, 2021
de1818a
Merge pull request #9 from UMCUGenetics/feature/clean_up_layout
FiniDG Jul 14, 2021
7adf00a
edited gitignore + added upload_to_dwergeik.sh
FiniDG Aug 17, 2021
161f4ce
first working version from Alissa-test server upload to mongoDB
FiniDG Jan 14, 2022
f43d40d
updated requirements
FiniDG Jan 14, 2022
838d0a1
added Alissa Interpret Public API Python Client requirement
FiniDG Jan 20, 2022
50832c6
added LastUpdatedOn, changed logging
FiniDG Feb 2, 2022
99785a5
added LastUpdatedOn functionality in MongoDB to filter Alissa analyses
FiniDG Feb 3, 2022
9f2d884
made longer e-mail names possible
FiniDG Feb 7, 2022
31cd371
fixed oversight on double clients
FiniDG Feb 7, 2022
2dbc479
wrong parameter Alissa replaced
FiniDG Feb 7, 2022
674d194
wrong parameter Alissa replaced again
FiniDG Feb 7, 2022
3f0f46a
wrong parameter Alissa replaced again
FiniDG Feb 7, 2022
b01ad29
fixed lastUpdatedOn and time/date formatting
FiniDG Feb 8, 2022
489cccf
changes based on code review pull #10
FiniDG Feb 22, 2022
201e704
changed lastUpdatedOn when no analysis found
FiniDG Feb 24, 2022
cd43b9c
replaced redundant for loop
FiniDG Feb 24, 2022
4aa6902
removed redundant else + do not exit on error but only log specific p…
FiniDG Feb 24, 2022
c82e021
Merge pull request #10 from UMCUGenetics/feature/Alissa_connection
FiniDG Feb 25, 2022
c0c6945
Merge pull request #12 from UMCUGenetics/dev
FiniDG Feb 25, 2022
cd42ddd
first layout changes on VUS page
FiniDG Feb 25, 2022
9c75cc4
changed VUS page + preparations for GnomAD link + requirements update
FiniDG Mar 10, 2022
a0b02cf
layout changes VUS page
FiniDG Mar 10, 2022
6bd5738
removed redundant data externalDatabases
FiniDG Mar 10, 2022
58e49bb
updated the patient and gene pages for Alissa input and added wishes
FiniDG Mar 16, 2022
2a5ce5e
fixed all pages layout and functionality
FiniDG Mar 17, 2022
94edf05
change source and report function for Alissa_interpret update
FiniDG Mar 17, 2022
453683b
code formatting changes
FiniDG Mar 17, 2022
b7fc353
changed formatting based on feedback
FiniDG Mar 28, 2022
962978d
fixed spacing issue alleles/references
FiniDG Mar 28, 2022
6342614
small bugfix
FiniDG Mar 28, 2022
30cd161
fixed small bug2
FiniDG Mar 28, 2022
e045236
removed annotation sources
FiniDG Mar 28, 2022
c991f04
changes based on review featurebranch
FiniDG Mar 30, 2022
778c4fb
changed code based on review + added JSONDecodeError
FiniDG Apr 6, 2022
1bf01c5
forgot to reformat code with autopep
FiniDG Apr 6, 2022
7abdad4
small comments change based on reviewer call (formatting)
FiniDG Apr 6, 2022
d088ca8
Merge pull request #13 from UMCUGenetics/feature/layout_changes
FiniDG Apr 6, 2022
d93346a
added restrictions for specific roles and updated account page
FiniDG Apr 8, 2022
69a834a
changed some if statements based on pull #15 review
FiniDG Apr 22, 2022
2bea15e
Merge pull request #15 from UMCUGenetics/feature/new_roles
FiniDG Apr 26, 2022
36b4531
small adjustments before release, mainly column ordering
FiniDG Apr 28, 2022
025d489
added except for fullgnomen upload error
FiniDG Apr 28, 2022
9ff19d5
ready for server deployment + readme update v.1.0.0
FiniDG May 3, 2022
deeba2e
Merge pull request #16 from UMCUGenetics/dev
FiniDG May 3, 2022
352fbc7
updated requirements after test on productionserver. mod-wsgi was mis…
FiniDG May 4, 2022
fe71ae9
changes based on code review in pull request #17
FiniDG May 31, 2022
259d334
changes based on second review #17, mostly about datatables.py, secre…
FiniDG Jun 3, 2022
32cfa51
changed readme typos and try-except in import_data
FiniDG Jun 8, 2022
b0b3108
put back removed functions get_data + small adjustments on VUS page +…
FiniDG Jun 14, 2022
5734dd7
merge 2 functions into one, because of code duplication
FiniDG Jun 15, 2022
f3b1fea
explained datatable filling better and show difference between all pa…
FiniDG Jun 19, 2022
8ac59e5
forgot PEP8 formatting
FiniDG Jun 19, 2022
51448e5
updated faulthy dbSNP link, added 2 gnomAD links, removed UpdatedBy, …
FiniDG Jul 13, 2022
77870b0
removed SECRET_KEY, forgot to empty
FiniDG Jul 13, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
65 changes: 62 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,63 @@
__pycache__
.idea
*.xml
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
src/__init__.pyc

# C extensions
*.so

# Distribution / packaging
.Python
env/
venv/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover

# Translations
*.mo
*.pot

# logging:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Mac an other
**/.DS_Store
.idea
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 UMCU Genetics

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 0 additions & 3 deletions README

This file was deleted.

114 changes: 114 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<img src="https://i.imgur.com/zPP83aX.png" title="VUSualizer" alt="VUSualizer">

# VUSualizer

> A web interface that allows searching through Variant of Unknown Significance (VUS).

Important dependencies:
- [Python 3.6.8 or higher](https://www.python.org/)
- [Flask](https://pypi.org/project/Flask/)
- [Flask-PyMongo](https://pypi.org/project/Flask-PyMongo/)
- [Flask-Login]()
- [MongoDB](https://www.mongodb.com/)
- [datatables.js](https://datatables.net/)
- [alissa_interpret_client](https://github.com/UMCUGenetics/alissa_interpret_client)


## Application Structure
```
.
|──────run.py - used to run the flask app, also doubles as .wsgi file
|──────src/
FiniDG marked this conversation as resolved.
Show resolved Hide resolved
| |────__init__.py - creats the needed managers for Flask, Flask-PyMongo and Flask-Login
| |────config.py - configuration for the whole app
| |────datatable.py - class for querying MongoDB on the backend, returns data for datatables.js
| |────forms.py - contains Flask-WTF forms
| |────models.py - contains user model
| |────static/ (.css .js .png)
| |────templates/ (.html)
| |────views/ (.py)
| | |──main.py - manages handling for urls
| | |──auth.py - manages handling for account-related urls, eg. /login, /logout, etc.
|──────extra/ - importing data scripts and logging
| |────import_data.py - loads new analyses from Alissa to import in MongoDB (VUSualizer)
| |────config.py - configuration for the import data script
| |────logging_config.yml - for logging files of the import data script
```

### [Datatables.js Server-side Processing](https://datatables.net/manual/server-side)
Due to the amount of data, data needs to be filtered through the server.

As of right now, two templates contain the client-sided datatables.js code:
- base.html
- all.html

There are some "apis" that datatables.js interacts with. They are accessed through:
- /_get_all_data
- /_get_variant_data
- /_get_gene_data
- /_get_patient_data

These urls are handled in main.py. The program then uses the DataTablesServer class from datatable.py to query the database and return the data back to datatables.js to create a browsable table.


## Installation

1. Make a Python 3.6.8 venv in correct spot on server and install any requirements with pip:
```
$ python3 -m venv venv
$ source ./venv/bin/activate
$ pip install -r requirements.txt
```
If you receive a pip install error and it is due to the "mod_wsgi" package, this is not needed locally. use '#' before that package to prevent it from installing.
2. Install MongoDB
FiniDG marked this conversation as resolved.
Show resolved Hide resolved
(Local MacOS example): https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/
```
$ brew tap mongodb/brew
$ brew install [email protected]
$ brew services start [email protected]
```
3. Configure the config.py (in src folder) and fill in a random string for the SECRET_KEY. The app will not work without a SECRET_KEY. A random string can be generated by using for example [String Generator](https://www.random.org/strings/) or any other string generator. Do not share this code with others, as this could potentially be used to generate fake cookies for logins. Changing it will result in users needing to login again, as the sessions are not valid anymore.
(Optional) Configurate MONGO_URI in config.py if you're using different user details and/or database name
4. Configure the config.py (in extra folder) for Alissa credentials and the location of the logging_config.yml file and VUSualizer app
5. Load data into MongoDB with script in the "extra" folder.
```
$ (venv) python import_data.py
```
6. Add crontab to automatically check Alissa for new analyses (example shown below. every day on 3AM). This needs to be done with the admin user of the server.
```
$ 0 3 * * * /path/to/VUSualizer/extra/import_data.py >> /path/to/VUSualizer/extra/cronlogs.log 2>&1
```

## Run for development
Activate venv and then start the app
```
$ source ./venv/bin/activate
$ python run.py
```
## Run for production (apache required)
```
$ mod_wsgi-express start-server run.py
```

## Run on local machine
1. Configure the config.py (in extra folder) for VUSualizer location (required) and Alissa credentials (not required for running app)
2. If development for import_data.py (not required for running app) -->
- Change shebang python to ```#!/usr/bin/env python3``` or local equivalent
- Change filename parameter in logging_config.yml to correct local path
3. Activate venv
```
$ source ./venv/bin/activate
```
4. Run run.py
```
$ python run.py
```

## Troubleshooting
### Webpage does not load:
1. Not connected to the UMCU server (either via VPN, on location (WiFi) or follow-me workspace)
2. Service needs to be restarted:
```
$ sudo /bin/systemctl stop vusualizer-wsgi.service
$ sudo /bin/systemctl start vusualizer-wsgi.service
```
57 changes: 0 additions & 57 deletions app.py

This file was deleted.

9 changes: 9 additions & 0 deletions extra/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Alissa settings
alissa_base_uri = ''
alissa_client_id = ''
alissa_client_secret = ''
alissa_username = ''
alissa_password = ''
mongodb_localhost = 'mongodb://localhost:27017/'
logging_file = './logging_config.yml'
vusualizer_path = './'
Loading