Skip to content

ScilifelabDataCentre/precision-medicine-portal-backend

Repository files navigation

Precision Medicine Portal

This is the source code for the DDLS Data Science Node Precision Medicine Portal: (Link to be added).

Introduction

The Data Driven Life Science (DDLS) initiative has appointed four Data Science Nodes (DSNs) to serve as database, data and bioinformatics support for data driven research in life science. This repository contains the code for a Precision Medicine Portal by the Precision Medicine DSN, which is hosted at Karolinska Institutet and SciLifeLab.

The short term aim of this portal is to host static content related to precision medicine as a starting point for the project.

Step 1: Clone the Repository

Git setup

Clone the repository to your machine:

git clone https://github.com/ScilifelabDataCentre/precision-medicine-portal.git

To make it easier to pull in changes made by others, you can add the main repository as a remote:

git remote add upstream https://github.com/ScilifelabDataCentre/precision-medicine-portal.git

Then you can fetch changes at any time from this remote:

git pull upstream dev

The required packages and their versions are logged in the file "requirements.txt". It is recommended to set up a virtual environment of your choice (for example venv) for the project, to handle versioning of Python and required packages.

To set up a venv on MacOS or Linux (might differ slightly on Windows):

python3 -m venv .venv

To activate the venv:

source .venv/bin/activate 

Once you have set that up, install requirements using pip:

pip install -r requirements.txt

With the requirements installed you can then run the flask app locally for testing purposes:

python3 run.py

You will see that a local development server starts running. You can access the web page by opening a web browser and visiting the URI "localhost:5000". To stop the server press CTRL+C in the terminal.

Docker

You can use the provided Dockerfile to build and run a container.

Step 2: Create a branch and develop

Note that commits need to be signed as per SciLifeLab policy. There are many different ways to sign github commits and how to set it up may vary based on your operating system. An example of how to set it up for MacOS can be seen here:

https://gist.github.com/troyfontaine/18c9146295168ee9ca2b30c00bd1b41e

To create a new branch and start developing in it:

git branch my_branch
git checkout my_branch

After doing this you can make any changes you want. You must then either add all changed files or specific changed files to your commit:

git add -A

or

git add my_changed_file

You can then commit and push to your branch:

(NOTE: DO NOT FORGET TO SIGN YOUR COMMITS, by policy only signed commits can be merged into the main branches.)

git commit -S -m "My commit"
git push origin my_branch

The code is now in my_branch in the repository, but you it does not get merged into the main branches without being reviewed as a pull request.

Step 3: Make a pull request

Once you're finished with your edits and they are committed and pushed to your branch, it's time to open a pull request.

You can find full documentation on the GitHub help website, however in short:

  • Visit the main repository: https://github.com/ScilifelabDataCentre/data.scilifelab.se
  • Find the branch my_branch that you created and pushed to
  • Click the button that reads "New Pull Request"
  • Add/change title as well as a description of what you've done
  • Add reviewers from the organization to review your pull request
  • Click Create Pull Request

Once created, a member of the website team will review your changes. Once approved, they will be merged and deployed.

How to get help

If in doubt, you can ask for help by emailing [email protected].

Credits

The portal was built by the DDLS Precision Medicine Data Science Node with colleagues at SciLifeLab.