Last data update: 2014.03.03

R: Search for the optimal sample order by using the Extended...
ImpShiftR Documentation

Search for the optimal sample order by using the Extended Nearest Insertion

Description

Search for the optimal sample order by using the Extended Nearest Insertion

Usage

ImpShift(Data, Seq=NULL, NChun=4, RdmStart=FALSE, Ndg=3)

Arguments

Data

gene-by-sample matrix or isoform-by-sample matrix.It should be rescaled to values bwteen [-1,1].

Seq

NULL or a vector indicates the sample order. if specified, the samples will be first reordered by this vector.

NChun

number of starting points for polynomial fitting.

RdmStart

whether the start points are randomly selected.

Ndg

degree of polynomial.

Value

This function performs the extended nearest insertion (ENI). The ENI algorithm searchs for the optimal sample order which minimizes the MSE of sliding polynomial regression (SPR). This function will call PipeShiftCDF() function, which fits SPR to each row of the data. For each gene/isoform, SPR fits NChun polynomial curves with different starting points (samples). The samples with smaller order than the start point will be appended to follow the last sample when fitting. So each fitting consider same number of samples. If RdmStart = TRUE, the start points are randomly selected. Otherwise they are evenly sampled along the sample order. The aggregated MSE of a fit (using a specific start point) is defined as the summation of the MSEs of all genes/isoforms considered here. The MSE of the SPR is defined as the largest aggregated MSE across fits using different start points. The output returns the optimal order which provides the smallest SPR MSE.

Author(s)

Ning Leng

Examples

aa <- sin(seq(0,1,.1))
bb <- sin(seq(0.5,1.5,.1))
cc <- sin(seq(0.9,1.9,.1))
res <- ImpShift(rbind(aa,bb,cc), NChun=2)

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(Oscope)
Loading required package: EBSeq
Loading required package: blockmodeling
Loading required package: gplots

Attaching package: 'gplots'

The following object is masked from 'package:stats':

    lowess

Loading required package: testthat
Loading required package: cluster
Loading required package: BiocParallel
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/Oscope/ImpShift.Rd_%03d_medium.png", width=480, height=480)
> ### Name: ImpShift
> ### Title: Search for the optimal sample order by using the Extended
> ###   Nearest Insertion
> ### Aliases: ImpShift
> 
> ### ** Examples
> 
> aa <- sin(seq(0,1,.1))
> bb <- sin(seq(0.5,1.5,.1))
> cc <- sin(seq(0.9,1.9,.1))
> res <- ImpShift(rbind(aa,bb,cc), NChun=2)
   |                                                                               |                                                                      |   0%   |                                                                               |==========                                                            |  14%   |                                                                               |====================                                                  |  29%   |                                                                               |==============================                                        |  43%   |                                                                               |========================================                              |  57%   |                                                                               |==================================================                    |  71%   |                                                                               |============================================================          |  86%   |                                                                               |======================================================================| 100%
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>