Skip to content

Commit

Permalink
draft for updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
talavis committed Apr 15, 2019
1 parent 1c3de8e commit 6acc704
Showing 1 changed file with 32 additions and 24 deletions.
56 changes: 32 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,53 +7,61 @@ SweFreq - Swedish Frequency database
Running on a production system
------------------------------

The application has only been tested with python 3.5.2. It will most likely work with at least other 3.5 versions.
The application is targeted at python 3.6. It will most likely work with 3.5 and 3.7 as well.

`virtualenv` is not a requirement but it will help you to install the application.
`venv` is not a requirement but it will help you to install the application.

1. Download the repository from [github](https://github.com/NBISweden/swefreq)

2. Credentials

2.1 Make sure you have registered an Elixir AAI application with the Elixir.

2.2 (legacy) Create Google OAuth 2.0 credentials with the [Google API
Console](https://console.developers.google.com/) for enabling
authentication.

3. Rename the file `settings_sample.json` into `settings.json` and edit all
the values.

4. Install MySQL. Only tested with 5.6. Note, the schema is incompatible with the
latest version of MariaDB.

5. If you have `virtualenv` and `pip` installed then you can do the following
5. If you have `venv` and `pip` installed then you can do the following
to install the required Python packages. Locate the `requirements.txt` file
in the `swefreq` repository.

source /path/to/bin/activate # activate your virtualenv
pip install -r /path/to/requrements.txt # install the required Python packages
```
source /path/to/bin/activate # activate your virtual environment
pip install -r /path/to/requrements.txt # install the required Python packages
````

6. Create the PostgreSQL database and its tables with the following command:

6. Create the MySQL database, user and tables with the following command:
```
psql -U postgres -h 127.0.0.1 -f sql/data_schema.sql
psql -U postgres -h 127.0.0.1 -f sql/user_schema.sql
```

mysql -u root -p < ./sql/swefreq.sql
To experience the full site you need to manually add a dataset and a user
to the database. You can use the test data in `test/data/browser_test_data.sql`.

To experience the full site you need to manually add a dataset and a user
to the database. Log into the mysql console and enter something like the
following, change the values to whatever fits your site (N.B.
`myemail@google.com` is your google id):
7. Add reference data and variants using the import scripts found in `scripts/`, e.g.:

USE swefreq;
INSERT INTO dataset (dataset_pk, name) VALUES (1, "Dataset");
INSERT INTO user (user_pk,name, email) VALUES (1, "test", "myemail@google.com");
INSERT INTO dataset_access (dataset_pk, user_pk, is_admin, has_access) VALUES (1,1,1,1);
```
./manage.sh import --add_reference \
--gencode_version 19 \
--ensembl_version homo_sapiens_core_75_37 \
--assembly_id GRCh37p13 \
--dbnsfp_version 2.9.3 \
--ref_name GRCh37p13
./manage.sh import --add_raw_data \
--dataset variant_data \
--version 20190415 \
--variant_file variants/chr22.vcf.gz \
--coverage_file coverage/chr22.coverage.txt.gz
```

### Start the server

source /path/to/bin/activate # activate your virtualenv
```
source /path/to/bin/activate # activate your virtual environment
python /path/to/route.py

```

Quick development mode
----------------------
Expand Down

0 comments on commit 6acc704

Please sign in to comment.