-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathextend.Rd
executable file
·70 lines (60 loc) · 2.45 KB
/
extend.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/AllGenerics.R, R/gmql_extend.R
\name{extend}
\alias{extend}
\alias{extend,GMQLDataset-method}
\alias{extend-method}
\title{Method extend}
\usage{
extend(.data, ...)
\S4method{extend}{GMQLDataset}(.data, ...)
}
\arguments{
\item{.data}{GMQLDataset class object}
\item{...}{a series of expressions separated by comma in the form
\emph{key} = \emph{aggregate}. The \emph{aggregate} is an object of
class AGGREGATES. The aggregate functions available are: \code{\link{SUM}},
\code{\link{COUNT}}, \code{\link{MIN}}, \code{\link{MAX}},
\code{\link{AVG}}, \code{\link{MEDIAN}}, \code{\link{STD}},
\code{\link{BAG}}, \code{\link{BAGD}}, \code{\link{Q1}},
\code{\link{Q2}}, \code{\link{Q3}}.
Every aggregate accepts a string value, except for COUNT, which does not
have any value.
Argument of 'aggregate function' must exist in schema, i.e. among region
attributes. Two styles are allowed:
\itemize{
\item list of key-value pairs: e.g. sum = SUM("pvalue")
\item list of values: e.g. SUM("pvalue")
}
"mixed style" is not allowed}
}
\value{
GMQLDataset object. It contains the value to use as input
for the subsequent GMQLDataset method
}
\description{
Wrapper to GMQL EXTEND operator
For each sample in an input dataset, it generates new metadata attributes
as result of aggregate functions applied to sample region attributes
and adds them to the existing metadata attributes of the sample.
Aggregate functions are applied sample by sample.
}
\examples{
## This statement initializes and runs the GMQL server for local execution
## and creation of results on disk. Then, with system.file() it defines
## the path to the folder "DATASET" in the subdirectory "example"
## of the package "RGMQL" and opens such folder as a GMQL dataset
## named "data"
init_gmql()
test_path <- system.file("example", "DATASET", package = "RGMQL")
data <- read_gmql(test_path)
## This statement counts the regions in each sample and stores their number
## as value of the new metadata attribute RegionCount of the sample.
e <- extend(data, RegionCount = COUNT())
## This statement copies all samples of data dataset into 'res' dataset,
## and then calculates for each of them two new metadata attributes:
## 1. RegionCount is the number of sample regions;
## 2. MinP is the minimum pvalue of the sample regions.
## res sample regions are the same as the ones in data.
res = extend(data, RegionCount = COUNT(), MinP = MIN("pvalue"))
}