
                                    Casbar
            SNP and methylation level calling in mapped bisulfite read data

                                Version 0.1
                                 May, 2014

---------------------------------------------------------------------------
Table of Contents
---------------------------------------------------------------------------
  1.   Overview
  3.   Usage
  4.   Output Format
  5.   Example
  6.   Contact
  7.   References

---------------------------------------------------------------------------
1. Overview
---------------------------------------------------------------------------

Casbar uses pairwise four-letter alignments given in SAM format for
simultaneous SNP and methylation level calling. A Bayesian model is used to
compute the posterior probability for each possible genotype under the
observed data and a given methylation level. The methylation level maximizing
the posterior probability is determined and the genotype with the highest
probability is chosen. Therefore the bisulfite conversion rate and base
qualities, if chosen combined with base dependent sequencing error frequencies,
are incorporated.
All called SNPs and methylation levels that pass the verification criteria
are given out in a VCF and BED file respectively.

---------------------------------------------------------------------------
3. Usage
---------------------------------------------------------------------------

To get a short usage description of Casbar, you can execute casbar -h or
casbar --help.

Usage:  casbar [OPTIONS] <GENOME FILE> <ALIGNMENT FILE> -o <SNP FILE> -b <METH-LEVEL FILE>

---------------------------------------------------------------------------
3.1. Main Options
---------------------------------------------------------------------------

  [ -o FILE ],  [ --output FILE ]

  Output file for SNPs. Valid filetype is: .vcf.

  [ -b FILE ],  [ --bed FILE ]

  Bed output file for methylation level calls. Valid filetype is: .bed.

  [ -mu ],  [ --multi ]

  Keep non-unique reads.

  [ -mp NUM],  [ --max-pile NUM ]

  Maximal number of matches allowed to pile up at the same genome position.
  In range [0..inf]. Default: 0.

  [ -mmp ],  [ --merged-max-pile ]

  Do pile up correction on merged lanes.

  [ -mc NUM ],  [ --min-coverage NUM ]

  Minimal required number of reads covering a candidate position.
  In range [1..inf]. Default: 6.

  [ -eb NUM ],  [ --exclude-border NUM ]

  Exclude read positions within eb base pairs of read borders for
  SNP calling. Default: 0.

  [ -su ],  [ --suboptimal ]

  Keep suboptimal reads.

  [ -pws NUM ],  [ --parse-window-size NUM ]

  Genomic window size for parsing reads (concerns memory consumption,
  choose smaller windows for higher coverage). In range [1..100000].
  Default: 100000.

  [ -I TEXT],  [ --intervals TEXT ]

  Genomic intervals to analyze. E.g. 21:1000-2000.

  [ -bcr NUM ],  [ --bs-conv-rate NUM ]

  Bisulfite conversion rate. In range [0..1]. Default: 0.998.

  [ -mm NUM ],  [ --min-mutations NUM ]

  Minimal number of deviating bases for calling. In range [1..inf].
  Default: 3.

  [ -mq NUM],  [ --min-quality NUM ]

  Minimal average quality for calling. In range [0..inf]. Default: 10.

  [ -mmq NUM],  [ --min-map-quality NUM ]

  Minimum base call quality for a match to be considered. In range [0..inf].
  Default: 1.

  [ -hes NUM ],  [ --prob-hetero-snp NUM ]

  Heterozygous SNP probability to compute genotype prior probabilities.
  In range [0..1]. Default: 0.005.

  [ -hos NUM],  [ --prob-homo-snp NUM ]

  Homozygous SNP probability to compute genotype prior probabilities.
  In range [0..1]. Default: 0.0005.

  [ -msc NUM],  [ --min-score NUM ]

  Minimum score to call. Default: 9.

  [ -mpc NUM],  [ --min-prob NUM ]

  Minimum genotype probability to call. In range [0..1]. Default: 0.7.

  [ -nec ],  [ --ns-errors-calling ]

  Use empirical error frequencies of Illumina sequencing data to compute
  likelihoods in bayesian model (corresponding to Dohm et al. 2008).

  [ -v ],  [ --verbose ]

  Enable verbose output.

  [ -vv ],  [ --very-verbose ]

  Enable very verbose output.

  [ -q ],  [ --quiet ]

  Set verbosity to a minimum.

  [ -h ],  [ --help ]

  Displays this help message.

  [ --version ]

  Display version information.


---------------------------------------------------------------------------
4. Output Formats
---------------------------------------------------------------------------

All called SNPs that pass the verification criteria are given out in a VCF
file.

All called methylation levels that pass the verification criteria
are given out in a BED file
(BED6 format: chrom, start, end, name, score, strand and methylation level).

---------------------------------------------------------------------------
5. Example
---------------------------------------------------------------------------

In order to perform SNP and methylation level calling by taking nonuniform
sequencing error probabilities into account call:

  casbar -nec -o snps.vcf -b meth_levels.bed genome.fa \
   mapped_bisulfite_reads.sam

To perform SNP and methylation level calling by taking nonuniform sequencing
error probabilities into account for genomic positions with a coverage >= 6
call:

  casbar -nec -mc 6 -msc 5 -o snps.vcf -b meth_levels.bed genome.fa \
   mapped_bisulfite_reads.sam

The minimum score in this case a SNP or methylation level to be called is 5.

---------------------------------------------------------------------------
6. Contact
---------------------------------------------------------------------------

For questions or comments, contact:
  Sabrina Krakau <sabrina.krakau@fu-berlin.de>
or
  David Weese <david.weese@fu-berlin.de>

---------------------------------------------------------------------------
7. References
---------------------------------------------------------------------------

More detailed information about the underlying method you can find in the
following document:
https://www.mi.fu-berlin.de/en/inf/groups/abi/theses/master_dipl/krakau/
msc_thesis_krakau.pdf?1394119375

