In order to build OpenCGA from source code, user should download the source code from github and build it. This build process is handled with maven. The following tools are required for successful build :

Stable releases are merged and tagged at master branch, users are encouraged to use latest stable release for production. Current active development is carried out at develop branch and need Java 8, only compilation is guaranteed and bugs are expected, use this branch for development or for testing new functionalities. Only dependencies of master branch are ensured to be deployed at Maven Central Repositorydevelop branch may require users to download and install other active OpenCB repositories:

Clone And Compile Dependencies

User must clone and compile all of the above dependencies using the following commands :

git clone github-Dependency-URL


mvn clean install -DskipTests

Clone OpenCGA


$ git clone https://github.com/opencb/opencga.git

Latest stable release at master branch can be downloaded executing:

$ git clone -b master https://github.com/opencb/opencga.git

Build

OpenCGA can be compiled directly, just by executing mvn install -DskipTests, but some configuration files can be customized with the content of the file ~/.m2/settings.xml.

User don't need this file for the installation, but it makes easier to compile, install and configure at the same time the program, by filtering the resources files. Also, this information is used to run the tests. In that case, this file is required.

An example of that file can be found in the README. The description of each property can be found below:


You can copy this to ./m2/settings.xml:

    <profile>
     <id>localhost</id>
     <activation>
       <activeByDefault>true</activeByDefault>
     </activation>
     <properties>
       <CELLBASE.DB.MONGODB.HOST>localhost:9999</CELLBASE.DB.MONGODB.HOST>
       <CELLBASE.DB.USER></CELLBASE.DB.USER>
       <CELLBASE.DB.PASSWORD></CELLBASE.DB.PASSWORD>
       <CELLBASE.FILES.PATH>/home/imedina/data/cellbase/files</CELLBASE.FILES.PATH>

       <CELLBASE.DB.NEO4J.HOST>localhost:27017</CELLBASE.DB.NEO4J.HOST>

        <!--
       <CELLBASE.DB.MONGODB.AUTHENTICATIONDATABASE>admin</CELLBASE.DB.MONGODB.AUTHENTICATIONDATABASE>
       <CELLBASE.DB.MONGODB.READPREFERENCE>primary</CELLBASE.DB.MONGODB.READPREFERENCE>
        <CELLBASE.DB.MONGODB.READPREFERENCE>secondaryPreferred</CELLBASE.DB.MONGODB.READPREFERENCE>
        <CELLBASE.DB.MONGODB.REPLICASET></CELLBASE.DB.MONGODB.REPLICASET>
        -->
       <CELLBASE.REST.URL>http://bioinfodev.hpc.cam.ac.uk/cellbase/webservices/rest</CELLBASE.REST.URL>
       <CELLBASE.VERSION>v4</CELLBASE.VERSION>
       <CELLBASE.ENSEMBL.LIBS>/home/imedina/apis/ensembl/api_79</CELLBASE.ENSEMBL.LIBS>

       <OPENCGA.CATALOG.DB.HOSTS>localhost:27017</OPENCGA.CATALOG.DB.HOSTS>
       <OPENCGA.CATALOG.DB.PORT>27017</OPENCGA.CATALOG.DB.PORT>
       <OPENCGA.CATALOG.DB.DATABASE>opencga_catalog</OPENCGA.CATALOG.DB.DATABASE>
       <OPENCGA.CATALOG.DB.USER></OPENCGA.CATALOG.DB.USER>
       <OPENCGA.CATALOG.DB.PASSWORD></OPENCGA.CATALOG.DB.PASSWORD>
       <OPENCGA.CATALOG.DB.AUTHENTICATION_DATABASE></OPENCGA.CATALOG.DB.AUTHENTICATION_DATABASE>

        <OPENCGA.STORAGE.STUDY.METADATA.MANAGER></OPENCGA.STORAGE.STUDY.METADATA.MANAGER>

        <OPENCGA.CLIENT.HOST>http://bioinfodev.hpc.cam.ac.uk/opencga-1.0.0-rc3</OPENCGA.CLIENT.HOST>

        <OPENCGA.CATALOG.DB.TEST.DATABASE>catalogTest</OPENCGA.CATALOG.DB.TEST.DATABASE>
        <OPENCGA.CATALOG.TEST.ROOTDIR>file:/opt/opencga/catalogTest/</OPENCGA.CATALOG.TEST.ROOTDIR>

        <OPENCGA.CELLBASE.HOST>http://bioinfodev.hpc.cam.ac.uk/cellbase/webservices/rest/</OPENCGA.CELLBASE.HOST>
        <OPENCGA.CELLBASE.VERSION>latest</OPENCGA.CELLBASE.VERSION>

        <OPENCGA.STORAGE.VARIANT.DB.HOST>localhost:27017</OPENCGA.STORAGE.VARIANT.DB.HOST>
        <OPENCGA.STORAGE.VARIANT.DB.USER></OPENCGA.STORAGE.VARIANT.DB.USER>
        <OPENCGA.STORAGE.VARIANT.DB.PASSWORD></OPENCGA.STORAGE.VARIANT.DB.PASSWORD>
        <OPENCGA.STORAGE.VARIANT.DB.AUTHENTICATION_DATABASE></OPENCGA.STORAGE.VARIANT.DB.AUTHENTICATION_DATABASE>

        <OPENCGA.ANALYSIS.EXECUTION.MANAGER>LOCAL</OPENCGA.ANALYSIS.EXECUTION.MANAGER>

       <OPENCGA.CATALOG.ROOTDIR>/opt/opencga/sessions/</OPENCGA.CATALOG.ROOTDIR>

       <OPENCGA.INSTALLATION.DIR>/opt/opencga</OPENCGA.INSTALLATION.DIR>
     </properties>
   </profile>



After creating and configuring the default profile, you can build OpenCGA by executing the following command from the root of the cloned repository:

$ mvn clean install -DskipTests

After successful compilation, user should find the following file structure under OPENCGA.INSTALLATION.DIR:

opencga/
├── tools/
├── bin/
├── conf/
└── libs/