# example.gtf
The example.gtf file is obtained from UCSC hg19 GTF file.
17 genes are sampled from chromosome 7 of hg19 GTF,
the genomic range of the sampled genes are between 150671799 - 151042434.

# Input1-3.bam, IP1-4.bam
The BAM files are obtained from GEO study SRP012099.
The SRR ids for the 3 Input samples are SRR456555,SRR456556,and SRR456557
The SRR ids for the 4 IP samples are SRR456551,SRR456552,SRR456553,SRR456554

The fastq files are downloaded from the GEO,
and they are aligned with TopHat onto the human genome hg19.

We trancate the resulting BAM files to keep the mapped reads only on the region of 150671799 - 151042434 on chromosome 7.

# Input1-3.bam.bai, IP1-4.bam.bai
The BAM file indexes are generated from the corresponding BAM files with Rsamtools::indexBam()

# mod_annot.rds
This file stores a GRanges object that correspond to a subset of single based modification sites obtained from miCIP data.
The miCLIP data is downloaded from the supplementary file on GEO with GSE id of GSE73405.
Only the sites mapped to DRACH motif is kept.

# sep_ex_mod.rds
This file stores a SummarizedExomePeak object that is generated by the following code.
GENE_ANNO_GTF = system.file("extdata", "example.gtf", package="exomePeak2")

f1 = system.file("extdata", "IP1.bam", package="exomePeak2")
f2 = system.file("extdata", "IP2.bam", package="exomePeak2")
f3 = system.file("extdata", "IP3.bam", package="exomePeak2")
f4 = system.file("extdata", "IP4.bam", package="exomePeak2")
IP_BAM = c(f1,f2,f3,f4)
f1 = system.file("extdata", "Input1.bam", package="exomePeak2")
f2 = system.file("extdata", "Input2.bam", package="exomePeak2")
f3 = system.file("extdata", "Input3.bam", package="exomePeak2")
INPUT_BAM = c(f1,f2,f3)

### Peak Calling

MeRIP_Seq_Alignment <- scanMeripBAM(
                         bam_ip = IP_BAM,
                         bam_input = INPUT_BAM,
                         paired_end = FALSE
                        )

sep_ex_mod <- exomePeakCalling(
            merip_bams = MeRIP_Seq_Alignment,
            gff_dir = GENE_ANNO_GTF,
            genome = "hg19"
            )

saveRDS(sep_ex_mod,"sep_ex_mod.rds")


# sep_ex_dm.rds
This file stores a SummarizedExomePeak object that is generated by the following code.
GENE_ANNO_GTF = system.file("extdata", "example.gtf", package="exomePeak2")

f1 = system.file("extdata", "IP1.bam", package="exomePeak2")
f2 = system.file("extdata", "IP2.bam", package="exomePeak2")
f3 = system.file("extdata", "IP3.bam", package="exomePeak2")
f4 = system.file("extdata", "IP4.bam", package="exomePeak2")
IP_BAM = c(f1,f2,f3,f4)
f1 = system.file("extdata", "Input1.bam", package="exomePeak2")
f2 = system.file("extdata", "Input2.bam", package="exomePeak2")
f3 = system.file("extdata", "Input3.bam", package="exomePeak2")
INPUT_BAM = c(f1,f2,f3)

f1 = system.file("extdata", "treated_IP1.bam", package="exomePeak2")
TREATED_IP_BAM = c(f1)
f1 = system.file("extdata", "treated_Input1.bam", package="exomePeak2")
TREATED_INPUT_BAM = c(f1)

MeRIP_Seq_Alignment <- scanMeripBAM(
                         bam_ip = IP_BAM,
                         bam_input = INPUT_BAM,
                         bam_treated_ip = TREATED_IP_BAM,
                         bam_treated_input = TREATED_INPUT_BAM,
                         paired_end = FALSE
                        )

sep_ex_dm <- exomePeakCalling(
            merip_bams = MeRIP_Seq_Alignment,
            gff_dir = GENE_ANNO_GTF,
            genome = "hg19"
            )

saveRDS(sep_ex_dm,"sep_ex_dm.rds")
