README.md 11.1 KB
Newer Older
pgdurand's avatar
pgdurand committed
1
# GATB - The Genome Analysis Toolbox with de-Bruijn graph
Rayan Chikhi's avatar
Rayan Chikhi committed
2

3 4 5
   [![](https://img.shields.io/badge/release-1.3.0-orange.svg?style=plastic)](https://github.com/GATB/gatb-core/releases) - [![](https://img.shields.io/badge/build--Linux-passing-green.svg?style=plastic)]()  [![](https://img.shields.io/badge/build--OSX-passing-green.svg?style=plastic)]()

--------------------------------------------------------------------------------
Rayan Chikhi's avatar
Rayan Chikhi committed
6

pgdurand's avatar
pgdurand committed
7
   [![License](http://img.shields.io/:license-Affero--GPL-blue.svg)](http://www.gnu.org/licenses/agpl-3.0.en.html)  [![](https://tokei.rs/b1/github/GATB/gatb-core?category=code)](https://github.com/GATB/gatb-core)  [![](https://img.shields.io/badge/platform-c++/11-yellow.svg)](https://isocpp.org/wiki/faq/cpp11)  [![](https://img.shields.io/badge/run_on-Linux--Mac_OSX-yellowgreen.svg)]()
DURAND Patrick's avatar
DURAND Patrick committed
8

9 10 11 12
--------------------------------------------------------------------------------
**Continuous integration on master branch - build status:**

|**Linux**| **gcc 4.7** | **gcc 4.8** | **gcc 4.9** | **clang 3.6** | **clang 3.9**| **Valgrind** |
pgdurand's avatar
pgdurand committed
13 14
|---------|-------------|-------------|-------------|---------------|--------------|--------------|
|*Debian 8*|    | [![Build Status](https://ci.inria.fr/gatb-core/view/GATB-CORE/job/test-docker-gatb-core-compile-gcc48/badge/icon)](https://ci.inria.fr/gatb-core/view/GATB-CORE/job/test-docker-gatb-core-compile-gcc48/) | [![Build Status](https://ci.inria.fr/gatb-core/view/GATB-CORE/job/test-docker-gatb-core-compile-gcc49/badge/icon)](https://ci.inria.fr/gatb-core/view/GATB-CORE/job/test-docker-gatb-core-compile-gcc49/) | [![Build Status](https://ci.inria.fr/gatb-core/view/GATB-CORE/job/test-docker-gatb-core-compile-clang36/badge/icon)](https://ci.inria.fr/gatb-core/view/GATB-CORE/job/test-docker-gatb-core-compile-clang36/) | [![Build Status](https://ci.inria.fr/gatb-core/view/GATB-CORE/job/test-docker-gatb-core-compile-clang39/badge/icon)](https://ci.inria.fr/gatb-core/view/GATB-CORE/job/test-docker-gatb-core-compile-clang39/) |  - | 
pgdurand's avatar
pgdurand committed
15
|*Debian 7*| [![Build Status](https://ci.inria.fr/gatb-core/view/GATB-CORE/job/test-suite-debian7-64bits-gcc-4.7/badge/icon)](https://ci.inria.fr/gatb-core/view/GATB-CORE/job/test-suite-debian7-64bits-gcc-4.7/) | - | - | - | - | [![Build Status](https://ci.inria.fr/gatb-core/view/GATB-CORE/job/test-valgrind-debian7-64bits-gcc-4.7/badge/icon)](https://ci.inria.fr/gatb-core/view/GATB-CORE/job/test-valgrind-debian7-64bits-gcc-4.7/) | 
16
|*Fedora 20*| - | [![Build Status](https://ci.inria.fr/gatb-core/view/GATB-CORE/job/test-suite-fedora20-gcc-4.8/badge/icon)](https://ci.inria.fr/gatb-core/view/GATB-CORE/job/test-suite-fedora20-gcc-4.8/) | - | - | - | - | 
17

18 19 20
| **Mac OSX** | **clang-600** | **gcc 4.2.1** |
|    :--:     |---------------|---------------|
| *10.9* | [![Build Status](https://ci.inria.fr/gatb-core/view/GATB-CORE/job/test-suite-macos-10.9.5-clang-6.0/badge/icon)](https://ci.inria.fr/gatb-core/view/GATB-CORE/job/test-suite-macos-10.9.5-clang-6.0/) | [![Build Status](https://ci.inria.fr/gatb-core/view/GATB-CORE/job/test-suite-macos-10.9.5-gcc-4.2.1/badge/icon)](https://ci.inria.fr/gatb-core/view/GATB-CORE/job/test-suite-macos-10.9.5-gcc-4.2.1/) | 
21

DURAND Patrick's avatar
DURAND Patrick committed
22

23
--------------------------------------------------------------------------------
DURAND Patrick's avatar
DURAND Patrick committed
24
# What is GATB?
Rayan's avatar
Rayan committed
25

26 27 28 29 30
GATB is made of two master projects: 

* The **GATB-CORE project** provides a set of highly efficient algorithms to analyse NGS data sets. These 
methods enable the analysis of data sets of any size on multi-core desktop computers, including very 
huge amount of reads data coming from any kind of organisms such as bacteria, plants, animals and 
DURAND Patrick's avatar
DURAND Patrick committed
31
even complex samples (e.g. metagenomes). Read more about GATB at <a href="https://gatb.inria.fr/">https://gatb.inria.fr/</a>.
32
 
DURAND Patrick's avatar
DURAND Patrick committed
33
* The **GATB-TOOLS project** contains a set of ready-to-use softwares relying on GATB-CORE algorithms. You can have a look at available tools at <a href="https://gatb.inria.fr/software/">https://gatb.inria.fr/software/</a>.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61

--------------------------------------------------------------------------------
# What is GATB-CORE ?

GATB-CORE is a high-performance and low memory footprint C++ library.

GATB-Core natively provides the following operations:

* Reads handling: 	
 * FASTA/FASTQ parsing
 * Parallel iteration of sequences

* K-mer: 	

 * K-mer counting
 * Minimizer computation of k-mers, partitioning of datasets by minimizers
 * Bloom data structure of k-mers
 * Hash table of k-mers
 * Minimal perfect hash function of k-mers
 * Arbitrarily large k-mers representations

* de Bruijn graph: 	

 * graph construction
 * graph traversal operations (contigs, unitigs)
 * graph simplifications for assembly (tip removal, bulge removal)

By itself GATB-CORE is not an NGS data analysis tool. However, it can be 
DURAND Patrick's avatar
DURAND Patrick committed
62
used to create such tools; see section [Quickly create a new GATB-TOOL software](#Quickly create a new GATB-TOOL software), below.
63

DURAND Patrick's avatar
DURAND Patrick committed
64
They already exist a set of ready-to-use tools relying on GATB-CORE library: see [https://gatb.inria.fr/software/](https://gatb.inria.fr/software/)
65 66 67 68 69 70 71 72

# Project content

All the needed material of GATB-CORE is contained in the current directory in order to 
generate the wanted artifacts:  

* dynamic and static libraries holding the services component

DURAND Patrick's avatar
DURAND Patrick committed
73 74 75 76 77
* 120+ unit tests of the entire library

# Dependencies

The following third parties have to be already installed to compile GATB-Core:
78

DURAND Patrick's avatar
DURAND Patrick committed
79
* a **C++/11 capable compiler** (*e.g.* gcc 4.7+, clang 3.5+, Apple/clang 6.0+)
80
* **CMake 3.10+**
81

DURAND Patrick's avatar
DURAND Patrick committed
82 83 84 85 86 87 88 89 90 91 92
In addition, you could install these optional tools:

* **doxygen**: to compile a local copy of the GATB-Core documentation
* **cppunit**: to compile and run Unit tests

# Compile GATB-CORE


## Compile in Release mode (default)

Type:
93

DURAND Patrick's avatar
DURAND Patrick committed
94 95
	cd <some_directory>
	git clone https://github.com/GATB/gatb-core.git
96
	cd gatb-core/gatb-core
DURAND Patrick's avatar
DURAND Patrick committed
97
	mkdir build ; cd build ; cmake .. ; make -j8
98
	
DURAND Patrick's avatar
DURAND Patrick committed
99
## Compile in Debug mode
100

DURAND Patrick's avatar
DURAND Patrick committed
101
Type same as above, except for the CMake command:
DURAND Patrick's avatar
DURAND Patrick committed
102 103 104 105 106 107 108 109 110 111 112 113 114

    cmake -D CMAKE_BUILD_TYPE=Debug ..
    make -j8

## Run unit tests

* cppunit is required
* compile using the command above (Release or Debug mode)

Then type:


     # enter gatb-core build directory
115
     cd gatb-core/gatb-core/build
DURAND Patrick's avatar
DURAND Patrick committed
116 117 118 119 120 121 122 123 124
     # set verbose mode to on so that we have name of failing tests (if any)
     export CPPUNIT_VERBOSE=1
     # Copy database for unit tests
     cp -r ../test/db ./test/
     # Launch the full test suite
     cd bin
     ./gatb-core-cppunit

The gatb-core-cppunit command may also take as argument the categories of tests that show up in the verbose output, e.g. './gatb-core-cppunit TestBank'.
125 126 127

More about GATB-CORE code compiling instruction is available [here](http://gatb-core.gforge.inria.fr/doc/api/compilation.html).

DURAND Patrick's avatar
DURAND Patrick committed
128 129 130 131
# Work on GATB-Core code using Eclipse

Read [this documentation](https://gatb.inria.fr/use-eclipse-to-develop-gatb-core-softwares/).

132
# Work on GATB-Core code using Xcode
DURAND Patrick's avatar
DURAND Patrick committed
133

134 135 136 137
Read [this documentation](https://gatb.inria.fr/use-xcode-to-develop-gatb-core-softwares/).


# Learning GATB-Core: tutorial
138 139 140

You can follow [this link](https://gatb.inria.fr/gatb-programming-tutorial/) to start the GATB-Core Online Tutorial trail.

141 142
The project also contains many [code examples](https://github.com/GATB/gatb-core/tree/master/gatb-core/examples) that can be easily compiled and executed to review how to use GATB-Core APIs.

143
# Documentation
144

DURAND Patrick's avatar
DURAND Patrick committed
145
The complete GATB-Core documentation is available [here](http://gatb-core.gforge.inria.fr/doc/api/). It contains: API, code snippets, compile instructions, *etc*.
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208

Nevertheless, you can create a local copy of the documentation as follows (we suppose you already compiled the c++ code, see above; requires 'doxygen'):

     cd gatb-core/gatb-core/build
     make doc

Documentation is then available in _build/html/index.html_


# kmer default sizes

By default, the library is compiled for supporting 4 ranges of kmers : 

* k1 : for kmerSize < k1  (default value 32)         
* k2 : for k1 <= kmerSize < k2 (default value 64)
* k3 : for k2 <= kmerSize < k3 (default value 96)
* k4 : for k3 <= kmerSize < k4 (default value 128)

You can customize these values through cmake, provided they rebuild the project from scratch. For instance:

    rm -Rf build; mkdir build ; cd build ; cmake -DKSIZE_LIST="64 96 128 162" ..

Tools may set a default kmer lists in their CMakeFiles.txt, as such (see for instance Minia):

    list (APPEND KSIZE_DEFAULT_LIST  32   64   96  128  160  192  224  256)


--------------------------------------------------------------------------------
# Directory content

* __README__:                  this file

* __CMakeList.txt__:           global cmake file

* __doc__:                 
    * __design__      design documentation for the component
    * __doxygen__     pages for doxygen

* __examples__:       snippets showing how to use the library                 

* __src__:            source code for the component

* __test__:           tests directory
    * __src__         source code for unit tests
    * __db__          FASTA databases for unit tests

* __thirdparty__:    third parties    

--------------------------------------------------------------------------------
# Details for 'src' directory content

It contains several sub directories, each one corresponding to one software package.

A package may be composed of sub packages; the directory hierarchy should represent
this packages tree structure.

For one atomic package (or sub package), we should have:

* directory 'api'       API of the package  

* directory 'impl'      several implementations of the API

--------------------------------------------------------------------------------
DURAND Patrick's avatar
DURAND Patrick committed
209 210 211
# Quickly create a new GATB-TOOL software

A GATB-TOOL is a new software relying upon GATB-CORE.
212

DURAND Patrick's avatar
DURAND Patrick committed
213
You use GATB-CORE to create a new tool project, with the following script:
214

DURAND Patrick's avatar
DURAND Patrick committed
215
    sh scripts/NewProject/NewProject.sh -d directory -n toolName
216

DURAND Patrick's avatar
DURAND Patrick committed
217 218 219 220 221 222
where:

    'directory' is the directory where the project will be created
    'toolName' is the name of the project.

The script will automatically creates the full path 'directory/toolName' to deploy a self-contained tool.
223 224
 
By default, the following part will be included in the project:
DURAND Patrick's avatar
DURAND Patrick committed
225 226 227 228 229

* a CMakeLists.txt file used for building the project
* a 'tools' directory holding a default source code using GATB-Core
* a 'scripts' directory holding a script to automatically package the tool
* an optional 'thirdparty' directory holding the gatb-core resources
230 231

The 'thirdparty' directory is only available for tool created outside the GATB-Tools repository.
DURAND Patrick's avatar
DURAND Patrick committed
232

233 234 235 236 237 238 239 240 241 242
Tools located within GATB-Tools rely on a common GATB-CORE sub-module already available in this repository.

The directory where the project is created has no link to any external resources. You can therefore
move it anywhere you want.

Such a project can be a start for building applications based on GATB-CORE. 

More on creating a new GATB-Core based project: [http://gatb-core.gforge.inria.fr/doc/api/new_project.html](http://gatb-core.gforge.inria.fr/doc/api/new_project.html)


DURAND Patrick's avatar
DURAND Patrick committed
243
#Contact
244

DURAND Patrick's avatar
DURAND Patrick committed
245
To contact a developer, request help, *etc*, use: 
246

DURAND Patrick's avatar
DURAND Patrick committed
247 248
    https://gatb.inria.fr/contact/
    
249

DURAND Patrick's avatar
DURAND Patrick committed
250
# License
251

DURAND Patrick's avatar
DURAND Patrick committed
252
GATB is free software; you can redistribute it and/or modify it under the [Affero GPL v3 license](http://www.gnu.org/licenses/agpl-3.0.en.html).