Last data update: 2014.03.03
R: Create or extend norm_GR GRanges using Comp_GR GRanges
Create or extend norm_GR GRanges using Comp_GR GRanges
Description
Add metadata present in GRanges made by comp() function
(termination count (TC), termination-coverage ratio (TCR), coverage (Cover)
and priming count (PC)) to GRanges made by normalizing functions (dtcr(),
slograt(), swinsor(), compdata()).
Usage
compdata(Comp_GR, nt_offset = 1, add_to)
Arguments
Comp_GR
GRanges object made by comp() function.
nt_offset
how many nucleotides before modification the reverse
transcription terminates (default: 1)
add_to
normalized data frame with already performed normalization of
another kind. Results will be merged
Value
norm_GR
norm_GR GRanges extended by metadata from Comp_GR
Author(s)
Lukasz Jan Kielpinski, Nikos Sidiropoulos
See Also
comp
, dtcr
, slograt
,
swinsor
, GR2norm_df
, plotRNA
,
norm2bedgraph
Examples
dummy_euc_GR_treated <- GRanges(seqnames="DummyRNA",
IRanges(start=round(runif(100)*100),
width=round(runif(100)*100+1)), strand="+",
EUC=round(runif(100)*100))
dummy_comp_GR_treated <- comp(dummy_euc_GR_treated)
dummy_swinsor <- swinsor(dummy_comp_GR_treated)
dummy_swinsor <- compdata(Comp_GR=dummy_comp_GR_treated,
add_to=dummy_swinsor)
dummy_swinsor
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(RNAprobR)
Loading required package: GenomicFeatures
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: GenomicRanges
Loading required package: AnnotationDbi
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")'.
Loading required package: plyr
Attaching package: 'plyr'
The following object is masked from 'package:IRanges':
desc
The following object is masked from 'package:S4Vectors':
rename
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/RNAprobR/compdata.Rd_%03d_medium.png", width=480, height=480)
> ### Name: compdata
> ### Title: Create or extend norm_GR GRanges using Comp_GR GRanges
> ### Aliases: compdata
>
> ### ** Examples
>
> dummy_euc_GR_treated <- GRanges(seqnames="DummyRNA",
+ IRanges(start=round(runif(100)*100),
+ width=round(runif(100)*100+1)), strand="+",
+ EUC=round(runif(100)*100))
> dummy_comp_GR_treated <- comp(dummy_euc_GR_treated)
Fasta file not specified.
0 % of EUCs removed due to cutoff
> dummy_swinsor <- swinsor(dummy_comp_GR_treated)
> dummy_swinsor <- compdata(Comp_GR=dummy_comp_GR_treated,
+ add_to=dummy_swinsor)
> dummy_swinsor
GRanges object with 195 ranges and 7 metadata columns:
seqnames ranges strand | nt swinsor swinsor.sd TC
<Rle> <IRanges> <Rle> | <numeric> <numeric> <numeric> <numeric>
[1] DummyRNA [1, 1] + | 0 0 0 0
[2] DummyRNA [2, 2] + | 0 0.29375 0 47
[3] DummyRNA [3, 3] + | 0 0 0 0
[4] DummyRNA [4, 4] + | 0 0.2625 0 42
[5] DummyRNA [5, 5] + | 0 0.14375 0 23
... ... ... ... . ... ... ... ...
[191] DummyRNA [191, 191] + | 0 <NA> <NA> 0
[192] DummyRNA [192, 192] + | 0 <NA> <NA> 0
[193] DummyRNA [193, 193] + | 0 <NA> <NA> 0
[194] DummyRNA [194, 194] + | 0 <NA> <NA> 0
[195] DummyRNA [195, 195] + | 0 <NA> <NA> 0
TCR Cover PC
<numeric> <numeric> <numeric>
[1] 0 174 0
[2] 0.212669683257919 221 0
[3] 0 221 0
[4] 0.159695817490494 263 0
[5] 0.0804195804195804 286 0
... ... ... ...
[191] 0 99 0
[192] 0 99 0
[193] 0 99 88
[194] 0 11 0
[195] 0 11 11
-------
seqinfo: 1 sequence from an unspecified genome; no seqlengths
>
>
>
>
>
> dev.off()
null device
1
>