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 |
This is an R package to draw ISOtonic inference for CIRcular data.
Package: | isocir |
Version: | 2.0 |
Depends: | combinat, circular |
License: | GPL (>=3) |
Author(s): Sandra Barragán mainly based on the SAS code written by Miguel A. Fernández. Maintainer: <[email protected]>
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/
CIRE
, sce
, cond.test
, mrl
, datareplic
, cirdata
, cirgenes
.
This function computes the aggregation of circular orders.
ACO(data, method=c("Naive", "CB", "CMC", "TSP", "CH"), control.method, ws=NULL, coef=1)
ACO(data, method=c("Naive", "CB", "CMC", "TSP", "CH"), control.method, ws=NULL, coef=1)
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. |
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.
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): Sandra Barragán. Maintainer: <[email protected]>
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/
eq.test
, sce
, cond.test
, mrl
, isocir
, plot.isocir
.
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")
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")
An example data set. The data have been created randomly for the purpose of running some examples of the functions of the package isocir.
data(cirdata)
data(cirdata)
Every data of the vector come from the unit circle .
Mardia, K. and Jupp, P. (2000). Directional Statistics, Chichester: Wiley.
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")
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")
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.
CIRE (data, groups=NULL, circular = TRUE)
CIRE (data, groups=NULL, circular = TRUE)
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 |
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 .
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:
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 .
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.
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 |
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): Sandra Barragán based on the SAS routines written by Miguel A. Fernández. Maintainer: <[email protected]>
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
sce
, cond.test
, mrl
, isocir
, plot.isocir
.
# 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))
# 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 data set taken from some cell-cycle experiments with the purpose of running some examples of the functions of the package isocir. See details.
data(cirgenes)
data(cirgenes)
The set has a single element:
cirgenes
a matrix with the measures of several cell-cycle experiments.
This data are located in the unit circle .
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.
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).
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.
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
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
This function obtains the circular Kendall's tau between two sets of data.
cirKendall(phi1, phi2, test = FALSE, control.test = c("noteq", "upper", "lower"))
cirKendall(phi1, phi2, test = FALSE, control.test = c("noteq", "upper", "lower"))
phi1 |
a numeric vector of data to be processed. See details. |
phi2 |
a numeric vector of data. |
test |
logical, by default |
control.test |
"noteq", "upper" or "lower". |
This function obtains the circular Kendall's tau between two data set.
It returns the value of the circular Kendall's tau.
If test=TRUE
, it returns also the pvalue of the test.
Author(s): Sandra Barragán. Maintainer: <[email protected]>
Fisher,N.I. (1993).Statistical analysis of circular data. Cambridge University Press.
sce
, cond.test
, mrl
, isocir
, plot.isocir
.
data(cirgenes) cirKendall(cirgenes[1,],cirgenes[2,]) # Even with missing values: cirKendall(cirgenes[1,],cirgenes[8,])
data(cirgenes) cirKendall(cirgenes[1,],cirgenes[2,]) # Even with missing values: cirKendall(cirgenes[1,],cirgenes[8,])
This function computes the Circular Local Minimization.
CLM(data, order0, ws=NULL, control.method=c("msce","cirktau"))
CLM(data, order0, ws=NULL, control.method=c("msce","cirktau"))
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". |
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"
.
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): Sandra Barragán. Maintainer: <[email protected]>
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.
sce
, cond.test
, mrl
, isocir
, plot.isocir
.
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))
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))
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.
cond.test(data, groups=NULL, kappa=NULL, biasCorrect=TRUE)
cond.test(data, groups=NULL, kappa=NULL, biasCorrect=TRUE)
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 |
This function performs the conditional test to constrast the hypotheses:
The circular parameters follow a fixed circular order.
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 is known or not.
If is known,
data
is usually a vector with the unrestricted circular means. In this case the value of has to be introduced in the argument
kappa
. data
could also be a matrix with replications and the user knows the value of , 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 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. 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 ( 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.
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): Sandra Barragán based on the SAS code written by Miguel A. Fernández. Maintainer:<[email protected]>
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
CIRE
,sce
, mrl
, isocir
, plot.isocir
.
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)
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)
An example data set. The data have been created randomly for the purpose of running some examples of the functions of the package isocir.
data(datareplic)
data(datareplic)
Every data of the matrix come from the unit circle .
The data in the matrix datareplic
are random angular measurements. Its columns are the 10 replications and its rows are the 8 populations.
Mardia, K. and Jupp, P. (2000). Directional Statistics, Chichester: Wiley.
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)
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)
This function calculates the test of equality of circular orders in different populations.
eq.test(data, popu, ws=NULL, method=NULL, control.method=NULL, output=NULL, coef=1, N=500)
eq.test(data, popu, ws=NULL, method=NULL, control.method=NULL, output=NULL, coef=1, N=500)
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. |
This function performs the test to constrast equality of circular orders:
The circular parameters follow the same circular order in all populations.
is not true.
The data
must have the elements in the columns and the experiments in the rows.
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): Sandra Barrag?n. Maintainer:<[email protected]>
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/
ACO
, CIRE
,sce
, mrl
, isocir
, plot.isocir
.
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)
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)
This function creates an S3 object of class isocir
. There are also some methods described for the class isocir
.
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, ...)
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, ...)
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 |
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
.
An object of class isocir
.
Sandra Barragán.
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()
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()
This function computes the mean Circular Kendall's tau between a circular order and a data set.
mcirktau(data, posorder, ws=NULL)
mcirktau(data, posorder, ws=NULL)
data |
vector or matrix of data to be processed. See details. |
posorder |
The posicions of the order. |
ws |
the weights. |
This function computes the mean Circular Kendall's tau between a circular order and a data set.
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): Sandra Barragán. Maintainer: <[email protected]>
sce
, cond.test
, cirKendall
, isocir
, plot.isocir
.
data(cirgenes) mcirktau(cirgenes, posorder = c(1:ncol(cirgenes)))
data(cirgenes) mcirktau(cirgenes, posorder = c(1:ncol(cirgenes)))
This function calculates the mean resultant length as defined in Mardia et al. (2000).
mrl(data)
mrl(data)
data |
matrix with the data |
It is supposed that we have n replications for each population.
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.
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 |
Author(s): Sandra Barragán. Maintainer: <[email protected]>
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
data(datareplic) mrl(datareplic)
data(datareplic) mrl(datareplic)
This function computes the MSCE between and order and a set of data.
msce(data, posorder, ws=NULL, ...)
msce(data, posorder, ws=NULL, ...)
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. |
This function computes the MSCE between and order and a set of data.
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): Sandra Barragán. Maintainer: <[email protected]>
sce
, cond.test
, mrl
, isocir
, plot.isocir
.
data(cirgenes) msce(cirgenes, posorder = c(1:ncol(cirgenes)))
data(cirgenes) msce(cirgenes, posorder = c(1:ncol(cirgenes)))
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.
## 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(), ...)
## 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(), ...)
x |
an object of class |
option |
The points that are used in the plot: If |
cex |
point character size. See help on |
stack |
logical; if |
axes |
logical; if |
sep |
constant used to specify the distance between stacked points,
if |
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 |
ticks |
logical; if |
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 |
... |
futher parameters passed to |
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.
A list with information on the plot: zero, rotation and next.points.
Some codes from eqscplot
in MASS is used besides some from plot.circular
in the circular package.
Sandra Barragán based on the code of Claudio Agostinelli and Ulric Lund from the package circular.
data(cirdata) result<-CIRE(cirdata) plot(result) plot(result,option="cirmeans")
data(cirdata) result<-CIRE(cirdata) plot(result) plot(result,option="cirmeans")
This function calculates the distance between two q dimensional points, or between a point and a set of points, in the circular space.
sce(arg1, arg2, meanrl=1)
sce(arg1, arg2, meanrl=1)
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. |
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:
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 =1.
If arg2
is a mean vector coming from several replications, the corresponding mean resultant lengths () have to be introduced in the argument
meanrl
.
When arg2
is a matrix:
If arg2
is a matrix with the replications in its columns, meanrl
is not needed as the mean resultant lengths are calculated internally.
The value of the Sum of Circular Error.
Author(s): Sandra Barragán based on the SAS routine written by Miguel A. Fernández. Maintainer: <[email protected]>
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
data(cirdata) exampledata1 <- cirdata exampledata2 <- (cirdata+(pi/4)) sce(exampledata1,exampledata2)
data(cirdata) exampledata1 <- cirdata exampledata2 <- (cirdata+(pi/4)) sce(exampledata1,exampledata2)