A character path or a vector of paths to the
ribo-seq BAM file(s). If multiple BAM files are provided, they should come
from the same genome alignment.
paramScanBAM
NULL or ScanBamParam object specifying what fields and
which records are imported. Default value is NULL.
genomeName
a character object containing the name of the genome used
for the alignment BAM file. The name should be one of the UCSC ensGene
list: ucscGenomes()[ , "db"]. Ex. "hg19" or "mm10". This parameter is used
to build the TxDb object.
txdb
a TxDb object containing the annotations info to comfront with
the alignment files. Either genomeName or txdb parameters should be
provided.
percBestExpressed
numeric [between 0 and 1]. The percentage of best
expressed CDSs on which to plot the coverage around the TSS. Necessary if
the shiftValue parameter must be estimated. Default value 0.03 (3%).
flankSize
an integer. How many bp left and right of the TSS should the
coverage be performed?
offsetStartEnd
a character object. Either "start" (the default) or "end"
for read start or read end to define the offset.
listShiftValue
a vector of integer. It should have the same length as
the inputBamFile vector. The numeric value for shifting ranges of reads on
genomic features when computing coverage. Set this parameter to 0 if no
shift should be performed. If this parameter is missing, the shiftValue is
computed based on the maximum peak of read start coverage around the TSS. A
plot is produced to illustrate this estimation.
Value
A list of list for each BAM file in the inputBamFile list. For each
BAM file 2 objects are returned: one data.frame with info on the genomic
features and the corresponding coverage column, and one list of per ORF
codon coverage.
Examples
#the txdb object can be given as parameter or not.
#If it is not specified, a txdb object is build from UCSC.
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene::TxDb.Hsapiens.UCSC.hg19.knownGene
#in this example only one BAM file is treated.
#However, multiple BAM files can be analyzed together.
myFile <- system.file("extdata", "ctrl_sample.bam", package="RiboProfiling")
listeInputBam <- c(myFile)
#when running this function it is important that chromosome names
#in UCSC and your BAM correspond: the "chr" particle
covData <- riboSeqFromBAM(listeInputBam, txdb=txdb, listShiftValue=c(-14))
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(RiboProfiling)
Loading required package: Biostrings
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: XVector
Warning messages:
1: replacing previous import 'BiocGenerics::Position' by 'ggplot2::Position' when loading 'RiboProfiling'
2: replacing previous import 'ggplot2::Position' by 'BiocGenerics::Position' when loading 'ggbio'
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/RiboProfiling/riboSeqFromBAM.Rd_%03d_medium.png", width=480, height=480)
> ### Name: riboSeqFromBAM
> ### Title: Starting from a BAM file path: quality plots, shift ribosome
> ### position, coverage on multiple transcript features and on codons.
> ### Aliases: riboSeqFromBAM
>
> ### ** Examples
>
> #the txdb object can be given as parameter or not.
> #If it is not specified, a txdb object is build from UCSC.
> txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene::TxDb.Hsapiens.UCSC.hg19.knownGene
>
> #in this example only one BAM file is treated.
> #However, multiple BAM files can be analyzed together.
> myFile <- system.file("extdata", "ctrl_sample.bam", package="RiboProfiling")
> listeInputBam <- c(myFile)
>
> #when running this function it is important that chromosome names
> #in UCSC and your BAM correspond: the "chr" particle
> covData <- riboSeqFromBAM(listeInputBam, txdb=txdb, listShiftValue=c(-14))
/home/ddbj/local/lib64/R/library/RiboProfiling/extdata/ctrl_sample.bam
Read alignment file
Plot match length distribution.
Plot read start coverage around TSS.
Count read start coverage on the CDS, 5pUTR, and 3pUTR.
Warning messages:
1: In riboSeqFromBAM(listeInputBam, txdb = txdb, listShiftValue = c(-14)) :
paramScanBAM parameter is not a ScanBamParam object. Set to default NULL value!
2: In countShiftReads(exonGRanges[names(cdsPosTransc)], cdsPosTransc, :
Param motifSize should be an integer! Accepted values 3, 6 or 9. Default value is 3.
>
>
>
>
>
> dev.off()
null device
1
>