Description Usage Arguments Value Examples
View source: R/peakDownSampling.R
Function to downsample bam files: reads ChIP and Input bam files, calles peaks and removes randomly 60percent of the reads from the peaks. Returns a downsampled ChIP dataframe.
downsample_ChIPpeaks
1 2 3 4 5 6 7 8 | downsample_ChIPpeaks(
chip.data,
input.data,
read_length,
annotationID = "hg19",
mc = 1,
debug = FALSE
)
|
chip.data |
data-structure with tag information reads from bam file (see readBamFile()) |
input.data |
data-structure with tag information reads from bam file (see readBamFile()) |
read_length |
Integer, length of the reads |
annotationID |
String, indicating the genome assembly (Default="hg19") |
mc |
Integer, the number of CPUs for parallelization (default=1) |
debug |
Boolean, to enter debugging mode. Intermediate files are saved in working directory |
chip.dataDownSampeld, data-structure with downsampled tags
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ## This command is time intensive to run
## To run this example code the user MUST provide 2 bam files: one for ChIP
## and one for the input". Here we used ChIP-seq data from ENCODE. Two
## example files can be downloaded using the following link:
## https://www.encodeproject.org/files/ENCFF000BFX/
## https://www.encodeproject.org/files/ENCFF000BDQ/
## and save them in the working directory (here given in the temporary
## directory "filepath"
mc=4
## Not run:
filepath=tempdir()
setwd(filepath)
data("chipSubset", package = "ChIC.data", envir = environment())
chipBam=chipSubset
data("inputSubset", package = "ChIC.data", envir = environment())
inputBam=inputSubset
chip.dataNew=downsample_ChIPpeaks(chip.data=chipBam,
input.data=inputBa, read_length=read_length,
annotationID="hg19", mc=mc, debug=FALSE)
message(" downsampling from", sum(unlist(lapply(chipBam$tags,length)))," to ",
sum(unlist(lapply(chip.dataNew$tags,length))))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.