usage4plot: prepare coverage data and fitting data for plot

Description Usage Arguments Value Author(s) Examples

View source: R/usage4plot.R

Description

prepare coverage data and fitting data for plot

Usage

1
    usage4plot(gr, coverage, proximalSites, genome, groupList)

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

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

Author(s)

Jianhong Ou

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
    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)

InPAS documentation built on Nov. 8, 2020, 5:03 p.m.