usage4plot {InPAS} | R Documentation

## prepare coverage data and fitting data for plot

### Description

prepare coverage data and fitting data for plot

### Usage

        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

        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)

[Package InPAS version 1.16.3 Index]