Last data update: 2014.03.03

R: BamViews instance construction related to yeast RNA-seq
bs1R Documentation

BamViews instance construction related to yeast RNA-seq

Description

BamViews instance construction related to yeast RNA-seq

Format

The format is: Formal class 'BamViews' [package "Rsamtools"] with 5 slots
..@ bamPaths : chr [1:8] "/Users/stvjc/ExternalSoft/R-devel/library/leeBamViews/bam/isowt5_13e.bam" "/Users/stvjc/ExternalSoft/R-devel/library/leeBamViews/bam/isowt6_13e.bam" "/Users/stvjc/ExternalSoft/R-devel/library/leeBamViews/bam/rlp5_13e.bam" "/Users/stvjc/ExternalSoft/R-devel/library/leeBamViews/bam/rlp6_13e.bam" ...
..@ bamIndicies : chr [1:8] "/Users/stvjc/ExternalSoft/R-devel/library/leeBamViews/bam/isowt5_13e.bam" "/Users/stvjc/ExternalSoft/R-devel/library/leeBamViews/bam/isowt6_13e.bam" "/Users/stvjc/ExternalSoft/R-devel/library/leeBamViews/bam/rlp5_13e.bam" "/Users/stvjc/ExternalSoft/R-devel/library/leeBamViews/bam/rlp6_13e.bam" ...
..@ bamSamples :Formal class 'DataFrame' [package "IRanges"] with 6 slots
.. .. ..@ rownames : chr [1:8] "isowt.5" "isowt.6" "rlp.5" "rlp.6" ...
.. .. ..@ nrows : int 8
.. .. ..@ elementMetadata: NULL
.. .. ..@ elementType : chr "ANY
" .. .. ..@ metadata : list()
.. .. ..@ listData :List of 2
.. .. .. ..$ geno: chr [1:8] "isowt" "isowt" "rlp" "rlp" ...
.. .. .. ..$ lane: chr [1:8] "5" "6" "5" "6" ...
..@ bamRanges :Formal class 'GRanges' [package "GenomicRanges"] with 7 slots
.. .. ..@ seqnames :Formal class 'Rle' [package "IRanges"] with 5 slots
.. .. .. .. ..@ values : Factor w/ 1 level "Scchr13": 1
.. .. .. .. ..@ lengths : int 27
.. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. ..@ elementType : chr "ANY"
.. .. .. .. ..@ metadata : list()
.. .. ..@ ranges :Formal class 'IRanges' [package "IRanges"] with 6 slots
.. .. .. .. ..@ start : int [1:27] 798517 801771 804455 808999 810465 811088 818826 820255 822762 832338 ...
.. .. .. .. ..@ width : int [1:27] 2862 933 636 234 114 108 1122 2199 1869 915 ...
.. .. .. .. ..@ NAMES : NULL
.. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. ..@ elementType : chr "integer"
.. .. .. .. ..@ metadata : list()
.. .. ..@ strand :Formal class 'Rle' [package "IRanges"] with 5 slots
.. .. .. .. ..@ values : Factor w/ 3 levels "+","-","*": 1
.. .. .. .. ..@ lengths : int 27
.. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. ..@ elementType : chr "ANY"
.. .. .. .. ..@ metadata : list()
.. .. ..@ seqlengths : Named int NA
.. .. .. ..- attr(*, "names")= chr "Scchr13"
.. .. ..@ elementMetadata:Formal class 'DataFrame' [package "IRanges"] with 6 slots
.. .. .. .. ..@ rownames : NULL
.. .. .. .. ..@ nrows : int 27
.. .. .. .. ..@ elementMetadata: NULL
.. .. .. .. ..@ elementType : chr "ANY"
.. .. .. .. ..@ metadata : list()
.. .. .. .. ..@ listData :List of 1
.. .. .. .. .. ..$ name: chr [1:27] "YMR266W" "YMR267W" "YMR269W" "YMRWdelta20" ...
.. .. ..@ elementType : chr "ANY"
.. .. ..@ metadata : list()
..@ bamExperiment:List of 1
.. ..$ annotation: chr "org.Sc.sgd.db"

Details

Illumina short reads from a very small segment of yeast chr XIII have been collected

Source

FASTQ data available at ftp://ftp.ncbi.nlm.nih.gov/sra/Studies/SRP000/SRP000632/

References

Albert Lee and Kasper Daniel Hansen and James Bullard and Sandrine Dudoit and Gavin Sherlock, Novel Low Abundance and Transient RNAs in Yeast Revealed by Tiling Microarrays and Ultra High–Throughput Sequencing Are Not Conserved Across Closely Related Yeast Species, PLoS Genet, v4, e1000299, Dec 2008

Examples

library(leeBamViews)  # bam files stored in package
bpaths = dir(system.file("bam", package="leeBamViews"), full=TRUE, patt="bam$")
#
# extract genotype and lane information from filenames
#
gt = gsub(".*/", "", bpaths)
gt = gsub("_.*", "", gt)
lane = gsub(".*(.)$", "\1", gt)
geno = gsub(".$", "", gt)
#
# format the sample-level information appropriately
#
pd = DataFrame(geno=geno, lane=lane, row.names=paste(geno,lane,sep="."))
prd = new("DataFrame")  # protocol data could go here
#
# create the views object, adding some arbitrary experiment-level information
#
bs1 = BamViews(bamPaths=bpaths, bamSamples=pd,
        bamExperiment=list(annotation="org.Sc.sgd.db"))
bs1
# add ranges and tabulate reads

START=c(861250, 863000)
END=c(862750, 864000)
exc = GRanges(IRanges(start=START, end=END), seqnames="Scchr13", strand="+")
values(exc)$name = c("intv1", "intv2")  # necessary
bamRanges(bs1) = exc
bs1
tabulateReads(bs1, "+")

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(leeBamViews)
Loading required package: Biobase
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

Welcome to Bioconductor

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

Loading required package: Rsamtools
Loading required package: GenomeInfoDb
Loading required package: stats4
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: BSgenome
Loading required package: rtracklayer
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/leeBamViews/bs1.Rd_%03d_medium.png", width=480, height=480)
> ### Name: bs1
> ### Title: BamViews instance construction related to yeast RNA-seq
> ### Aliases: bs1
> ### Keywords: datasets
> 
> ### ** Examples
> 
> library(leeBamViews)  # bam files stored in package
> bpaths = dir(system.file("bam", package="leeBamViews"), full=TRUE, patt="bam$")
> #
> # extract genotype and lane information from filenames
> #
> gt = gsub(".*/", "", bpaths)
> gt = gsub("_.*", "", gt)
> lane = gsub(".*(.)$", "\1", gt)
> geno = gsub(".$", "", gt)
> #
> # format the sample-level information appropriately
> #
> pd = DataFrame(geno=geno, lane=lane, row.names=paste(geno,lane,sep="."))
> prd = new("DataFrame")  # protocol data could go here
> #
> # create the views object, adding some arbitrary experiment-level information
> #
> bs1 = BamViews(bamPaths=bpaths, bamSamples=pd,
+         bamExperiment=list(annotation="org.Sc.sgd.db"))
> bs1
BamViews dim: 0 ranges x 8 samples 
names: isowt.5 isowt.6 ... xrn.1 xrn.2 
detail: use bamPaths(), bamSamples(), bamRanges(), ... 
> # add ranges and tabulate reads
> 
> START=c(861250, 863000)
> END=c(862750, 864000)
> exc = GRanges(IRanges(start=START, end=END), seqnames="Scchr13", strand="+")
> values(exc)$name = c("intv1", "intv2")  # necessary
> bamRanges(bs1) = exc
> bs1
BamViews dim: 2 ranges x 8 samples 
names: isowt.5 isowt.6 ... xrn.1 xrn.2 
detail: use bamPaths(), bamSamples(), bamRanges(), ... 
> tabulateReads(bs1, "+")
         intv1  intv2
start   861250 863000
end     862750 864000
isowt.5   3673   2697
isowt.6   3770   2653
rlp.5     1532   1047
rlp.6     1567   1140
ssr.1     4304   3065
ssr.2     4627   3388
xrn.1     2841   1695
xrn.2     3477   2199
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>