Last data update: 2014.03.03

R: plotRegion
plotRegionR Documentation

plotRegion

Description

Plots the read density given a chromosome region.

Usage

plotRegion(bamlist, region, howsmooth = 2, ncounts = NULL, samplenames = NULL)

Arguments

bamlist

An object of type list, giving a list of bam files. If you only have 1 file, use list(bam_file)

region

An object of type character defining the region to plot. Eg. chr1:1000-2000

howsmooth

Numeric value controlling smoothness of the plot.

ncounts

Total number of reads for plot normalization.

samplenames

Sample names

Value

Returns the x and y components of the region's reads and plots the density.

Author(s)

Diana H.P. Low

Examples

data(ssviz)
region<-'chr1:3015526-3080526'
plotRegion(list(ctrlbam), region=region)

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(ssviz)
Loading required package: Rsamtools
Loading required package: GenomeInfoDb
Loading required package: stats4
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

Attaching package: 'S4Vectors'

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

    colMeans, colSums, expand.grid, rowMeans, rowSums

Loading required package: IRanges
Loading required package: GenomicRanges
Loading required package: Biostrings
Loading required package: XVector
Loading required package: reshape

Attaching package: 'reshape'

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

    expand, rename

Loading required package: ggplot2
Loading required package: RColorBrewer
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/ssviz/plotRegion.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plotRegion
> ### Title: plotRegion
> ### Aliases: plotRegion
> 
> ### ** Examples
> 
> data(ssviz)
> region<-'chr1:3015526-3080526'
> plotRegion(list(ctrlbam), region=region)
No counts column provided in bam file. Running unique counts.
Otherwise provide a count matrix or run getCountMatrix.

Processing bam file # 1
   |                                                                               |                                                                      |   0%   |                                                                               |=                                                                     |   2%   |                                                                               |==                                                                    |   3%   |                                                                               |===                                                                   |   5%   |                                                                               |=====                                                                 |   6%   |                                                                               |======                                                                |   8%   |                                                                               |=======                                                               |  10%   |                                                                               |========                                                              |  11%   |                                                                               |=========                                                             |  13%   |                                                                               |==========                                                            |  15%   |                                                                               |===========                                                           |  16%   |                                                                               |============                                                          |  18%   |                                                                               |==============                                                        |  19%   |                                                                               |===============                                                       |  21%   |                                                                               |================                                                      |  23%   |                                                                               |=================                                                     |  24%   |                                                                               |==================                                                    |  26%   |                                                                               |===================                                                   |  27%   |                                                                               |====================                                                  |  29%   |                                                                               |=====================                                                 |  31%   |                                                                               |=======================                                               |  32%   |                                                                               |========================                                              |  34%   |                                                                               |=========================                                             |  35%   |                                                                               |==========================                                            |  37%   |                                                                               |===========================                                           |  39%   |                                                                               |============================                                          |  40%   |                                                                               |=============================                                         |  42%   |                                                                               |==============================                                        |  44%   |                                                                               |================================                                      |  45%   |                                                                               |=================================                                     |  47%   |                                                                               |==================================                                    |  48%   |                                                                               |===================================                                   |  50%   |                                                                               |====================================                                  |  52%   |                                                                               |=====================================                                 |  53%   |                                                                               |======================================                                |  55%   |                                                                               |========================================                              |  56%   |                                                                               |=========================================                             |  58%   |                                                                               |==========================================                            |  60%   |                                                                               |===========================================                           |  61%   |                                                                               |============================================                          |  63%   |                                                                               |=============================================                         |  65%   |                                                                               |==============================================                        |  66%   |                                                                               |===============================================                       |  68%   |                                                                               |=================================================                     |  69%   |                                                                               |==================================================                    |  71%   |                                                                               |===================================================                   |  73%   |                                                                               |====================================================                  |  74%   |                                                                               |=====================================================                 |  76%   |                                                                               |======================================================                |  77%   |                                                                               |=======================================================               |  79%   |                                                                               |========================================================              |  81%   |                                                                               |==========================================================            |  82%   |                                                                               |===========================================================           |  84%   |                                                                               |============================================================          |  85%   |                                                                               |=============================================================         |  87%   |                                                                               |==============================================================        |  89%   |                                                                               |===============================================================       |  90%   |                                                                               |================================================================      |  92%   |                                                                               |=================================================================     |  94%   |                                                                               |===================================================================   |  95%   |                                                                               |====================================================================  |  97%   |                                                                               |===================================================================== |  98%   |                                                                               |======================================================================| 100%Num reads: 62  Unique positions: 62
[[1]]
[[1]][[1]]
  [1] 2990946 2991882 2992818 2993753 2994689 2995625 2996561 2997496 2998432
 [10] 2999368 3000304 3001240 3002175 3003111 3004047 3004983 3005918 3006854
 [19] 3007790 3008726 3009662 3010597 3011533 3012469 3013405 3014341 3015276
 [28] 3016212 3017148 3018084 3019019 3019955 3020891 3021827 3022763 3023698
 [37] 3024634 3025570 3026506 3027441 3028377 3029313 3030249 3031185 3032120
 [46] 3033056 3033992 3034928 3035863 3036799 3037735 3038671 3039607 3040542
 [55] 3041478 3042414 3043350 3044285 3045221 3046157 3047093 3048029 3048964
 [64] 3049900 3050836 3051772 3052708 3053643 3054579 3055515 3056451 3057386
 [73] 3058322 3059258 3060194 3061130 3062065 3063001 3063937 3064873 3065808
 [82] 3066744 3067680 3068616 3069552 3070487 3071423 3072359 3073295 3074230
 [91] 3075166 3076102 3077038 3077974 3078909 3079845 3080781 3081717 3082652
[100] 3083588 3084524 3085460 3086396 3087331 3088267 3089203 3090139 3091075
[109] 3092010 3092946 3093882 3094818 3095753 3096689 3097625 3098561 3099497
[118] 3100432 3101368 3102304 3103240 3104175 3105111 3106047


[[2]]
[[2]][[1]]
  [1]    16.01595    22.31271    30.79543    41.96924    56.77122    75.87440
  [7]   100.43742   131.66275   170.70716   219.56019   279.34185   352.32652
 [13]   440.21656   544.85496   668.95882   813.63068   981.95201  1175.04687
 [19]  1394.86447  1643.51741  1921.13376  2230.38547  2570.27366  2941.62895
 [25]  3344.02824  3775.46735  4235.59484  4720.03567  5225.97317  5748.24402
 [31]  6280.93066  6817.13080  7348.75616  7866.37577  8360.39190  8820.59166
 [37]  9235.07866  9595.65501  9889.25807 10110.06239 10249.78819 10302.46570
 [43] 10268.53721 10142.60358  9932.75880  9641.70210  9278.37808  8854.42695
 [49]  8380.04647  7871.52482  7342.21575  6807.66219  6281.91146  5779.22611
 [55]  5310.16359  4886.72195  4515.13266  4201.41260  3949.79824  3758.87999
 [61]  3631.08631  3560.27609  3543.69571  3575.73802  3649.14973  3759.26770
 [67]  3897.50335  4058.55124  4236.00452  4424.54047  4619.82561  4817.86980
 [73]  5015.80064  5211.39460  5403.12469  5589.83367  5771.09056  5946.13056
 [79]  6114.83622  6276.57273  6430.50260  6575.79025  6710.21358  6832.30954
 [85]  6939.01237  7027.28582  7094.09025  7134.56050  7146.34408  7124.51931
 [91]  7066.63554  6970.24078  6832.40926  6654.28410  6434.26268  6175.73642
 [97]  5881.10866  5554.21796  5201.24849  4826.95074  4439.04544  4043.93214
[103]  3648.66535  3259.56412  2883.24454  2524.15909  2187.32303  1875.68030
[109]  1591.18983  1336.09464  1109.28285   911.56904   740.74287   595.26511
[115]   473.40653   371.92936   289.41202   222.48040   169.16491   127.25678
[121]    94.49785    69.57715    50.54606    36.34874


> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>