Learn R Programming

InPAS (version 1.4.4)

usage4plot: prepare coverage data and fitting data for plot

Description

prepare coverage data and fitting data for plot

Usage

usage4plot(gr, coverage, proximalSites, genome, groupList, gcCompensation=NA, mappabilityCompensation=NA, FFT=FALSE, fft.sm.power=20)

Arguments

gr
an object of GRanges
coverage
coverage for each sample
proximalSites
proximal sites
genome
an object of BSgenome
groupList
the list of sample names
gcCompensation
GC content compensation vector
mappabilityCompensation
mappability compensation vector
FFT
use FFT to smooth the data or not. default: FALSE
fft.sm.power
if FFT is TRUE, the frequency should be removed

Value

Formal class 'GRanges' [package "GenomicRanges"] with metadata:
dat
matrix, first column is the fit data, the other columns are coverage data for each sample
offset
offset from the start of 3UTR

Examples

Run this code
    library(BSgenome.Mmusculus.UCSC.mm10)
    path <- file.path(find.package("InPAS"), "extdata")
    bedgraphs <- c(file.path(path, "Baf3.extract.bedgraph"), 
               file.path(path, "UM15.extract.bedgraph"))
    coverage <- coverageFromBedGraph(bedgraphs, tags=c("Baf3", "UM15"), 
                                genome=Mmusculus, hugeData=FALSE)
    gr <- GRanges("chr6", IRanges(128846245, 128850081), strand="-")
    dat <- usage4plot(gr, coverage, proximalSites=128849148, Mmusculus)
    data <- dat$dat[[1]]
    op <- par(mfrow=c(3, 1))
    plot(data[,1], type="l", xlab="", ylab="The fitted value")
    abline(v=dat$offset)
    plot(data[,2], type="l", xlab="", ylab="Baf3")
    plot(data[,3], type="l", xlab="", ylab="UM15")
    par(op)

Run the code above in your browser using DataLab