Last data update: 2014.03.03

R: Plots the alignment of sequence tags on the genome given an...
plotGenomeR Documentation

Plots the alignment of sequence tags on the genome given an ‘aligmentData’ object and (optionally) a set of segments found.

Description

Plots the data from an alignmentData object for a given set of samples. Can optionally include in the plot the annotation data from a lociData object containing segment information.

Usage

plotGenome(aD, loci, chr = 1, limits = c(0, 1e4), samples = NULL,
plotType = "pileup", plotDuplicated = FALSE, density = 0, showNumber =
TRUE, logScale = FALSE, cap = Inf, ...)

Arguments

aD

An alignmentData object.

loci

A lociData object (produced by the heuristicSeg or classifySeg function and therefore) containing appropriate annotation information. Can be omitted if this annotation is not known/required.

chr

The name of the chromosome to be plotted. Should correspond to a chromosome name in the alignmentData object.

limits

The start and end point of the region to be plotted.

samples

The sample numbers of the samples to be plotted. If NULL, plots all samples.

plotType

The manner in which the plot is created. Currently only plotType = pileup is recommended.

plotDuplicated

If TRUE, then any duplicated sequence tags (i.e., sequence tags that match to multiple places in the genome) in the ‘aD’ object will be plotted on a negative scale for each sample. Defaults to FALSE (recommended).

density

The density of the shading lines to be used in plotting each segment.

showNumber

Should the row number of each segment be shown?

logScale

Should a log scale be used for the number of sequence tags found at each base?

cap

A numeric value defining a cap on the maximum number of reads to be plotted at any one point. Useful if a large number of reads at one location prevent a clear signal being seen elsewhere.

...

Any additional graphical parameters for passing to plot.

Value

Plotting function.

Author(s)

Thomas J. Hardcastle

See Also

alignmentData, heuristicSeg, classifySeg

Examples



# Define the chromosome lengths for the genome of interest.

chrlens <- c(2e6, 1e6)

# Define the files containing sample information.

datadir <- system.file("extdata", package = "segmentSeq")
libfiles <- c("SL9.txt", "SL10.txt", "SL26.txt", "SL32.txt")

# Establish the library names and replicate structure.

libnames <- c("SL9", "SL10", "SL26", "SL32")
replicates <- c(1,1,2,2)

# Process the files to produce an `alignmentData' object.

alignData <- readGeneric(file = libfiles, dir = datadir, replicates =
replicates, libnames = libnames, chrs = c(">Chr1", ">Chr2"), chrlens =
chrlens, gap = 100)

# Plot the alignments to the genome on chromosome 1 between bases 1 and 10000

plotGenome(alignData, chr = ">Chr1", limits = c(1, 1e5))

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(segmentSeq)
Loading required package: baySeq
Loading required package: GenomicRanges
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Loading required package: S4Vectors
Loading required package: stats4

Attaching package: 'S4Vectors'

The following objects are masked from 'package:base':

    colMeans, colSums, expand.grid, rowMeans, rowSums

Loading required package: IRanges
Loading required package: GenomeInfoDb
Loading required package: abind
Loading required package: perm
Loading required package: ShortRead
Loading required package: BiocParallel
Loading required package: Biostrings
Loading required package: XVector
Loading required package: Rsamtools
Loading required package: GenomicAlignments
Loading required package: SummarizedExperiment
Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/segmentSeq/plotGenome.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plotGenome
> ### Title: Plots the alignment of sequence tags on the genome given an
> ###   'aligmentData' object and (optionally) a set of segments found.
> ### Aliases: plotGenome
> ### Keywords: hplot
> 
> ### ** Examples
> 
> 
> 
> # Define the chromosome lengths for the genome of interest.
> 
> chrlens <- c(2e6, 1e6)
> 
> # Define the files containing sample information.
> 
> datadir <- system.file("extdata", package = "segmentSeq")
> libfiles <- c("SL9.txt", "SL10.txt", "SL26.txt", "SL32.txt")
> 
> # Establish the library names and replicate structure.
> 
> libnames <- c("SL9", "SL10", "SL26", "SL32")
> replicates <- c(1,1,2,2)
> 
> # Process the files to produce an `alignmentData' object.
> 
> alignData <- readGeneric(file = libfiles, dir = datadir, replicates =
+ replicates, libnames = libnames, chrs = c(">Chr1", ">Chr2"), chrlens =
+ chrlens, gap = 100)
Reading files........done!
Analysing tags...........done!
> 
> # Plot the alignments to the genome on chromosome 1 between bases 1 and 10000
> 
> plotGenome(alignData, chr = ">Chr1", limits = c(1, 1e5))
Computing plot.....done!
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>