Opt2Shift: Run the 2-opt algorithm to improve the optimal order...

Description Usage Arguments Value Author(s) Examples

View source: R/Opt2Shift.R

Description

Run the 2-opt algorithm to improve the optimal order searching of the Extended Nearest Insertion

Usage

1
Opt2Shift(Data,N=20000,Seq,Ndg=3,NChun=4, NCThre=1000, RdmStart=FALSE)

Arguments

Data

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

N,NCThre

The 2-opt algorithm will stop if N iterations has been performed or if the optimal order remains unchanged for over NCThre iterations.

Seq

a vector indicates the sample order obtained from the ENI.

Ndg

degree of polynomial.

NChun

number of starting points for polynomial fitting.

RdmStart

whether the start points are randomly selected.

Value

This function performs the the 2-opt algorithm to improve the optimal order searching of the Extended Nearest Insertion (ENI). In each iteration, the function will randomly choose two points (samples), the flip the samples between these two points. The new order will be adapted if it provides smaller SPR MSE. The output returns the optimal order and its SPR MSE.

Author(s)

Ning Leng

Examples

1
2
3
4
5
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)
res2 <- Opt2Shift(rbind(aa,bb,cc), NChun=2, N=50, Seq=res)

Oscope documentation built on Nov. 17, 2017, 10:37 a.m.