= Library Documentation =
Latest Doxygen documentation:
<span style="color: #B22222">Coming Soon</ span>
Additional documentation: <span style="color:#B22222">Currently outdated, but updates will be coming soon</span>
== Using the Library in Your Own Program ==
Using SampleProgram as a starting point ===[https://github.com/statgen/SampleProgram https://github.com/statgen/SampleProgram] is a simple program demonstrating how to write a tool that uses libStatGen . You can copy SampleProgram and use it as a starting point for your own program. In the main SampleProgram directory, update ChangeLog, .gitignore, and README.txt as appropriate. No changes to Makefile should be necessary. Update Makefile.inc, replacing all occurrences of <code>LIB_PATH_SAMPLE_PROGRAM</code> with <code>LIB_PATH_YOUR_PROGRAM_NAME</code> where <code>YOUR_PROGRAM_NAME</code> is a unique name that can be used to set an environment variable to locate the library for your program. (Most likely this won't need to be set, but is there in case you need it.)
SampleProgram has 4 subdirectories:
* src - this is where your own program code goes
* test - this is where your test code goes. Test code can be setup to run with <code>make test</code> to ensure the program works properly.
=== Working from Scratch ===
When compiling your code, be sure to include the library header files found in libStatgen/include/ and link in the appropriate library (opt, debug, or profile).
<span style="color:#B22222">Coming Soon</span>
''' Below are the outdated instructions for <code>statgen</code>
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 | StatGen Download Instructions]] and [[StatGen Repository#Compile.2FBuild | 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 ==
# Create a directory for your own code.
#* <code>mkdir MY_CODE_DIR</code>
# Move into your directory.
#* <code>cd MY_CODE_DIR</code>
# Copy the Makefile from the statgen directory.
#* <code>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).
# Create <code>Makefile.tool</code>
#* See [[Makefile.tool]] for what to put into Makefile.tool.
# Compile your program
#* For optimal performance (be sure you also compiled statgen for optimal performance):
#* For debug (be sure that you also compiled statgen for debug):
#** <code>make OPTFLAG="-ggdb -O0"</code>
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 <code>STATGEN_DIR/stagen/lib/libStatGen.a STATGEN_DIR/statgen/lib/samtools/libbam.a -lm -lz -lssl</code> 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 =
* [[SAM/BAM Convert Sequence|SAM/BAM support conversion between '=' and the base in a sequence]]