Last data update: 2014.03.03

R: Calculate deltaTCR.
dtcrR Documentation

Calculate deltaTCR.

Description

Performs deltaTCR (dtcr) normalization given control and treated GRanges generated by comp() function.

Usage

dtcr(control_GR, treated_GR, window_size = 3, nt_offset = 1,
  bring_to_zero = TRUE, add_to)

Arguments

control_GR

GRanges object made by comp() function from the control sample.

treated_GR

GRanges object made by comp() function from the treated sample.

window_size

if smoothing is to be performed, what should be the window size? (use only odd numbers to ensure that windows are centred on a nucleotide of interest) (default: 3)

nt_offset

how many nucleotides before a modification the reverse transcription terminates. E.g. for HRF-Seq nt_offset=1 (default: 1)

bring_to_zero

should in deltaTCR calculations negative deltaTCR's be brought to 0 as was done in HRF-Seq paper (default: T)

add_to

GRanges object made by other normalization function (dtcr(), slograt(), swinsor(), compdata()) to which normalized values should be added.

Value

GRanges object with "dtcr" (deltaTCR) and "dtcr.p" (p.value of comparing control and treated calcualted with pooled two-proportion Z-test) metadata.

Author(s)

Lukasz Jan Kielpinski, Nikos Sidiropoulos

References

Kielpinski, L.J., and Vinther, J. (2014). Massive parallel-sequencing-based hydroxyl radical probing of RNA accessibility. Nucleic Acids Res.

See Also

comp, slograt, swinsor, compdata, GR2norm_df, plotRNA, norm2bedgraph

Examples

dummy_euc_GR_control <- GRanges(seqnames="DummyRNA",
                                IRanges(start=round(runif(100)*100),
                                width=round(runif(100)*100+1)), strand="+",
                                EUC=round(runif(100)*100))
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_control <- comp(dummy_euc_GR_control)
dummy_comp_GR_treated <- comp(dummy_euc_GR_treated)
dtcr(control_GR=dummy_comp_GR_control, treated_GR=dummy_comp_GR_treated)

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/dtcr.Rd_%03d_medium.png", width=480, height=480)
> ### Name: dtcr
> ### Title: Calculate deltaTCR.
> ### Aliases: dtcr
> 
> ### ** Examples
> 
> dummy_euc_GR_control <- GRanges(seqnames="DummyRNA",
+                                 IRanges(start=round(runif(100)*100),
+                                 width=round(runif(100)*100+1)), strand="+",
+                                 EUC=round(runif(100)*100))
> 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_control <- comp(dummy_euc_GR_control)
Fasta file not specified.
0 % of EUCs removed due to cutoff
> dummy_comp_GR_treated <- comp(dummy_euc_GR_treated)
Fasta file not specified.
0 % of EUCs removed due to cutoff
> dtcr(control_GR=dummy_comp_GR_control, treated_GR=dummy_comp_GR_treated)
GRanges object with 182 ranges and 3 metadata columns:
        seqnames     ranges strand |        nt               dtcr
           <Rle>  <IRanges>  <Rle> | <numeric>          <numeric>
    [1] DummyRNA     [1, 1]      + |         0  0.333333333333333
    [2] DummyRNA     [2, 2]      + |         0                  0
    [3] DummyRNA     [3, 3]      + |         0                  0
    [4] DummyRNA     [4, 4]      + |         0 0.0203582410296858
    [5] DummyRNA     [5, 5]      + |         0 0.0338641712022826
    ...      ...        ...    ... .       ...                ...
  [178] DummyRNA [178, 178]      + |         0                  0
  [179] DummyRNA [179, 179]      + |         0                  0
  [180] DummyRNA [180, 180]      + |         0                  0
  [181] DummyRNA [181, 181]      + |         0                  0
  [182] DummyRNA [182, 182]      + |         0                  0
                      dtcr.p
                   <numeric>
    [1]    0.946285489169598
    [2] 1.10131528823137e-50
    [3] 3.86254699316696e-29
    [4] 6.39489643371974e-07
    [5]    0.797650810147084
    ...                  ...
  [178]                 <NA>
  [179]                 <NA>
  [180]                 <NA>
  [181]                 <NA>
  [182]                 <NA>
  -------
  seqinfo: 1 sequence from an unspecified genome; no seqlengths
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>