##########################################################################################
# filterBam: a tool for cleaning alignment files in BAM format
#
# Author: 
# Tonatiuh Pena-Centeno
# Institut for Informatik un Mathematik
# Universität Greifswald
# 17489 Greifswald
# Germany
# tonatiuh.pena.centeno@gmail.com
#
# File created on: 4-March-2012
# Last modified on: 16-October-2015 by Katharina Hoff (katharina.hoff@gmail.com)
##########################################################################################


Contents:

1. INTRODUCTION
2. DEPENDENCIES
2. INSTALLING
3. RUNNING 


		1. INTRODUCTION
		----------------

filterBAM is a C++ routine for filtering BAM alignment files; it is based on filterPSL, a Perl script written 
by Prof. Dr. Mario Stanke for the cleaning of PSL alignment files. For more information regarding the 
filter, please check the accompanying PDF file, located under the 'doc' directory of this installation.

		2. DEPENDENCIES
		----------------

1. Bamtools' API is required for compilation. 

*** On Ubunutu ***
------------------
Make sure that the repository universe is in your '/etc/apt/sources.list'. It should contain a line like:

     deb http://us.archive.ubuntu.com/ubuntu vivid main universe

In case you had to add that line, run (otherwise skip):

   sudo apt-get update

Install bamtools and libbamtools-dev:

   sudo apt-get install bamtools libbamtools-dev

*** If you dont' have Ubuntu ***
--------------------------------

Go to the web-page: https://github.com/pezmaster31/bamtools/wiki , and more specifically to the section 'Building and installing' for instructions on how to get and compile 
the latest version of Bamtools. The softwares 'git' and 'cmake' will probably be required as well. Once with Bamtools, filterBam can be compiled (see Section 3).

After compilation of Bamtools, a binary 'bamtools' is created. This so-called utility-kit allows the: 
sorting, sampling, filtering, among other things, of of BAM files. It is recommended to practice a bit with 
such features given that filterBam only accepts as input BAM files that have been previously sorted by 
'query name'. 

********************************

2. Although not required by filterBam, it may also be convenient to have a copy of the software Samtools. 
This software is available via subversion (svn) on the web page: http://samtools.sourceforge.net/ . Follow 
the installation instructions contained in the distribution package of Samtools.

NOTE: Some examples on how to use Samtools and Bamtools utility kits are provided in the user manual of 
filterBam.

 		3. INSTALLING
		----------------

1. Download and extract the latest version of filterBam from the AUGUSTUS repository. 

2. If you use Ubuntu and installed bamtools and bamtools-dev via apt-get, you don't need to modify the Makefile. However, if you installed a bamtools version from github, you need to adapt the following line the src/Makefile:
Change

   BAMTOOLS = /usr/include/bamtools

to

   BAMTOOLS = /your/bamtools/from/github
.

2. Compile filterBam by typing 

> make

3. A binary file 'filterBam' should be stored in the folder 'bin'

> ls bin


		4. RUNNING
		----------------

Get the 'help' menu by typing 

>./filterBam --help 

Some toy data sets are stored in the folder 'data' in case you want to see how the filter works.

