supraHex: An R/Bioconductor package for tabular omics data analysis using a supra-hexagonal map

Highlights • supraHex is an open-source R/Bioconductor package for tabular omics data analysis.• A supra-hexagonal map is designed to self-organise omics data.• The supraHex map analyses both genes and samples at the same time.• The supraHex map can be overlaid by additional data for multilayer omics data comparisons.• supraHex can tell inherent relations between replication timing, CpG and expression.


Value
Fang a gene expression matrix of 5441 genes x 18 samples, involving six successive stages, each with three replicates. Fang.sampleinfo a matrix containing the information of the 18 samples for the expression matrix Fang. The three columns correspond to the sample Name, Stage, and Replicate, respectively.
Fang.geneinfo a matrix containing the information of the 5441 genes for the expression matrix Fang. The four columns correspond to the gene AffyID, EntrezGene, and Symbol, respectively.

Golub
Leukemia gene expression dataset from Golub et al. (1999) Description Leukemia dataset (learning set) contains gene expression levels (3051 genes and 38 patient samples) from Golub et al. (1999). This dataset has been pre-processed: capping into floor of 100 and ceiling of 16000; filtering by exclusion of genes with max/min <= 5 or max − min <= 500, where max and min refer respectively to the maximum and minimum intensities for a particular gene across mRNA samples; 2-base logarithmic transformation.

Value
Golub a gene expression matrix of 3051 genes x 38 samples. These samples include 11 acute myeloid leukemia (AML) and 27 acute lymphoblastic leukemia (ALL) which can be further subtyped into 19 B-cell ALL and 8 T-cell ALL.
References Golub et al. (1999). Molecular classification of cancer: class discovery and class prediction by gene expression monitoring, Science, Vol. 286:531-537. http://www-genome.wi.mit.edu/MPR/ sBMH Function to identify the best-matching hexagons/rectangles for the input data Description sBMH is supposed to identify the best-matching hexagons/rectangles (BMH) for the input data.
Usage sBMH(sMap, data, which_bmh = c("best", "worst", "all")) sBMH Arguments sMap an object of class "sMap" or a codebook matrix data a data frame or matrix of input data which_bmh which BMH is requested. It can be a vector consisting of any integer values from [1,nHex]. Alternatively, it can also be one of "best", "worst" and "all" choices.
Here, "best" is equivalent to 1, "worst" for nHex, and "all" for seq(1, nHex) Value a list with following components: bmh the requested BMH matrix of dlen x length(which_bmh), where dlen is the total number of rows of the input data qerr the corresponding matrix of quantization errors (i.e., the distance between the input data and their BMH), with the same dimensions as "bmh" above mqe the mean quantization error for the "best" BMH call the call that produced this result Note "which_bmh" upon request can be a vector consisting of any integer values from [1,nHex] See Also sPipeline Examples # 1) generate an iid normal random matrix of 1 x1 data <-matrix( rnorm(1 *1 ,mean= ,sd=1), nrow=1 , ncol=1 ) # 2) from this input matrix, determine nHex=5*sqrt(nrow(data))=5 , # but it returns nHex=61, via "sHexGrid(nHex=5 )", to make sure a supra-hexagonal grid sTopol <-sTopology(data=data, lattice="hexa", shape="suprahex") sCompReorder Function to reorder component planes Description sCompReorder is supposed to reorder component planes for the input map/data. It returns an object of class "sReorder". It is realized by using a new map grid (with sheet shape consisting of a rectangular lattice) to train component plane vectors (either column-wise vectors of codebook/data matrix or the covariance matrix thereof). As a result, similar component planes are placed closer to each other. It is highly recommend to use trained map (i.e. codebook matrix) as input if data matrix is hugely big to save computational costs.
Usage sCompReorder(sMap, xdim = NULL, ydim = NULL, amplifier = NULL, metric = c("none", "pearson", "spearman", "kendall", "euclidean", "manhattan", "cos", "mi"), init = c("linear", "uniform", "sample"), algorithm = c("sequential", "batch"), alphaType = c("invert", "linear", "power"), neighKernel = c("gaussian", "bubble", "cutgaussian", "ep", "gamma")) Arguments sMap an object of class "sMap" or input data frame/matrix xdim an integer specifying x-dimension of the grid ydim an integer specifying y-dimension of the grid amplifier an integer specifying the amplifier (3 by default) of the number of component planes. The product of the component number and the amplifier constitutes the number of rectangles in the sheet grid metric distance metric used to difine the similarity between component planes. It can be "none", which means directly using column-wise vectors of codebook/data matrix. Otherwise, first calculate the covariance matrix from the codebook/data matrix. The distance metric used for calculating the covariance matrix between component planes can be: "pearson" for pearson correlation, "spearman" for spearman rank correlation, "kendall" for kendall tau rank correlation, "euclidean" for euclidean distance, "manhattan" for cityblock distance, "cos" for cosine similarity, "mi" for mutual information. See sDistance for details init an initialisation method. It can be one of "uniform", "sample" and "linear" initialisation methods algorithm the training algorithm. Currently, only "sequential" algorithm has been implemented alphaType the alpha type. It can be one of "invert", "linear" and "power" alpha types neighKernel the training neighbor kernel. It can be one of "gaussian", "bubble", "cutgaussian", "ep" and "gamma" kernels Value an object of class "sReorder", a list with following components: nHex the total number of rectanges in the grid xdim x-dimension of the grid ydim y-dimension of the grid uOrder the unique order/placement for each component plane that is reordered to the "sheet"-shape grid with rectangular lattice coord a matrix of nHex x 2, with each row corresponding to the coordinates of each "uOrder" rectangle in the 2D map grid call the call that produced this result

Note
To ensure the unique placement, each component plane mapped to the "sheet"-shape grid with rectangular lattice is determinied iteratively in an order from the best matched to the next compromised one. If multiple compoments are hit in the same rectangular lattice, the worse one is always sacrificed by moving to the next best one till all components are placed somewhere exclusively on their own.

Note
The distance metrics are supported: • "pearson": Pearson correlation. Note that two curves that have identical shape, but different magnitude will still have a correlation of 1 • "spearman": Spearman rank correlation. As a nonparametric version of the pearson correlation, it calculates the correlation between the ranks of the data values in the two vectors (more robust against outliers) • "kendall": Kendall tau rank correlation. Compared to spearman rank correlation, it goes a step further by using only the relative ordering to calculate the correlation. For all pairs of data points (x i , y i ) and (x j , y j ), it calls a pair of points either as concordant (N c in total) if as a measure of association which is highly resistant to tied data • "euclidean": Euclidean distance. Unlike the correlation-based distance measures, it takes the magnitude into account (input data should be suitably normalized • "manhattan": Cityblock distance. The distance between two vectors is the sum of absolute value of their differences along any coordinate dimension • "cos": Cosine similarity. As an uncentered version of pearson correlation, it is a measure of similarity between two vectors of an inner product space, i.e., measuring the cosine of the angle between them (using a dot product and magnitude) • "mi": Mutual information (MI). M I provides a general measure of dependencies between variables, in particular, positive, negative and nonlinear correlations. The caclulation of M I is implemented via applying adaptive partitioning method for deriving equal-probability bins (i.e., each bin contains approximately the same number of data points). # 2) calculate distance matrix using different metric sMap <-sPipeline(data=data) # 2a) using "pearson" metric dist <-sDistance(data=data, metric="pearson") # 2b) using "cos" metric # dist <-sDistance(data=data, metric="cos") # 2c) using "spearman" metric # dist <-sDistance(data=data, metric="spearman") # 2d) using "kendall" metric # dist <-sDistance(data=data, metric="kendall") # 2e) using "euclidean" metric # dist <-sDistance(data=data, metric="euclidean") # 2f) using "manhattan" metric # dist <-sDistance(data=data, metric="manhattan") # 2g) using "mi" metric # dist <-sDistance(data=data, metric="mi") sDmat Function to calculate distance matrix in high-dimensional input space but according to neighborhood relationships in 2D output space Description sDmat is supposed to calculate distance (measured in high-dimensional input space) to neighbors (defined by based on 2D output space) for each of hexagons/rectangles Usage sDmat(sMap, which_neigh = 1, distMeasure = c("median", "mean", "min", "max")) Arguments sMap an object of class "sMap" which_neigh which neighbors in 2D output space are used for the calculation. By default, it sets to "1" for direct neighbors, and "2" for neighbors within neighbors no more than 2, and so on distMeasure distance measure used to calculate distances in high-dimensional input space Value dMat a vector with the length of nHex. It stores the distance a hexaon/rectangle is away from its output-space-defined neighbors in high-dimensional input space Note "which_neigh" is defined in output 2D space, but "distMeasure" is defined in high-dimensional input space

Function to partition a grid map into clusters
Description sDmatCluster is supposed to obtain clusters from a grid map. It returns an object of class "sBase".
Usage sDmatCluster(sMap, which_neigh = 1, distMeasure = c("median", "mean", "min", "max"), clusterLinkage = c("average", "complete", "single", "bmh")) Arguments sMap an object of class "sMap" which_neigh which neighbors in 2D output space are used for the calculation. By default, it sets to "1" for direct neighbors, and "2" for neighbors within neighbors no more than 2, and so on distMeasure distance measure used to calculate distances in high-dimensional input space. It can be one of "median", "mean", "min" and "max" measures clusterLinkage cluster linkage used to derive clusters. It can be "bmh", which accumulates a cluster just based on best-matching hexagons/rectanges but can not ensure each cluster is continuous. Instead, each cluster is continuous when using regiongrowing algorithm with one of "average", "complete" and "single" linkages sDmatMinima Value an object of class "sBase", a list with following components: seeds the vector to store cluster seeds, i.e., a list of local minima (in 2D output space) of distance matrix (in input space). They are represented by the indexes of hexagons/rectangles bases the vector with the length of nHex to store the cluster memberships/bases, where nHex is the total number of hexagons/rectanges in the grid call the call that produced this result

Note
The first item in the return "seeds" is the first cluster, whose memberships are those in the return "bases" that equals 1. The same relationship is held for the second item, and so on See Also sPipeline, sDmatMinima, sBMH, sNeighDirect, sDistance, visDmatCluster Examples # 1) generate an iid normal random matrix of 1 x1 data <-matrix( rnorm(1 *1 ,mean= ,sd=1), nrow=1 , ncol=1 ) # 2) get trained using by default setup sMap <-sPipeline(data=data) # 3) partition the grid map into clusters based on different criteria # 3a) based on "bmh" criterion # sBase <-sDmatCluster(sMap=sMap, which_neigh=1, distMeasure="median", clusterLinkage="bmh") # 3b) using region-growing algorithm with linkage "average" sBase <-sDmatCluster(sMap=sMap, which_neigh=1, distMeasure="median", clusterLinkage="average") # 4) visualise clusters/bases partitioned from the sMap visDmatCluster(sMap,sBase) sDmatMinima Function to identify local minima (in 2D output space) of distance matrix (in high-dimensional input space) Description sDmatMinima is supposed to identify local minima of distance matrix (resulting from sDmat). The criterion of being local minima is that the distance associated with a hexagon/rectangle is always smaller than its direct neighbors (i.e., 1-neighborhood) Usage sDmatMinima(sMap, which_neigh = 1, distMeasure = c("median", "mean", "min", "max")) Arguments sMap an object of class "sMap" which_neigh which neighbors in 2D output space are used for the calculation. By default, it sets to "1" for direct neighbors, and "2" for neighbors within neighbors no more than 2, and so on distMeasure distance measure used to calculate distances in high-dimensional input space. It can be one of "median", "mean", "min" and "max" measures Value minima a vector to store a list of local minima (represented by the indexes of hexogans/rectangles Note Do not get confused by "which_neigh" and the criteria of being local minima. Both of them deal with 2D output space. However, "which_neigh" is used to assist in the calculation of distance matrix (so can be 1-neighborhood or more); instead, the criterion of being local minima is only 1-neighborhood in the strictest sense See Also

sHexDist(sObj)
Arguments sObj an object of class "sTopol" or "sInit" or "sMap" Value dist a symmetric matrix of nHex x nHex, containing pairwise distances, where nHex is the total number of hexagons/rectanges in the grid

Note
The return matrix has rows/columns ordered in the same order as the "coord" matrix of the input object does.

sTopology, sInitial
Examples # 1) generate an iid normal random matrix of 1 x1 data <-matrix( rnorm(1 *1 ,mean= ,sd=1), nrow=1 , ncol=1 ) # 2) from this input matrix, determine nHex=5*sqrt(nrow(data))=5 , # but it returns nHex=61, via "sHexGrid(nHex=5 )", to make sure a supra-hexagonal grid sTopol <-sTopology(data=data, lattice="hexa", shape="suprahex") # 3) initialise the codebook matrix using "uniform" method sI <-sInitial(data=data, sTopol=sTopol, init="uniform") # 4) calculate distances between hexagons/rectangles in a 2D grid based on different objects # 4a) based on an object of class "sTopol" dist <-sHexDist(sObj=sTopol) # 4b) based on an object of class "sMap" dist <-sHexDist(sObj=sI) sHexGrid Function to define a supra-hexagonal grid Description sHexGrid is supposed to define a supra-hexagonal map grid. A supra-hexagon is a giant hexagon, which seamlessly consists of smaller hexagons. Due to the symmetric nature, it can be uniquely determined by specifying the radius away from the grid centroid. This function takes input the grid radius (or the number of hexagons in the grid, but will be adjusted to meet the definition of supra-hexagon), and returns a list (see 'Value' below) containing: the grid radius, the total number of hexagons in the grid, the 2D coordinates of the grid centroid, the step for each hexogan away from the grid centroid, and the 2D coordinates of all hexagons in the grid.
Usage sHexGrid(r = NULL, nHex = NULL) Arguments r an integer specifying the radius in a supra-hexagonal grid nHex the number of input hexagons in the grid Value a list with following components: r the grid radius nHex the total number of hexagons in the grid. It may differ from the input value; actually it is always no less than the input one to ensure a supra-hexagonal grid exactly formed centroid the 2D coordinates of the grid centroid stepCentroid a vector with the length of nHex. It stores how many steps a hexagon is awawy from the grid centroid ('1' for the centroid itself). Starting with the centroid, it orders outward. Also, for those hexagons of the same step, it orders from the rightmost in an anti-clock wise coord a matrix of nHex x 2 with each row specifying the 2D coordinates of a hexagon in the grid. The order of rows is the same as 'centroid' above call the call that produced this result

Note
The relationships among return values:

See Also
sTopology Examples # The supra-hexagonal grid is exactly determined by specifying the radius. res <-sHexGrid(r=2) # The grid is determined according to the number of input hexagons (after being adjusted). # The return res$nHex is always no less than the input one. # It ensures a supra-hexagonal grid is exactly formed. res <-sHexGrid(nHex=12) # Ignore input nHex if r is also given res <-sHexGrid(r=3, nHex=1 ) # By default, r=3 if no parameters are specified res <-sHexGrid() sInitial sInitial

Function to initialise a sInit object given a topology and input data
Description sInitial is supposed to initialise an object of class "sInit" given a topology and input data. As a matter of fact, it initialises the codebook matrix (in input high-dimensional space). The return object inherits the topology information (i.e., a "sTopol" object from sTopology), along with initialised codebook matrix and method used.
Usage sInitial(data, sTopol, init = c("linear", "uniform", "sample")) Arguments data a data frame or matrix of input data sTopol an object of class "sTopol" (see sTopology) init an initialisation method. It can be one of "uniform", "sample" and "linear" initialisation methods Value an object of class "sInit", a list with following components: nHex the total number of hexagons/rectanges in the grid xdim x-dimension of the grid ydim y-dimension of the grid lattice the grid lattice shape the grid shape coord a matrix of nHex x 2, with each row corresponding to the coordinates of a hexagon/rectangle in the 2D map grid init an initialisation method codebook a codebook matrix of nHex x ncol(data), with each row corresponding to a prototype vector in input high-dimensional space call the call that produced this result
Usage sMapOverlay(sMap, data, additional) Arguments sMap an object of class "sMap" data a data frame or matrix of input data Weighting by neighbor kernel is to avoid rigid overlaying by only focusing on the best-matching map nodes as there may exist several closest best-matching nodes for an input data vector.

Function to calculate any neighbors for each hexagon/rectangle in a grid
Description sNeighAny is supposed to calculate any neighbors for each hexagon/rectangle in a regular 2D grid. It returns a matrix with rows for the self, and columns for its any neighbors.

sNeighAny(sObj)
Arguments sObj an object of class "sTopol" or "sInit" or "sMap" Value aNeigh a matrix of nHex x nHex, containing distance info in terms of any neighbors, where nHex is the total number of hexagons/rectanges in the grid

Note
The return matrix has rows for the self, and columns for its neighbors. The non-zeros mean the distance away from its neighbors, and the zeros for the self-self. It has rows/columns ordered in the same order as the "coord" matrix of the input object does.

sNeighDirect(sObj)
Arguments sObj an object of class "sTopol" or "sInit" or "sMap" Value dNeigh a matrix of nHex x nHex, containing presence/absence info in terms of direct neighbors, where nHex is the total number of hexagons/rectanges in the grid

Note
The return matrix has rows for the self, and columns for its direct neighbors. The "1" means the presence of direct neighbors, "0" for the absence. It has rows/columns ordered in the same order as the "coord" matrix of the input object does.
Usage sPipeline(data = NULL, xdim = NULL, ydim = NULL, nHex = NULL, lattice = c("hexa", "rect"), shape = c("suprahex", "sheet"), init = c("linear", "uniform", "sample"), algorithm = c("batch", "sequential"), alphaType = c("invert", "linear", "power"), neighKernel = c("gaussian", "bubble", "cutgaussian", "ep", "gamma"), finetuneSustain = F, verbose = T) Arguments data a data frame or matrix of input data xdim an integer specifying x-dimension of the grid ydim an integer specifying y-dimension of the grid nHex the number of hexagons/rectangles in the grid lattice the grid lattice, either "hexa" for a hexagon or "rect" for a rectangle shape the grid shape, either "suprahex" for a supra-hexagonal grid or "sheet" for a hexagonal/rectangle sheet init an initialisation method. It can be one of "uniform", "sample" and "linear" initialisation methods algorithm the training algorithm. It can be one of "sequential" and "batch" algorithm alphaType the alpha type. It can be one of "invert", "linear" and "power" alpha types neighKernel the training neighborhood kernel. It can be one of "gaussian", "bubble", "cutgaussian", "ep" and "gamma" kernels finetuneSustain logical to indicate whether sustain the "finetune" training. If true, it will repeat the "finetune" stage until the mean quantization error does get worse. By default, it sets to true verbose logical to indicate whether the messages will be displayed in the screen. By default, it sets to false for no display The pipeline sequentially consists of: • i) sTopology used to define the topology of a grid (with "suprahex" shape by default ) according to the input data; • ii) sInitial used to initialise the codebook matrix given the pre-defined topology and the input data (by default using "uniform" initialisation method); • iii) sTrainology and sTrainSeq used to get the grid map trained at both "rough" and "finetune" stages. If instructed, sustain the "finetune" training until the mean quantization error does get worse; • iv) sBMH used to identify the best-matching hexagons/rectangles (BMH) for the input data, and these response data are appended to the resulting object of "sMap" class.
Usage sTopology(data = NULL, xdim = NULL, ydim = NULL, nHex = NULL, lattice = c("hexa", "rect"), shape = c("suprahex", "sheet")) Arguments data a data frame or matrix of input data xdim an integer specifying x-dimension of the grid ydim an integer specifying y-dimension of the grid nHex the number of hexagons/rectangles in the grid lattice the grid lattice, either "hexa" for a hexagon or "rect" for a rectangle shape the grid shape, either "suprahex" for a supra-hexagonal grid or "sheet" for a hexagonal/rectangle sheet Value an object of class "sTopol", a list with following components: nHex the total number of hexagons/rectanges in the grid. It is not always the same as the input nHex (if any); see "Note" below for the explaination xdim x-dimension of the grid ydim y-dimension of the grid lattice the grid lattice shape the grid shape coord a matrix of nHex x 2, with each row corresponding to the coordinates of a hexagon/rectangle in the 2D map grid call the call that produced this result

Note
The output of nHex depends on the input arguments and grid shape: • How the input parameters are used to determine nHex is taken priority in the following order: "xdim & ydim" > "nHex" > "data" • If both of xdim and ydim are given, nHex = xdim * ydim for the "sheet" shape, r = (min(xdim, ydim) + 1)/2 for the "suprahex" shape • If only data is input, nHex = 5 * sqrt(dlen), where dlen is the number of rows of the input data • With nHex in hand, it depends on the grid shape: -For "sheet" shape, xy-dimensions of sheet grid is determined according to the square root of the two biggest eigenvalues of the input data -For "suprahex" shape, see sHexGrid for calculating the grid radius r. The xdim (and ydim) is related to r via xdim = 2 * r − 1

Function to implement training via batch algorithm
Description sTrainBatch is supposed to perform batch training algorithm. It requires three inputs: a "sMap" or "sInit" object, input data, and a "sTrain" object specifying training environment. The training is implemented iteratively, but instead of choosing a single input vector, the whole input matrix is used. In each training cycle, the whole input matrix first land in the map through identifying the corresponding winner hexagon/rectangle (BMH), and then the codebook matrix is updated via updating formula (see "Note" below for details). It returns an object of class "sMap".
Usage sTrainBatch(sMap, data, sTrain) Arguments sMap an object of class "sMap" or "sInit" data a data frame or matrix of input data sTrain an object of class "sTrain" , where • t denotes the training time/step • x j is an input vector j from the input data matrix (with dlen rows in total) • i and w stand for the hexagon/rectangle i and the winner BMH w, respectively • m i (t + 1) is the prototype vector of the hexagon i at time t + 1 • h wi (t) is the neighborhood kernel, a non-increasing function of i) the distance d wi between the hexagon/rectangle i and the winner BMH w, and ii) the radius δ t at time t. There are five kernels available: -For "gaussian" kernel, h wi (t) = e −d 2 See Also

Function to define trainology (training environment)
Description sTrainology is supposed to define the train-ology (i.e., the training environment/parameters). The trainology here refers to the training algorithm, the training stage, the stage-specific parameters (alpha type, initial alpha, initial radius, final radius and train length), and the training neighbor kernel used. It returns an object of class "sTrain".

Function to implement training via sequential algorithm
Description sTrainSeq is supposed to perform sequential training algorithm. It requires three inputs: a "sMap" or "sInit" object, input data, and a "sTrain" object specifying training environment. The training is implemented iteratively, each training cycle consisting of: i) randomly choose one input vector; ii) determine the winner hexagon/rectangle (BMH) according to minimum distance of codebook matrix to the input vector; ii) update the codebook matrix of the BMH and its neighbors via updating formula (see "Note" below for details). It also returns an object of class "sMap".
Usage sTrainSeq(sMap, data, sTrain) Arguments sMap an object of class "sMap" or "sInit" data a data frame or matrix of input data sTrain an object of class "sTrain" Value an object of class "sMap", a list with following components: • t denotes the training time/step • i and w stand for the hexagon/rectangle i and the winner BMH w, respectively • x(t) is an input vector randomly choosen (from the input data) at time t • m i (t) and m i (t + 1) are respectively the prototype vectors of the hexagon i at time t and t + 1 • α(t) is the learning rate at time t. There are three types of learning rate functions: -For "linear" function, α(t) = α 0 * (1 − t/T ) -For "power" function, α(t) = α 0 * (0.005/α 0 ) t/T -For "invert" function, α(t) = α 0 /(1 + 100 * t/T ) -Where α 0 is the initial learing rate (typically, α 0 = 0.5 at "rough" stage, α 0 = 0.05 at "finetune" stage), T is the length of training time/step (often being set to input data length, i.e., the total number of rows) • h wi (t) is the neighborhood kernel, a non-increasing function of i) the distance d wi between the hexagon/rectangle i and the winner BMH w, and ii) the radius δ t at time t. There are five kernels available: See Also
Usage sWriteData(sMap, data, sBase = NULL, filename = NULL, keep.data = F) Arguments sMap an object of class "sMap" or a codebook matrix data a data frame or matrix of input data sBase an object of class "sBase" filename a character string naming a filename keep.data logical to indicate whether or not to also write out the input data. By default, it sets to false for not keeping it. It is highly expensive to keep the large data sets Value a data frame with following components: ID ID for data. It inherits the rownames of data (if exists). Otherwise, it is sequential integer values starting with 1 and ending with dlen, the total number of rows of the input data Hexagon_index the index for best-matching hexagons Cluster_base optional, it is only appended when sBase is given. It stores the cluster memberships/bases data optional, it is only appended when keep.data is true

Note
If "filename" is not NULL, a tab-delimited text file will be also written out. If "sBase" is not NULL and comes from the "sMap" partition, then cluster bases are also appended. if "keep.data" is true, the data will be part of output.

Value invisibly
Note none See Also

Function to define a colormap
Description visColormap is supposed to define a colormap. It returns a function, which will take an integer argument specifying how many colors interpolate the given colormap.

Function to visualise various mapping items within a supra-hexagonal grid
Description visHexMapping is supposed to visualise various mapping items within a supra-hexagonal grid Usage visHexMapping(sObj, mappingType = c("indexes", "hits", "dist", "antidist", "bases", "customized"), labels = NULL, height = 7, margin = rep ( .1, 4), area.size = 1, gp = grid::gpar(cex = .7, font = 1, col.label = "black"), border.color = "black", fill.color = "transparent", clip = c("on", "inherit", "off"), newpage = T) Arguments sObj an object of class "sMap" or "sInit" or "sTopol" mappingType the mapping type, can be "indexes", "hits", "dist", "antidist", "bases", and "customized" labels NULL or a vector with the length of nHex height a numeric value specifying the height of device margin margins as units of length 4 or 1 area.size an inteter or a vector specifying the area size of each hexagon gp an object of class "gpar". It is the output from a call to the function "gpar" (i.e., a list of graphical parameter settings) border.color the border color for each hexagon fill.color the filled color for each hexagon clip either "on" for clipping to the extent of this viewport, "inherit" for inheriting the clipping region from the parent viewport, or "off" to turn clipping off altogether newpage logical to indicate whether to open a new page. By default, it sets to true for opening a new page Value invisible

Note
The mappingType includes: • "indexes": the index of hexagons in a supra-hexagonal grid • "hits": the number of input data vectors hitting the hexagons • "dist": distance (in high-dimensional input space) to neighbors (defined in 2D output space) • "antidist": the oppose version of "dist" • "bases": clusters partitioned from the sMap • "customized": displaying input "labels" See Also

Value invisible
Note none See Also

Note
The "plotType" includes: • "lines": line plot. If multple colors are given, the points are also plotted. When the pattern involves both positive and negative values, zero horizental line is also shown • "bars": bar plot. When the pattern involves both positive and negative values, the zero horizental line is in the middle of the hexagon; otherwise at the top of the hexagon for all negative values, and at the bottom for all positive values visKernels • "radars": radar plot. Each radar diagram represents one pattern, wherein each element value is proportional to the distance from the center. Note, it starts on the right and wind counterclockwise around the circle See Also

sTrainSeq, sTrainBatch
Examples # visualise currently supported five kernels visKernels() visVp Function to create viewports for multiple supra-hexagonal grids Description visVp is supposed to create viewports, which describe rectangular regions on a graphics device and define a number of coordinate systems for each of supra-hexagonal grids.

Xiang
Arguments height a numeric value specifying the height of device xdim an integer specifying x-dimension of the grid ydim an integer specifying y-dimension of the grid colNum an integer specifying the number of columns rowNum an integer specifying the number of rows gp an object of class gpar, typically the output from a call to the function gpar (i.e., a list of graphical parameter settings) Value vpnames an R object of "viewport" class Note none See Also

Xiang
Arabidopsis embryo gene expression dataset from Xiang et al. (2011) Description Arabidopsis embryo dataset contains gene expression levels (3625 genes and 7 embryo samples) from Xiang et al. (2011). This dataset has been pre-processed: capping into floor of intensity 777.6; 2-base logarithmic transformation; row/gene centering; and keeping genes with at least 2fold changes (in any stage) as compared to the average over embryo stages.

Value
Xiang a gene expression matrix of 3625 genes x 7 stage samples. These embryo stages are: zygote, quadrant, globular, heart, torpedo, bent, and mature.