### R code from vignette source 'BBCAnalyzer.Rnw'
### Encoding: UTF-8

###################################################
### code chunk number 1: Example1
###################################################
library("BSgenome.Hsapiens.UCSC.hg19")
ref_genome<-BSgenome.Hsapiens.UCSC.hg19
library("BBCAnalyzer")

output<-analyzeBases(sample_names=system.file("extdata","SampleNames.txt",package="BBCAnalyzer"),
            bam_input=system.file("extdata",package="BBCAnalyzer"),
            target_regions=system.file("extdata","targetRegions.txt",package="BBCAnalyzer"),
            vcf_input="",
            output=system.file("extdata",package="BBCAnalyzer"),
            output_pictures=system.file("extdata",package="BBCAnalyzer"),
            known_file=system.file("extdata","dbsnp_138.part.vcf.gz",package="BBCAnalyzer"),
            genome=ref_genome,
            MQ_threshold=60,
            BQ_threshold=50,
            frequency_threshold=0.01,
            qual_lower_bound=58,
            qual_upper_bound=63,
            marks=c(0.01),
            relative=TRUE,
            per_sample=TRUE)


###################################################
### code chunk number 2: Example2
###################################################
library("BSgenome.Hsapiens.UCSC.hg19")
ref_genome<-BSgenome.Hsapiens.UCSC.hg19
library("BBCAnalyzer")

output<-analyzeBases(sample_names=system.file("extdata","SampleNames.txt",package="BBCAnalyzer"),
            bam_input=system.file("extdata",package="BBCAnalyzer"),
            target_regions=system.file("extdata","targetRegions2.txt",package="BBCAnalyzer"),
            vcf_input=system.file("extdata",package="BBCAnalyzer"),
            output=system.file("extdata",package="BBCAnalyzer"),
            output_pictures=system.file("extdata",package="BBCAnalyzer"),
            known_file=system.file("extdata","dbsnp_138.part.vcf.gz",package="BBCAnalyzer"),            
            genome=ref_genome,
            MQ_threshold=60,
            BQ_threshold=50,
            frequency_threshold=0.01,
            qual_lower_bound=58,
            qual_upper_bound=63,
            marks=c(0.2,0.4,0.6,0.8,1),
            relative=FALSE,
            per_sample=FALSE)


###################################################
### code chunk number 3: Example3
###################################################
library("BSgenome.Hsapiens.UCSC.hg19")
ref_genome<-BSgenome.Hsapiens.UCSC.hg19
library("BBCAnalyzer")

output<-analyzeBases(
            sample_names=system.file("extdata","SampleNames_small.txt",package="BBCAnalyzer"),
            bam_input=system.file("extdata",package="BBCAnalyzer"),
            target_regions=system.file("extdata","targetRegions_small.txt",package="BBCAnalyzer"),
            vcf_input="",
            output=system.file("extdata",package="BBCAnalyzer"),
            output_pictures=system.file("extdata",package="BBCAnalyzer"),
            known_file="", 
            genome=ref_genome,
            MQ_threshold=60,
            BQ_threshold=50,
            frequency_threshold=0.01,
            qual_lower_bound=58,
            qual_upper_bound=63,
            marks=c(0.01),
            relative=TRUE,
            per_sample=TRUE)


