Overview

HTTPS SSH
#Publication 
A manuscript describing BAYSIC has been published in BMC Bioinformatics and is available here:
http://www.biomedcentral.com/1471-2105/15/104/abstract

#License
BAYSIC may be used for purely academic purposes without charge. For any other use, especially commercial use or where the user or the user's customer, affiliated institution, employer or contracting party is paying money or exchanging anything of value in whole or part for any data output generated by BAYSIC or any data that makes use of or depends upon BAYSIC output, then you or your associated entity must obtain a license to use BAYSIC from Genformatic in advance of download or use of BAYSIC. To license BAYSIC for commercial use or any use other than purely academic research, please contact Genformatic at info@genformatic.com.

Downloading or using BAYSIC indicates your acceptance of these terms and conditions: "I understand and agree that the BAYSIC source code is copyrighted and owned by Genformatic, and is an implementation of a patent-pending method of improved variant detection developed and owned by Genformatic. As a precondition to accessing and using BAYSIC, I represent that I will only use BAYSIC for purely academic research purposes. I understand that any other use, modification, or republication of BAYSIC is strictly prohibited without first obtaining a license from Genformatic, and I agree that any use of BAYSIC for other than purely academic research may be enjoined by Genformatic without first proving irreperable harm or any other usual prerequisite to injunctive relief, and without prejudice to Genformatic's subsequent ability to recover monetary damages from me for unauthorized use."

#VMware image: 
A VMware Ubuntu 12.04 image with BAYSIC pre-installed is available here: 
 https://dl.dropboxusercontent.com/u/929268/BAYSIC_install_ubuntu_12_04.tar.gz

     md5 checksum: 4905dad7de234c302a8833214bc17389
     ubuntu user id: user
     password: password
     root password: password

#Use
The software is a Perl script which in turn calls an R script. Input is two or more VCF files, and output is a single combined VCF file and a .stats file with statistical details about the BAYSIC run (posterior probabilities for each possible combination of callers, bivariate residuals for each caller, etc), and a .cts file providing the number of variants that were called by each of the various callers. 

Invoke BAYSIC thusly: 

     perl baysic.pl --statsOutFile combined.stats --pvalCutoff 0.8 --vcf file1.vcf --vcf file2.vcf --countsOutFile combined.cts --vcfOutFile combined.vcf

#Installation

Installing dependencies:
NOTE: The walkthrough below is a little unix-centric, specifically Ubuntu-centric. What package manager you use (yum, fink, ports, apt-get) will depend on what operating system you are using.

###1) Perl dependencies:

     > sudo perl -MCPAN -e 'shell' 
     cpan[1]> install JSON File::Temp Getopt::Long List::Util File::Next Test::Warn File::Slurp PerlIO::gzip File::Which local::lib 

###2) VCFtools

LINUX

     sudo apt-get install vcftools # ubuntu-like linux

OSX

     fink install vcftools

No port package seems to be available as of Jan. 2015

SOURCE

     http://sourceforge.net/projects/vcftools/

###3) SAMtools

LINUX

     sudo apt-get install samtools # ubuntu-like linux

OSX

     fink install samtools # OR
     port search samtools

SOURCE

     http://sourceforge.net/projects/samtools/files/samtools/1.1/

###4) tabix (and bgzip, for free)

LINUX

     sudo apt-get install tabix # ubuntu-like linux

OSX

    sudo fink install tabix

no port package for tabix seems to be available as of Jan 2015

SOURCE

    http://sourceforge.net/projects/samtools/files/tabix/

###5) R (a statistics/graphing language, http://www.r-project.org/)
To install R using apt-get (works on many types of linux):  

     sudo apt-get install r-base 

make sure the version of R that apt-get installed was >2.14.0 (this is required by the R package 'R2jags')

     apt-show-versions r-base 

optional: 

     sudo apt-get install r-dev # not necessary on Ubuntu at least

###6) JAGS (a Gibbs sampler library):
To install JAGS on Ubuntu: 

     apt-get install jags 

NOTE: DO NOT INSTALL the r-cran-rjags via apt-get!!!! This package isn't compatible with the current BAYSIC source code. 

or otherwise download here:
 http://sourceforge.net/projects/mcmc-jags/?source=directory

then follow directions. 

You may need to also install lapack, which in Ubuntu may already be installed, or else just install these packages:

     sudo apt-get install liblapack-dev liblapack3gf

or else install from source here:
 wget http://www.netlib.org/lapack/lapack-3.4.2.tgz

###6) Install some R packages:

R2jags (R wrapper for JAGS)

R # start R

     > install.packages("rjags") 
     > install.packages("R2jags")

getopt (R package for commandline processing)

     > install.packages("getopt")

reshape2

     > install.packages("reshape2")

check if everything installed properly by running the following in R:

     > library(rjags)
     > library(getopt)
     > library(R2jags) 
     > library(reshape2) 

#Tests
NOTE: We strongly recommend running the tests below and not proceeding before all of the tests pass. If you encounter problems, please contact the BAYSIC dev team (info@genformatic.com) and we will help you sort out any issues. 

A suite of Perl unit tests is provided. On unix-like operating systems, you can invoke them thusly: 

     cd [base directory]
     ./run_tests.sh

Troubleshooting: 

On linux (especially Ubuntu), if you encounter this error when compiling Vcftools: 

     undefined reference to `gzbuffer'

Try changing this line 

     LIB = -lz 

in lib/vcftools_0.1.9/cpp/Makefile to this: 

     LIB = -L/usr/local/lib/ -lz

Some users have reported issues with Ubuntu 14 related to zlib. Ubuntu 12 and 13 seem to allow an easier install. 

If you encounter the following error on Os X (especially on Os X Mavericks): 

     Loading required package: coda
     Loading required package: lattice
     Error : .onLoad failed in loadNamespace() for 'rjags', details:
     call: dyn.load(file, DLLpath = DLLpath, ...)
     error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.0/Resources/library/rjags/libs/rjags.so':
     dlopen(/Library/Frameworks/R.framework/Versions/3.0/Resources/library/rjags/libs/rjags.so, 10): Library not loaded: /usr/local/lib/libjags.3.dylib
     Referenced from: /Library/Frameworks/R.framework/Versions/3.0/Resources/library/rjags/libs/rjags.so
     Reason: image not found
     In addition: Warning message:
     package 'rjags' was built under R version 3.0.2
     Error: package or namespace load failed for 'rjags'

Try installing RJAGS from this dmg image: 
 http://sourceforge.net/projects/mcmc-jags/