Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

opencga.sh is the officially recommended command line tool for normal users and are encouraged to use this. It implements all the functionality in more than 100 command and subcommands. As per OpenCGA design, these commands are one-to-one mapping of Resources from REST web services  and subcommands are mapping to end-points. These commands underneath makes REST calls to carry out operations, thus any user who has access to REST machine/cluster can execute these commands. 

Correlation Between REST and CLI

In the following URL, "samples" is the resource and "search" is the endpoint:

http://bioinfoint.hpc.cam.ac.uk/opencga-1.3.0-dev/webservices/rest/v1/samples/search

the corresponding command in commandLine is :

Code Block
themeRDark
titleCommand
./opencga.sh samples

and corresponding subCommand is : 

Code Block
themeRDark
titleSubCommand
./opencga.sh samples search 

Executing ./opencga.sh will return the list of all available commands with description of each as shown below: 

Code Block
languagetext
themeRDark
firstline1
titleExecuting 'opencga.sh'
Catalog commands:
         users  User commands
      projects  Project commands
       studies  Study commands
         files  Files commands
          jobs  Jobs commands
   individuals  Individuals commands
       samples  Samples commands
     variables  Variable set commands
       cohorts  Cohorts commands
         tools  Tools commands
        panels  Panels commands

Analysis commands:
    alignments  Implement several tools for the genomic alignment analysis
       variant  Variant commands

List of subCommand can be retrieved by simply executing a command without any argument as show below: 

Code Block
languagetext
themeRDark
titleExecuting 'opencga.sh samples'
./opencga.sh samples

Usage:   opencga.sh samples <subcommand> [options]

Subcommands:
        create  Create a sample
          load  Load samples from a pedigree file
          info  Get samples information
        search  Search samples
        update  Update sample
        delete  Delete the selected sample
      group-by  Group samples
   individuals  Get the individuals of a list of samples.
           acl  Return the acl of the resource
    acl-update  Update the permissions set for a member
...

CLI Session Management

As a first step to execute any command with opencga.sh, user must login. After successfull login, the corresponding JWT sesssion token will be stored on machine under

Code Block
themeRDark
titlesession.json
~/.opencga/session.json

This makes easier for users to login only once and execute any number of commands till the session token is expired. Please note down, session expiration is set by OpenCGA server independently from client. Once token is expired, user have to login again and can perform desired operations as normal.

Code Block
themeRDark
titleContents of session.json
{
  "userId" : "rjbik",
  "sessionId" : "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJyamJpayIsImF1ZCI6Ik9wZW5DR0EgdXNlcnMiLCJpYXQiOjE1MDkwMTU0ODgsImV4cCI6MTUwOTAxNzQ4OH0.n2vyq07UL_v7HHl0N-enyBEuy3Wy97b3ZKnA8ksLRIg",
  "login" : "2017-10-26T11:58:09.146",
  "logout" : "2017-11-22T14:58:10.097",
  "timestamp" : 1511362690608,
  "projectsAndStudies" : null
}


Table of Contents:

Table of Contents
indent20px