C++ Library: libStatGen

From Genome Analysis Wiki
Jump to navigationJump to search


DESCRIPTION

Open source, freely available (GPL license), easy to use C++ APIs

  • General Operation Classes including:
    • File/Stream I/O – uncompressed, BGZF, GZIP, stdin, stdout
    • String processing
    • Parameter Parsing
  • Statistical Genetic Specific Classes including:
    • Handling Common file formats – SAM/BAM, FASTQ, GLF
      • Accessors to get/set values
      • Indexed access to BAM files
    • Utility classes, including:
      • Cigar – interpretation and mapping between query and reference
      • Pileup – structured access to data by individual reference position


Library Documentation

Latest Doxygen documentation: 3/22/11 Library Documentation in Doxygen

Version 0.1.2 Library Documentation in Doxygen

Possibly out of date documentation:

Using the Library

In the following instructions/comments:

  • replace STATGEN_DIR with the path to where the statgen directory is located (does not include statgen/).
  • replace MY_CODE_DIR with the path where you want your code located.

To use the StatGen Library, first download and compile via StatGen Download Instructions and StatGen Compile/Build Instructions

This creates the library: STATGEN_DIR/statgen/lib/libStatGen.a, where STATGEN_DIR is the path to where you dec

Creating programs using the Default Makefile

  1. Create a directory for your own code.
    • mkdir MY_CODE_DIR
  2. Move into your directory.
    • cd MY_CODE_DIR
  3. Copy the Makefile from the statgen directory.
    • cp STATGEN_DIR/statgen/src/Makefile.src Makefile
    • You could instead link the Makefile, but then be careful not to modify it for your program because that may break any other programs that link to it (including those with the statgen repository).
  4. Create Makefile.tool
  5. Compile your program
    • For optimal performance (be sure you also compiled statgen for optimal performance):
      • make
    • For debug (be sure that you also compiled statgen for debug):
      • make OPTFLAG="-ggdb -O0"

NOTE: When you compile, all of your '.o' files will go in a directory called obj that will be created by the Makefile if it does not already exist.

Creating programs Without the Default Makefile

You can also use your own Makefile or method of building.

Just be sure to add -ISTAGEN_DIR/statgen/lib/include to your compile line to pull in the library header files.

Add STATGEN_DIR/stagen/lib/libStatGen.a STATGEN_DIR/statgen/lib/samtools/libbam.a -lm -lz -lssl in that order to the end of your compile line to pull in the necessary libraries.

NOTE: These are all handled for you if you use Makefile.src from the statgen repository.

Recently Added Capabilities