Skip to content

Getting started in 5 min

Pedro Furió edited this page Sep 5, 2016 · 9 revisions

Preparation

Download or pull the version you want to try, you can build the application from sources executing:

mvn clean install -DskipTests

Copy the application (or the content of build folder) into the installation directory, by default and in this tutorial this is /opt/opencga

You check that all the command lines (CLIs) work fine by executing them with -h parameter, this should print the help. The CLIs are in the bin folder: opencga-admin.sh, opencga-analysis.sh and opencga.sh

Indexing a VCF file

Installing Catalog

For administering the OpenCGA installation you can use opencga-admin.sh command line. To install catalog database execute from the installation directory:

./bin/opencga-admin.sh catalog install -p

The MongoDB database host and name will be read from the ./conf/catalog-configuration.yml file by default. This CLI will create the database, the collections and all the indexes, it also creates the admin user with the specified password.

Note: you do not have to write the admin password in the CLI, this will be asked later. This password will be stored as the admin password.

Creating the user and study

By default OpenCGA is configured as private which means that only admin user can create other users. We can use the same CLI to create a user:

./bin/opencga-admin.sh users create -p -u imedina --user-email [email protected] --user-name Nacho --user-password

This will create imedina user and a default project. Again, you do not have to write the password in the command line. Two passwords are requested now, first the admin password to gain privileges (this will be remembered 2 minutes soon), second the user password (users can change this password later).

Once the user exists we no longer need the opencga-admin.sh command line, we can use opencga.sh which the CLI that normal users must use. The first thing we have to do is to login with our user:

./bin/opencga.sh users login -u imedina -p (do not write the password here)

This will create a hidden directory in your home called .opencga. This directory contains a file with the users and the session id, this will be used automatically by opencga.sh, this is valid only for some minutes, by doing this users do not have to write the password too many times.

Now we can create the study to start working, you can execute:

./bin/opencga.sh studies create -a st1 -n Study1 --project-id default

Adding and indexing a VCF file

We can add (register) a file in our study by executing:

./bin/opencga.sh files link -i /home/imedina/appl/variant-effect/installation-dir/example/CEU-1409-01_10000.vcf -s st1

This will add a file entry (with the id 6) in catalog with some information and stats of that file, from now on you can start working with the file. At this moment all the project-id or study-id are the numeric codes, this will be changed very soon.

To index and query data in the server side we can use opencga-analysis.sh. You can execute:

./bin/opencga-analysis.sh variant index --file-id CEU-1409-01_10000.vcf --sid DyEs71yV0uhWkuCTn7Oc

To query you can execute:

./bin/opencga-analysis.sh variant query --return-study 6 --sid DyEs71yV0uhWkuCTn7Oc --region 1:14558108-14558112

Clone this wiki locally