|
| 1 | +# Variant Validator installation instructions |
| 2 | + |
| 3 | +In these instructions, lines that must be entered at the command prompt are preceded with >, like so: |
| 4 | +> ls |
| 5 | +
|
| 6 | +These instructions will allow you to configure the software on Linux. Mac OS X computers operate similarly. |
| 7 | + |
| 8 | +There are several steps involved in setting up variant validator: |
| 9 | +* The application files themselves must be installed from SVN. |
| 10 | +* The python environment must be set up. On a LAMP, only a custom version of Python will do. |
| 11 | +* Protobuf must be compiled and installed |
| 12 | +* Required python packages need to be installed, too. |
| 13 | +* The databases must be downloaded and set up |
| 14 | +* The configuration files must be changed to point the validator at those databases. |
| 15 | + |
| 16 | +## Virtual environment |
| 17 | + |
| 18 | +Variant validator currently requires python 2.7. |
| 19 | + |
| 20 | +When installing Variant Validator it is wise to use a virtual environment, as it requires specific versions of several libraries. |
| 21 | +First, download and set up conda (in this case miniconda as we don't need all packages) |
| 22 | + > wget https://repo.anaconda.com/miniconda/Miniconda2-latest-Linux-x86_64.sh |
| 23 | + > bash Miniconda2-latest-Linux-x86_64.sh |
| 24 | + > echo ". /local/miniconda2/etc/profile.d/conda.sh" >> ~/.bashrc |
| 25 | + > source ~/.bashrc |
| 26 | +Then create the conda environment and install the necessary programs (this should be done in an environment.yml file eventually). Note, installing biotools downgrades the version of setuptools so that needs to be reinstalled before the pip command to install hgvs=1.1.3 |
| 27 | + > conda create -n VVenv |
| 28 | + > conda activate VVenv |
| 29 | + > conda install -c conda-forge sqlite python=2.7 protobuf=3.5.1 docutils python-daemon httplib2 mysql-connector-python mysql-python |
| 30 | + > conda install -c auto biotools |
| 31 | + > conda install -c bioconda pyliftover pysam |
| 32 | + > conda install setuptools numpy |
| 33 | + > conda install -c anaconda pytest |
| 34 | + > pip install hgvs==1.1.3 |
| 35 | +The packages required for variant validator to function are now set up in the environment "VVenv". |
| 36 | + |
| 37 | +## Installing validator code |
| 38 | + |
| 39 | +To clone this software from GIT, use: |
| 40 | + > git clone https://github.com/pjdp2/variantValidator.git |
| 41 | +This'll create a variantValidator folder in the directory you run it in. |
| 42 | + > cd variantValidator |
| 43 | +Run the installation script to integrate variant validator with python's site packages. |
| 44 | + > python setup.py install |
| 45 | +For development purposes, you can use |
| 46 | + > pip install -e . |
| 47 | +to ensure any changes you make in the local variant validator folder is reflected in your python site-packages. |
| 48 | + |
| 49 | +## Setting up MySQL |
| 50 | + |
| 51 | +This step is not optional for getting variant validator to work. Install packages with: |
| 52 | + > sudo apt-get install mysql-server |
| 53 | +
|
| 54 | +This will install everything you need and start the database server. Make sure you note down the root account password that you're prompted for during installation! |
| 55 | +Check it runs with: |
| 56 | + > sudo service mysql status |
| 57 | +If it's not running, use |
| 58 | + > sudo service mysql start |
| 59 | +to boot it up. |
| 60 | +Enter mysql from any user's shell prompt with |
| 61 | + > mysql -u root -p |
| 62 | +This will prompt you for the root password you made earlier. Within MySQL, create the variant validator user: |
| 63 | + > CREATE USER 'vvadmin'@'localhost' IDENTIFIED BY 'var1ant'; |
| 64 | +You should create the database too |
| 65 | + > CREATE DATABASE validator; |
| 66 | + > USE validator; |
| 67 | +Grant access rights to the vvadmin user: |
| 68 | + > GRANT SELECT,INSERT,UPDATE,DELETE ON validator.* TO vvadmin; |
| 69 | +Quit mysql with |
| 70 | + > \q |
| 71 | +Bye indeed. |
| 72 | + |
| 73 | +In the VariantValidator/data folder is a copy of the empty mysql database needed by Variant Validator to run. The software will populate it as variants are run. You need to upload it to the running MySQL database with: |
| 74 | + > mysql -u root -p validator < data/emptyValidatorDump.sql |
| 75 | +- adjusting the path depending on where your empty database is. |
| 76 | +You should log into MySQL and check to see if the database uploaded correctly. Login with vvadmin, password "var1ant". |
| 77 | +Then: |
| 78 | + > USE validator; |
| 79 | + > SHOW TABLES; |
| 80 | +which should show: |
| 81 | +> +---------------------+ |
| 82 | +> | Tables_in_validator | |
| 83 | +> +---------------------+ |
| 84 | +> | LRG_RSG_lookup | |
| 85 | +> | LRG_proteins | |
| 86 | +> | LRG_transcripts | |
| 87 | +> | refSeqGene_loci | |
| 88 | +> | transcript_info | |
| 89 | +> +---------------------+ |
| 90 | +if it's set up correctly. |
| 91 | + |
| 92 | +## Setting up PostGreSQL |
| 93 | + |
| 94 | +It's recommended for performance reasons to use a local varsion of the UTA database. To do this, first install the required packages with: |
| 95 | + > sudo apt-get install postgresql postgresql-contrib |
| 96 | +You need to switch to the "postgres" user to make anything work initially. |
| 97 | + > sudo -i -u postgres |
| 98 | +Create a new user with a name matching your user account. In my case - pjdp2. When prompted, make yourself a superuser. |
| 99 | + > createuser --interactive |
| 100 | +The postgres user doesn't have a unix password, so you'll need to use exit to get your account back. |
| 101 | + > exit |
| 102 | +Enter the database with psql. You'll be signed by default into the "postgres" database, which serves as a kind of master database for controlling user accounts. |
| 103 | + > psql postgres |
| 104 | +Inside psql, create the uta_admin role, and set the password when prompted to "uta_admin". |
| 105 | + > CREATE ROLE uta_admin WITH CREATEDB; |
| 106 | + > ALTER ROLE uta_admin WITH LOGIN; |
| 107 | + > \password uta_admin |
| 108 | +Create an empty uta database |
| 109 | + > CREATE DATABASE uta WITH OWNER=uta_admin TEMPLATE=template0; |
| 110 | +That's enough setting up. Quit psql with: |
| 111 | + > \q |
| 112 | +Now you're back to your own prompt, download the gzipped uta genetics database, and upload it into psql. You'll be prompted for your password. |
| 113 | + > wget http://dl.biocommons.org/uta/uta_20180821.pgd.gz |
| 114 | + > gzip -cdq uta_20180821.pgd.gz | psql -U uta_admin -v ON_ERROR_STOP=0 -d uta -Eae |
| 115 | +The database should now be uploaded. Don't worry, you can access the database uta with uta_admin if it's uploaded by someone else. |
| 116 | +If the database returns errors when the validator runs, you will need to change the postgresql authentication methods, by editing |
| 117 | + > pg_hba.conf |
| 118 | +This file lives, on linux, in /etc/postgresql/9.3/main/pg_hba.conf but on other systems you may need to search for it. |
| 119 | +Inside the file, you should change all instances of "peer" to "md5". |
| 120 | + |
| 121 | +## Setting up Seqrepo |
| 122 | + |
| 123 | +Similarly, things run much faster with a local SeqRepo database. You've installed the seqrepo package with pip, but you'll need to download an actual sequence repository. These instructions assume you are using your home directory; you can put it anywhere so long as you modify the config.ini file accordingly. |
| 124 | + > mkdir seqrepo |
| 125 | +Then make a cup of tea while this command runs: |
| 126 | + > seqrepo --root-directory ~/seqrepo pull -i 2018-08-21 |
| 127 | +After it finishes downloading, check it installed correctly: |
| 128 | + > seqrepo --root-directory ~/seqrepo list-local-instances |
| 129 | +
|
| 130 | +## Configuration |
| 131 | + |
| 132 | +See the file MANUAL.md for configuration instructions. |
0 commit comments