Learn R Programming

RNAprobR (version 1.4.0)

swinsor: Smooth Winsorization

Description

Performs sliding window Winsorization given treated GRanges generated by comp() function. It winsorizes values in windows (of a size specified by window_size) sliding by 1 nt over whole transcript length and reports mean winsorized value for each nucleotide (as well as standard deviation).

Usage

swinsor(Comp_GR, winsor_level = 0.9, window_size = 71, only_top = FALSE, nt_offset = 1, add_to)

Arguments

Comp_GR
GRanges object made by comp() function.
winsor_level
Winsorization level. Bottom outliers will be set to (1-winsor_level)/2 quantile and top outliers to (1+winsor_level)/2 quantile.
window_size
Size of a sliding window.
only_top
If TRUE then bottom values are not Winsorized and are set to 0.
nt_offset
How many position in the 5' direction should the signal be offset to account for the fact that reverse transcription termination occurs before site of modification.
add_to
GRanges object made by other normalization function (dtcr(), slograt(), swinsor(), compdata()) to which normalized values should be added.

Value

GRanges object with "swinsor" (mean smooth-Winsor values) and "swinsor.sd" (standard deviation of smooth-Winsor values) metadata.

References

"Analysis of sequencing based RNA structure probing data" Kielpinski, Sidiropoulos, Vinther. Chapter in "Methods in Enzymology" (in preparation)

See Also

comp, dtcr, slograt, compdata, GR2norm_df, plotRNA, norm2bedgraph, winsor, swinsor_vector

Examples

Run this code
dummy_euc_GR <- GRanges(seqnames="DummyRNA",
                        IRanges(start=round(runif(100)*100),
                        width=round(runif(100)*100+1)), strand="+",
                        EUC=round(runif(100)*100))
dummy_comp_GR <- comp(dummy_euc_GR)
swinsor(dummy_comp_GR)

Run the code above in your browser using DataLab