Package 'isocir'

Title: Isotonic Inference for Circular Data
Description: A bunch of functions to deal with circular data under order restrictions.
Authors: Sandra Barragan, Miguel A. Fernandez and Cristina Rueda.
Maintainer: Sandra Barragan <[email protected]>
License: GPL (>= 3)
Version: 2.0-7.1
Built: 2024-10-14 05:17:27 UTC
Source: https://github.com/cran/isocir

Help Index


Isotonic Inference with Circular data.

Description

This is an R package to draw ISOtonic inference for CIRcular data.

Details

Package: isocir
Version: 2.0
Depends: combinat, circular
License: GPL (>=3)

Author(s)

Author(s): Sandra Barragán mainly based on the SAS code written by Miguel A. Fernández. Maintainer: <[email protected]>

References

Mardia, K. and Jupp, P. (2000). Directional Statistics, Chichester: Wiley.

Barragan, S., Fernandez, M.A., Rueda, C. and Peddada, S.D. (2015). isocir: An R Package for Constrained Inference Using Isotonic Regression for Circular Data, with an Application to Cell Biology. Journal of Statistical Software, 54, n1: pp 1–17. doi: 10.18637/jss.v054.i04.

Rueda, C., Fernandez, M. A. and Peddada, S. D. (2009). Estimation of parameters subject to order restrictions on a circle with application to estimation of phase angles of cell-cycle genes. Journal of the American Statistical Association, 104, n485; pp 338–347. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2742472/

Fernandez, M. A., Rueda, C. and Peddada, S. D. (2012). Identification of a core set of signature cell cycle genes whose relative order of time to peak expression is conserved across species, Nucl. Acids Res. 40, n7: pp 2823–2832. doi:10.1093/nar/gkr1077. https://academic.oup.com/nar/article/40/7/2823/1183140

Barragan, S., Rueda, C., Fernandez, M.A. and Peddada, S.D. (2015). Determination of Temporal Order among the Components of an Oscillatory System. PLOS ONE. 10, n7: pp 1–14. doi: 10.1371/journal.pone.0124842. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4495067/

See Also

CIRE, sce, cond.test, mrl, datareplic, cirdata, cirgenes.


Aggregation of Circular Orders

Description

This function computes the aggregation of circular orders.

Usage

ACO(data, method=c("Naive", "CB", "CMC", "TSP", "CH"), 
control.method, ws=NULL, coef=1)

Arguments

data

vector or matrix of data to be processed. See details.

method

"Naive", "CB", "CMC", "TSP", "CH".

control.method

"tau", "MSCE", "pos", "cirmean", "cirmed", "1", "2", "3", "4m", "4c", "bin", "pos", "alpha1", "alpha2", "alpha3", "alpha4","alphainf", "time", "arc", "chord", "bin", "pos", "cos", "cmean", "mrl", "e3", "ave", "qua", "nat", "natp", "natb".

ws

the weights.

coef

The coeficient for TSP method.

Details

This function computes the aggregation of circular orders.

The possible methods are: Naive: the naive method of choosing the order from the data. CB: the circular Borda method. TSP: the Traveling Salesperson Problem apply to aggregation of circular orders. CH: the circular Hodge method.

The coef argument is the proportion of maximum presolutions check respect to the number of elements n. It means that when the TSP is solved by heuristics, a maximum of the best coef*n possible solutions are proned to be the final solution, they are checked and the one with the best SCE is chosen.

Value

A list with the elements:

aggre_order

the circular aggregated order.

msce

the MSCE corresponding to the circular aggregated order.

mtau

the circular Kendall tau corresponding to the circular aggregated order.

mintour

the order corresponding to the tour of minimum length in case of TSP.

mt_msce

in case of TSP, the MSCE corresponding to the tour of minimum length.

tour_length

in case of TSP, the length of the tour.

scores

in case of TSP, the length of each edge. In case of circular Hodge, the scores.

out

in case of circular Hodge, the element where the circle is cut.

error1

in case of circular Hodge method, the error1.

error2

in case of circular Hodge method, the error2.

Author(s)

Author(s): Sandra Barragán. Maintainer: <[email protected]>

References

Rueda, C., Fernandez, M. A. and Peddada, S. D. (2009). Estimation of parameters subject to order restrictions on a circle with application to estimation of phase angles of cell-cycle genes. Journal of the American Statistical Association, 104, n485; pp 338–347. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2742472/

Fernandez, M. A., Rueda, C. and Peddada, S. D. (2012). Identification of a core set of signature cell cycle genes whose relative order of time to peak expression is conserved across species, Nucl. Acids Res. 40, n7: pp 2823–2832. doi:10.1093/nar/gkr1077. https://academic.oup.com/nar/article/40/7/2823/1183140

Barragan, S., Rueda, C., Fernandez, M.A. and Peddada, S.D. (2015). Determination of Temporal Order among the Components of an Oscillatory System. PLOS ONE. 10, n7: pp 1–14. doi: 10.1371/journal.pone.0124842. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4495067/

See Also

eq.test, sce, cond.test, mrl, isocir, plot.isocir.

Examples

data(cirgenes)
ACO(cirgenes[,c(1:5)], method="TSP", control.method="alpha3")
#datos<- rbind (c(0, 1/10, 1/9, 1, 11/10, 10/9)*pi,c(0, 1/2, 1/10, 1, 3/2, 11/10)*pi) 
#ACO(datos, method="TSP", control.method="alpha3")

Random Circular Data.

Description

An example data set. The data have been created randomly for the purpose of running some examples of the functions of the package isocir.

Usage

data(cirdata)

Details

Every data of the vector come from the unit circle [0,2π][0,2\pi].

References

Mardia, K. and Jupp, P. (2000). Directional Statistics, Chichester: Wiley.

See Also

cirgenes, datareplic.

Examples

data(cirdata)

# Put groups of the order in the correct form:
orderGroups <- c(1,1,1,2,2,3,4,4)


# execute CIRE to obtain the CIRE with circular order:
example1CIRE <- CIRE(cirdata, groups = orderGroups, circular = TRUE)
example1CIRE 

# if the user wants the graphics: 
#plot(example1CIRE)
#plot(example1CIRE, option="cirmeans")

Circular Isotonic Regresssion Estimator

Description

This function obtains the Circular Isotonic Regression Estimator (CIRE) of a set of data assuming an order among them. See details for a full explanation.

Usage

CIRE (data, groups=NULL, circular = TRUE)

Arguments

data

vector or matrix of data to be processed. See details.

groups

a numeric vector representing the assumed order of data.

circular

logical, by default TRUE is the order wrapped around the circle (circular order). If FALSE the order is not closed.

Details

It uses the algorithm developed in Rueda et al (2009). The final solution is found in a computationally efficient way by searching for the feasible solution with the smallest SCE, see sce. The order can be chosen by the user and is set using the groups argument. The order is defined in groups by a numeric vector with the positions in the order of each element. An example of order would be the simple circular order, defined by the set CscoC_{sco}.

Csco={ϕ=(ϕ1,ϕ2,,ϕq)[0,2π]q:ϕ1ϕ2ϕqϕ1}C_{sco}=\{\phi=(\phi_1,\phi_2,\ldots,\phi_q)\in [0,2\pi]^q:\phi_{1}\leq\phi_{2}\leq\ldots\leq\phi_{q}\leq\phi_{1}\}

This order is wrapped around the circle. However, if the user wants the order not to be wrapped, then circular = FALSE and the order would be the simple order, for instance:

Cso={ϕ=(ϕ1,ϕ2,,ϕq)[0,2π]q:0ϕ1ϕ2ϕq2π}C_{so}=\{\phi=(\phi_1,\phi_2,\ldots,\phi_q)\in [0,2\pi]^q:0\leq\phi_{1}\leq\phi_{2}\leq\ldots\leq\phi_{q}\leq 2\pi\}

For further information see the vignette of this package isocir.

The argument data is a vector with the unrestricted circular means or a matrix whose columns are the replications of the data and the rows are the populations. All the values must belong to the interval [0,2π][0,2\pi].

The argument groups is a numeric vector with length equal to the number of populations, q. Each value of the argument establishes the level of the order the corresponding population is assigned to. The default value is the sequence corresponding to the simple order (1, 2, ..., q), circular if closed=TRUE. Notice that no particular order is assumed among the populations belonging to the same level set.

Value

It returns an S3 object of class isocir that is a list with the next elements:

cirmeans

A list with the unrestricted circular means in the same form as the order introduced by groups.

SCE

Sum of Circular Errors of the final CIRE.

CIRE

A list with the ordered estimations, the result of the algorithm that obtained the CIRE.

The Circular Isotonic Regression Estimator is returned as a list just to see the groups of the order. In case you would like to use it as a vector just run: unlist(object$CIRE).

Author(s)

Author(s): Sandra Barragán based on the SAS routines written by Miguel A. Fernández. Maintainer: <[email protected]>

References

Mardia, K. and Jupp, P. (2000). Directional Statistics, Chichester: Wiley.

Rueda, C., Fernandez, M. A. and Peddada, S. D. (2009). Estimation of parameters subject to order restrictions on a circle with application to estimation of phase angles of cell-cycle genes. Journal of the American Statistical Association, 104, n485; pp 338–347. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2742472/

Fernandez, M. A., Rueda, C. and Peddada, S. D. (2012). Identification of a core set of signature cell cycle genes whose relative order of time to peak expression is conserved across species, Nucl. Acids Res. 40, n7: pp 2823–2832. doi:10.1093/nar/gkr1077. https://academic.oup.com/nar/article/40/7/2823/1183140

See Also

sce, cond.test, mrl, isocir, plot.isocir.

Examples

# We consider the following data from the package that are random circular data:
data(cirdata)
circular_ordered_estimator <- CIRE(cirdata)
# We can take the vector of the CIRE estimators:
circular_ordered_estimator $CIRE
# And the SCE:
circular_ordered_estimator $SCE

# Random data with a more complex order:
CIRE(cirdata, groups=c(1,1,2,3,5,3,4,6))

A set of angular measurements from cell-cycle experiments with genes.

Description

A data set taken from some cell-cycle experiments with the purpose of running some examples of the functions of the package isocir. See details.

Usage

data(cirgenes)

Format

The set has a single element:

cirgenes

a matrix with the measures of several cell-cycle experiments.

Details

This data are located in the unit circle [0,2π][0,2\pi].

That matrix cirgenes has in its rows the peak expression points for the genes, see Source. The columns of the matrix are the experiments. There are 16 genes (rows) and 10 experiments (columns). The experiments are not held under the same conditions so that the data cannot be considered as replications.

Source

Initially, the data come from the experiments of Oliva et al. (2005), Peng et al. (2005) and Rustici et al. (2004). They are the observed points of peak expressions of some genes along the cell cycle of the S. Pombe yeast and have been obtained using the Random Periods Model developed in Liu et al. (2004). The source of that data is http://www.cyclebase.org/CyclebaseSearch, Gauthier (2007).

References

Fernandez, M. A., Rueda, C. and Peddada, S. D. (2012). Identification of a core set of signature cell cycle genes whose relative order of time to peak expression is conserved across species, Nucl. Acids Res. 40, n7: pp 2823–2832. doi:10.1093/nar/gkr1077. https://academic.oup.com/nar/article/40/7/2823/1183140

Gauthier, N. (2007). Cyclebase.org - A Comprehensive Multi-Organism Online Database of Cell-Cycle Experiments. Nucleic Acids Research. 36, pp 854–859. http://www.cyclebase.org/CyclebaseSearch.

Liu, D., Umbach, D., Peddada, S., Li, L., Crockett, P., Weinberg, C. (2004). A Random Periods Model for Expression of Cell-Cycle Genes. The National Academy of Sciences of the USA. 101(19), pp 7240–7245.

Oliva, A., Rosebrock, A., Ferrezuelo, F., Pyne, S., Chen, H., Skiena, S., Futcher, B. and Leatherwood, J. (2005). The Cell Cycle-Regulated Genes of Schizosaccharomyces pombe. Plos biology. 3.

Peng, X., Karuturi, R., Miller, L., Lin, K., Jia, Y., Kondu, P., Wang, L., Wong, L., Liu, E., Balasubramanian, M. and Liu, J. (2005). Identification of Cell Cycle-Regulated Genes in Fission Yeast. The American Society for Cell Biology. 16, pp 1026–1042.

Rustici, G., Mata, J., Kivinen, K., Lio, P., Penkett, C., Burns, G., Hayles, J., Brazma, A., Nurse, P., and Bahler, J. (2004). Periodic Gene Expression program of the fission yeast cell cycle. Nature Genetics. 36.

See Also

datareplic, cirdata.

Examples

data(cirgenes)

# These values of kappa estimations were obtained by using the calculations
# explained in Fern?ndez et al (2012).

kappas <- c(2.64773, 3.24742, 2.15936, 4.15314, 4.54357,
               29.07610, 6.51408, 14.19445, 5.66920, 11.12889)

allresults <- list()
resultIsoCIRE <- matrix(ncol = ncol(cirgenes), nrow = nrow(cirgenes))

SCEs <- vector(mode = "numeric", length = nrow(cirgenes))
pvalues <- vector(mode = "numeric", length = nrow(cirgenes))

for (i in 1 : nrow(cirgenes)) {
    k <- kappas[i]
    genes <- as.numeric(cirgenes[i, ])
    allresults[[i]] <- cond.test(genes, groups=c(1:length(genes)), kappa = k)
    resultIsoCIRE[i, !is.na(cirgenes[i, ])] <- round(unlist(allresults[[i]]$CIRE), digits = 3)
    SCEs[i] <- allresults[[i]]$SCE
    pvalues[i] <- allresults[[i]]$pvalue
 }

# resultIsoCIRE is a matrix with the CIRE for each experiment
# pvalues is a vector with the result of the test

Circular Kendall's Tau

Description

This function obtains the circular Kendall's tau between two sets of data.

Usage

cirKendall(phi1, phi2, test = FALSE, control.test = c("noteq", "upper", "lower"))

Arguments

phi1

a numeric vector of data to be processed. See details.

phi2

a numeric vector of data.

test

logical, by default FALSE.

control.test

"noteq", "upper" or "lower".

Details

This function obtains the circular Kendall's tau between two data set.

Value

It returns the value of the circular Kendall's tau. If test=TRUE, it returns also the pvalue of the test.

Author(s)

Author(s): Sandra Barragán. Maintainer: <[email protected]>

References

Fisher,N.I. (1993).Statistical analysis of circular data. Cambridge University Press.

See Also

sce, cond.test, mrl, isocir, plot.isocir.

Examples

data(cirgenes)
cirKendall(cirgenes[1,],cirgenes[2,])
# Even with missing values:
cirKendall(cirgenes[1,],cirgenes[8,])

Circular Local Minimization

Description

This function computes the Circular Local Minimization.

Usage

CLM(data, order0, ws=NULL, control.method=c("msce","cirktau"))

Arguments

data

matrix of circular data to be processed.

order0

the initial order to be improved.

ws

the weights.

control.method

by default "msce", maximization of "cirktau".

Details

This function computes the Circular Local Minimization of the MSCE by default. It computes the Circular Local Maximization of the Circular Kendall Tau if control.method="cirktau".

Value

This function returns a list with the next elements:

order0

the initial order introduced in the arguments.

msce0

the mean sum of circular errors of the initial order with the data.

or itemtau0the mean circular Kendall Tau of the initial order with the data.

final_order

the final order after proccess the Circular Local Minimization.

bestsce

the msce of the final order with the data.

or

bestau

the mean circular Kendall Tau of the final order with the data.

Author(s)

Author(s): Sandra Barragán. Maintainer: <[email protected]>

References

DWORK, C., KUMAR, R., NAOR, M. and SIVAKUMAR, D. (2001), Rank Aggregation Methods for the Web, Proceedings of the 10th International World Wide Web Conference, pp. 613–622.

See Also

sce, cond.test, mrl, isocir, plot.isocir.

Examples

data(cirgenes)
aggre_order <- ACO(cirgenes[,c(1:5)], method="TSP", control.method="time")$TSP_order[1,]
CLM(cirgenes[,c(1:5)], order0 = c(1:5))
#datos<- rbind (c(0, 1/10, 1/9, 1, 11/10, 10/9)*pi,c(0, 1/2, 1/10, 1, 3/2, 11/10)*pi) 
#CLM(datos, order0 = c(1:6))

Conditional Test for Contrasting Circular Order

Description

This function calculates the p-value corresponding to the conditional test where the hypotheses are whether the data follow a fixed circular order or not.

Usage

cond.test(data, groups=NULL, kappa=NULL, biasCorrect=TRUE)

Arguments

data

vector or matrix with the data. See details.

groups

a numeric vector with the circular order to be contrasted.

kappa

numeric and positive, if NULL, it will be estimated.

biasCorrect

logical, if TRUE, the correction of the bias is done in the estimation of kappa.

Details

This function performs the conditional test to constrast the hypotheses:

H0:\hspace{1.7cm}H_{0}: The circular parameters follow a fixed circular order.

H1:H0\hspace{1.7cm}H_{1}:\hspace{0.1cm}H_{0} is not true.

This conditional test is a modification of the likelihood ratio test. See Fern?ndez et al. (2011) for full details about the conditional test. For a whole explanation of the use of this function, see the vignette of this package where some examples are shown.

The circular order to be tested is defined in the argument groups by a numeric vector with the positions in the order of each element. The result of cond.test is the p-value of this test. There are two cases depending on whether κ\kappa is known or not.

If κ\kappa is known, data is usually a vector with the unrestricted circular means. In this case the value of κ\kappa has to be introduced in the argument kappa. data could also be a matrix with replications and the user knows the value of κ\kappa, then if it is introduced in the argument kappa it will be used by the function to perform the contrast instead of using the estimation.

When κ\kappa is unknown, replications are needed in order to calculate the estimation. Then, data must be a matrix where each column is a replication while each row is a population. κ\kappa is estimated internally using the function mle.vonmises developed in the package circular. By default, the correction of the bias is done, if the user prefers not correcting the bias, just set the argument biasCorrect=FALSE.

For both cases (κ\kappa known or unknown), the order to be contrasted is introduced in groups in the form of a numeric vector with length equal to the number of populations. Each value of the argument establishes the level of the order the corresponding population is assigned to. The default value is the sequence corresponding to the simple order (1, 2, ..., q). Notice that no particular order is assumed among the populations belonging to the same level set.

Value

The output is an S3 object of class isocir, similar to the result in the function CIRE but adding the following values:

pvalue

numeric, it is the p-value what results of the conditional test.

kappa

numeric, it is the value of kappa.

The attribute estkappa shows if kappa is estimated or known.

Author(s)

Author(s): Sandra Barragán based on the SAS code written by Miguel A. Fernández. Maintainer:<[email protected]>

References

Mardia, K. and Jupp, P. (2000). Directional Statistics, Chichester: Wiley.

Rueda, C., Fernandez, M. A. and Peddada, S. D. (2009). Estimation of parameters subject to order restrictions on a circle with application to estimation of phase angles of cell-cycle genes. Journal of the American Statistical Association, 104, n485; pp 338–347. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2742472/

Fernandez, M. A., Rueda, C. and Peddada, S. D. (2012). Identification of a core set of signature cell cycle genes whose relative order of time to peak expression is conserved across species, Nucl. Acids Res. 40, n7: pp 2823–2832. doi:10.1093/nar/gkr1077. https://academic.oup.com/nar/article/40/7/2823/1183140

See Also

CIRE,sce, mrl, isocir, plot.isocir.

Examples

data(cirdata)
# Example without replications and a partial circular order:
orderGroups <- c(1,1,1,2,2,3,4,4)
cond.test(cirdata, groups = orderGroups, kappa = 0.2)
# Example with replications and the next circular order:
orderGroups2 <- c(1:8)
data(datareplic)
cond.test(data = datareplic, groups = orderGroups2)

Random Circular Data with Replications.

Description

An example data set. The data have been created randomly for the purpose of running some examples of the functions of the package isocir.

Usage

data(datareplic)

Details

Every data of the matrix come from the unit circle [0,2π][0,2\pi].

The data in the matrix datareplic are random angular measurements. Its columns are the 10 replications and its rows are the 8 populations.

References

Mardia, K. and Jupp, P. (2000). Directional Statistics, Chichester: Wiley.

See Also

cirgenes, cirdata.

Examples

data(datareplic)

# example testing the next order:
orderGroups2 <- c(1:8)

example2test <- cond.test(datareplic, groups = orderGroups2, bias = TRUE)
example2test


round(unlist(example2test$cirmeans), digits = 3)

Test of Equality of Circular Orders

Description

This function calculates the test of equality of circular orders in different populations.

Usage

eq.test(data, popu, ws=NULL, method=NULL, control.method=NULL, output=NULL, coef=1, N=500)

Arguments

data

matrix or data.frame with the data. See details.

popu

a numeric vector with population to each experiment belongs.

ws

a numeric vector with the values to be used as weight per experiment.

method

The method to be used to aggregate circular orders with ACO function.

control.method

The argument to control the method in ACO function.

output

The path where write the output of the global orders.

coef

The coefficient to use in case of method=TSP, by default 1.

N

The number of randomization selections, by default 500.

Details

This function performs the test to constrast equality of circular orders:

H0:\hspace{1.7cm}H_{0}: The circular parameters follow the same circular order in all populations.

H1:H0\hspace{1.7cm}H_{1}:\hspace{0.1cm}H_{0} is not true.

The data must have the elements in the columns and the experiments in the rows.

Value

The output is a list with the following values:

allorders

matrix, in each row the circular order obtained with all selected experiments and the value for the statistic test in that selection.

pvalue

numeric, it is the p-value what results of the test.

global_order

numeric vector with the elements ordered as the global circular order estimate.

CC

numeric, the confidence coefficient (in percentage) of the global order.

MFO

numeric vector with the elements ordered as the Most Frequent global Order in the randomization procedure.

CCMFO

numeric, the confidence coefficient (in percentage) of the Most Frequent global Order.

Two additional outputs could be obtained in the form of .csv files written in the path given by the user in the argument output:

globalorders.csv

all the global orders obtained from the randomization procedure and the value of the statistic in each selection.

frequencydist.csv

the frequency distribution of all the global orders.

Author(s)

Author(s): Sandra Barrag?n. Maintainer:<[email protected]>

References

Rueda, C., Fernandez, M. A. and Peddada, S. D. (2009). Estimation of parameters subject to order restrictions on a circle with application to estimation of phase angles of cell-cycle genes. Journal of the American Statistical Association, 104, n485; pp 338–347. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2742472/

Fernandez, M. A., Rueda, C. and Peddada, S. D. (2012). Identification of a core set of signature cell cycle genes whose relative order of time to peak expression is conserved across species, Nucl. Acids Res. 40, n7: pp 2823–2832. doi:10.1093/nar/gkr1077. https://academic.oup.com/nar/article/40/7/2823/1183140

Barragan, S., Rueda, C., Fernandez, M.A. and Peddada, S.D. (2015). Determination of Temporal Order among the Components of an Oscillatory System. PLOS ONE. 10, n7: pp 1–14. doi: 10.1371/journal.pone.0124842. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4495067/

See Also

ACO, CIRE,sce, mrl, isocir, plot.isocir.

Examples

data(cirgenes)
eq.test(cirgenes[-8,c(1:5)], popu=c(rep(1,5),rep(2,4)),
ws=c(1,2,3.5,2,1,8,4.2,1.35,6), method="TSP",control.method="alpha3",N=2)

S3 Objects of Class isocir.

Description

This function creates an S3 object of class isocir. There are also some methods described for the class isocir.

Usage

isocir(cirmeans = NULL, SCE =NULL, CIRE = NULL, pvalue = NULL, kappa = NULL)
is.isocir(x)
## S3 method for class 'isocir'
print(x, decCIRE = 3, decpvalue = 4, deckappa = 2, ...)

Arguments

cirmeans

NULL by default, the unrestricted circular means

SCE

NULL by default, the Sum of Circular Errors.

CIRE

NULL by default, the Circular Isotonic Regression Estimator.

pvalue

NULL by default, the result of the conditional test

kappa

NULL by default.

x

an object of class CIRE.

decCIRE

the number of decimal places to round the CIRE and the SCE.

decpvalue

the number of decimal places to round the pvalue.

deckappa

the number of decimal places to round kappa.

...

futher parameters passed to print.default.

Details

With the function isocir a list of class isocir is created with the elements: cirmeans, SCE, CIRE even if they are NULL. However, pvalue and kappa are added just in the case that they have any value.

The argument x must be of class isocir.

Value

An object of class isocir.

Author(s)

Sandra Barragán.

See Also

CIRE, cond.test.

Examples

data(cirdata)
x <- CIRE(cirdata)
print(x)
is.isocir(x)
class(x)

plot(x)
class(x)

# If you want to use the CIRE in other calculations you can obtain it as a vector:
unlist(x$CIRE)
# But be careful because this unclass and lost attributes! 

# To create a new object of class CIRE:
y <- isocir()

Mean Circular Kendall's Tau.

Description

This function computes the mean Circular Kendall's tau between a circular order and a data set.

Usage

mcirktau(data, posorder, ws=NULL)

Arguments

data

vector or matrix of data to be processed. See details.

posorder

The posicions of the order.

ws

the weights.

Details

This function computes the mean Circular Kendall's tau between a circular order and a data set.

Value

A list with the elements:

mtau

mean circular Kendall's tau.

ntaus

a vector with the circular Kendall's tau of all the experiment.

Author(s)

Author(s): Sandra Barragán. Maintainer: <[email protected]>

See Also

sce, cond.test, cirKendall, isocir, plot.isocir.

Examples

data(cirgenes)
mcirktau(cirgenes, posorder = c(1:ncol(cirgenes)))

Mean Resultant Length

Description

This function calculates the mean resultant length as defined in Mardia et al. (2000).

Usage

mrl(data)

Arguments

data

matrix with the data

Details

It is supposed that we have n replications for each population.

R=1nS2+C2\overline{R}=\frac{1}{n}\sqrt{S^{2}+C^{2}}

whereS=k=1nsinθkandC=k=1ncosθkwhere\hspace{0.5cm} S=\sum_{k=1}^{n}\sin{\theta_k}\hspace{0.5cm} and \hspace{0.5cm} C=\sum_{k=1}^{n}\cos{\theta_k}

The argument data could be a matrix with n columns and q rows, q is the number of populations. data could also be a vector. For both cases the function rho.circular from the package circular is used in the calculations.

Missing values in the replications are allowed.

Value

mrl

numeric vector of dimension q with the mean resultant lengths. The i element is the mean resultant lenght of the i population which is in the row i of the matrix data.

Author(s)

Author(s): Sandra Barragán. Maintainer: <[email protected]>

References

Mardia, K. and Jupp, P. (2000). Directional Statistics, Chichester: Wiley.

Rueda, C., Fernandez, M. A. and Peddada, S. D. (2009). Estimation of parameters subject to order restrictions on a circle with application to estimation of phase angles of cell-cycle genes. Journal of the American Statistical Association, 104, n485; pp 338–347. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2742472/

Fernandez, M. A., Rueda, C. and Peddada, S. D. (2012). Identification of a core set of signature cell cycle genes whose relative order of time to peak expression is conserved across species, Nucl. Acids Res. 40, n7: pp 2823–2832. doi:10.1093/nar/gkr1077. https://academic.oup.com/nar/article/40/7/2823/1183140

See Also

CIRE, sce, cond.test.

Examples

data(datareplic)
mrl(datareplic)

Mean Sum of Circular Errors.

Description

This function computes the MSCE between and order and a set of data.

Usage

msce(data, posorder, ws=NULL, ...)

Arguments

data

vector or matrix of data to be processed. See details.

posorder

The posicions of the order.

...

arguments to pass to CIRE.

ws

the weights.

Details

This function computes the MSCE between and order and a set of data.

Value

A list with the elements:

msce

The mean of the mean sum of circular errors.

msces

a vector with the mean sum of circular errors for each experiment.

Author(s)

Author(s): Sandra Barragán. Maintainer: <[email protected]>

See Also

sce, cond.test, mrl, isocir, plot.isocir.

Examples

data(cirgenes)
msce(cirgenes, posorder = c(1:ncol(cirgenes)))

S3 Method to Plot S3 Objects of Class isocir

Description

This is a function to plot an object of class isocir that is the result of the function CIRE and cond.test. It creates a plot of circular data points on the current graphics device. Data points are either plotted as points on the unit circle, or the range of the circle is divided into a specified number of bins, and points are stacked in the bins corresponding to the number of observations in each bin.

Usage

## S3 method for class 'isocir'
plot(x, option=c("CIRE", "cirmeans"), cex = 1, stack = TRUE,
  axes = TRUE, sep = 0.025, shrink = 1, bins = 300, ticks = FALSE,
  tcl = 0.025, tcl.text = 0.125, col = NULL, tol = 0.04, uin = NULL,
  xlim = c(-1, 1), ylim = c(-1, 1), digits = 2, units = NULL,
  template = NULL, zero = NULL, rotation = NULL, 
  main = NULL, sub=NULL, xlab = "", ylab = "", 
  control.circle=circle.control(), ...)

Arguments

x

an object of class isocir.

option

The points that are used in the plot: If CIRE, the Circular Isotonic Regression Estimator. If cirmeans, the unrestricted circular means. Default is CIRE.

cex

point character size. See help on par.

stack

logical; if TRUE, points are stacked on the perimeter of the circle. Otherwise, all points are plotted on the perimeter of the circle. Default is TRUE.

axes

logical; if TRUE axes are plotted according to properties of x.

sep

constant used to specify the distance between stacked points, if stack==TRUE or in the case of more than one dataset. Default is 0.025; smaller values will create smaller spaces.

shrink

parameter that controls the size of the plotted circle. Default is 1. Larger values shrink the circle, while smaller values enlarge the circle.

bins

if stack==TRUE, bins is the number of arcs to partition the circle with. Default is 300.

ticks

logical; if TRUE ticks are plotted according to the value of bins.

tcl

length of the ticks.

tcl.text

The position of the axis labels.

col

color of the points. The values are recycled if needed.

tol

proportion of white space at the margins of plot.

uin

desired values for the units per inch parameter. If of length 1, the desired units per inch on the x axis.

xlim, ylim

the ranges to be encompassed by the x and y axes. Useful for centering the plot.

digits

number of digits used to print axis values.

main, sub, xlab, ylab

title, subtitle, x label and y label of the plot.

units

the units used in the plot.

template

the template used in the plot.

zero

the zero used in the plot.

rotation

the rotation used in the plot.

control.circle

parameters passed to plot.default in order to draw the circle. The function circle.control is used to set the parameters.

...

futher parameters passed to points.default.

Details

When there are many closely distributed observations, stacking is recommended. When stacking the points, if there are many points in a particular bin, it may be necessary to shrink the plot of the circle so that all points fit. This is controlled with the parameter shrink. Generally the parameter sep does not need adjustment, however, when shrinking the plot, or for a very large number of observations, it may be helpful.

Value

A list with information on the plot: zero, rotation and next.points.

Note

Some codes from eqscplot in MASS is used besides some from plot.circular in the circular package.

Author(s)

Sandra Barragán based on the code of Claudio Agostinelli and Ulric Lund from the package circular.

See Also

cond.test, CIRE, isocir.

Examples

data(cirdata)
result<-CIRE(cirdata)
plot(result)
plot(result,option="cirmeans")

Sum of Circular Error

Description

This function calculates the distance between two q dimensional points, or between a point and a set of points, in the circular space.

Usage

sce(arg1, arg2, meanrl=1)

Arguments

arg1

vector with the values for the first point.

arg2

vector (or matrix) with the values for the second point (set of points).

meanrl

vector with the mean resultant lenght, by default 1.

Details

This function is useful to measure the circular error when an estimator is used to estimate an unknown q-dimensional parameter. It plays a role in the circular space similar to that of the mean squared error in the usual Euclidean space.

When arg2 is a vector:

SCE(arg1,arg2)=i=1qri[1cos(arg1iarg2i)]SCE(arg1,arg2)=\sum_{i=1}^{q} r_{i} [1-\cos (arg1_{i}-arg2_{i})]

If arg1 and arg2 are just to q dimensional points, both arguments must be vectors with the same length and meanrl is not needed because rir_i=1.

If arg2 is a mean vector coming from several replications, the corresponding mean resultant lengths (rir_i) have to be introduced in the argument meanrl.

When arg2 is a matrix:

SCE(arg1,arg2)=i=1qk=1n[1cos(arg1iarg2ik)]SCE(arg1,arg2)=\sum_{i=1}^{q}\sum_{k=1}^{n} [1-\cos (arg1_{i}-arg2_{ik})]

If arg2 is a matrix with the replications in its columns, meanrl is not needed as the mean resultant lengths are calculated internally.

Value

The value of the Sum of Circular Error.

Author(s)

Author(s): Sandra Barragán based on the SAS routine written by Miguel A. Fernández. Maintainer: <[email protected]>

References

Mardia, K. and Jupp, P. (2000). Directional Statistics, Chichester: Wiley.

Rueda, C., Fernandez, M. A. and Peddada, S. D. (2009). Estimation of parameters subject to order restrictions on a circle with application to estimation of phase angles of cell-cycle genes. Journal of the American Statistical Association, 104, n485; pp 338–347. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2742472/

Fernandez, M. A., Rueda, C. and Peddada, S. D. (2012). Identification of a core set of signature cell cycle genes whose relative order of time to peak expression is conserved across species, Nucl. Acids Res. 40, n7: pp 2823–2832. doi:10.1093/nar/gkr1077. https://academic.oup.com/nar/article/40/7/2823/1183140

See Also

CIRE, cond.test, mrl.

Examples

data(cirdata)
exampledata1 <- cirdata
exampledata2 <- (cirdata+(pi/4))
sce(exampledata1,exampledata2)