Browse code

biocheck

Simone authored on 17/05/2021 09:41:45
Showing 1 changed files
... ...
@@ -3,28 +3,28 @@
3 3
 #########################
4 4
 
5 5
 DISTAL <- function(value) {
6
-  op_list <- list(value = value)
7
-  ## Set the name for the class
8
-  class(op_list) <- "DISTAL"
9
-  return(op_list)
6
+    op_list <- list(value = value)
7
+    ## Set the name for the class
8
+    class(op_list) <- "DISTAL"
9
+    return(op_list)
10 10
 }
11 11
 
12 12
 print.DISTAL <- function(obj) {
13
-  print(as.character.DISTAL(obj))
13
+    print(as.character.DISTAL(obj))
14 14
 }
15 15
 
16 16
 as.character.DISTAL <- function(obj) {
17
-  class <- class(obj)[1]
18
-  val <- obj$value
19
-  c(class,val)
17
+    class <- class(obj)[1]
18
+    val <- obj$value
19
+    c(class,val)
20 20
 }
21 21
 
22 22
 check.DISTAL <- function(value) {
23
-  if(!is.numeric(value))
24
-    stop("value: is not a numeric")
25
-  
26
-  if(is.numeric(value) && length(value)>1)
27
-    stop("value: no multiple string")
23
+    if(!is.numeric(value))
24
+        stop("value: is not a numeric")
25
+    
26
+    if(is.numeric(value) && length(value)>1)
27
+        stop("value: no multiple string")
28 28
 }
29 29
 #' DISTAL object class constructor
30 30
 #'
... ...
@@ -114,11 +114,11 @@ check.DISTAL <- function(value) {
114 114
 #' @export
115 115
 #' 
116 116
 DL <- function(value) {
117
-  check.DISTAL(value)
118
-  list <- list(value = as.integer(value))
119
-  ## Set the name for the class
120
-  class(list) <- c("DL","DISTAL")
121
-  return(list)
117
+    check.DISTAL(value)
118
+    list <- list(value = as.integer(value))
119
+    ## Set the name for the class
120
+    class(list) <- c("DL","DISTAL")
121
+    return(list)
122 122
 }
123 123
 
124 124
 #' @name DG
... ...
@@ -127,11 +127,11 @@ DL <- function(value) {
127 127
 #' @export
128 128
 #' 
129 129
 DG <- function(value) {
130
-  check.DISTAL(value)
131
-  list <- list(value = as.integer(value))
132
-  ## Set the name for the class
133
-  class(list) <- c("DG","DISTAL")
134
-  return(list)
130
+    check.DISTAL(value)
131
+    list <- list(value = as.integer(value))
132
+    ## Set the name for the class
133
+    class(list) <- c("DG","DISTAL")
134
+    return(list)
135 135
 }
136 136
 
137 137
 #' @name DISTAL-Object
... ...
@@ -140,11 +140,11 @@ DG <- function(value) {
140 140
 #' @export
141 141
 #' 
142 142
 DLE <- function(value) {
143
-  check.DISTAL(value)
144
-  list <- list(value = as.integer(value))
145
-  ## Set the name for the class
146
-  class(list) <- c("DLE","DISTAL")
147
-  return(list)
143
+    check.DISTAL(value)
144
+    list <- list(value = as.integer(value))
145
+    ## Set the name for the class
146
+    class(list) <- c("DLE","DISTAL")
147
+    return(list)
148 148
 }
149 149
 
150 150
 #' @name DISTAL-Object
... ...
@@ -153,11 +153,11 @@ DLE <- function(value) {
153 153
 #' @export
154 154
 #' 
155 155
 DGE <- function(value) {
156
-  check.DISTAL(value)
157
-  list <- list(value = as.integer(value))
158
-  ## Set the name for the class
159
-  class(list) <- c("DGE","DISTAL")
160
-  return(list)
156
+    check.DISTAL(value)
157
+    list <- list(value = as.integer(value))
158
+    ## Set the name for the class
159
+    class(list) <- c("DGE","DISTAL")
160
+    return(list)
161 161
 }
162 162
 
163 163
 #' @name DISTAL-Object
... ...
@@ -166,11 +166,11 @@ DGE <- function(value) {
166 166
 #' @export
167 167
 #' 
168 168
 MD <- function(value) {
169
-  check.DISTAL(value)
170
-  list <- list(value = as.integer(value))
171
-  ## Set the name for the class
172
-  class(list) <- c("MD","DISTAL")
173
-  return(list)
169
+    check.DISTAL(value)
170
+    list <- list(value = as.integer(value))
171
+    ## Set the name for the class
172
+    class(list) <- c("MD","DISTAL")
173
+    return(list)
174 174
 }
175 175
 
176 176
 
... ...
@@ -180,14 +180,14 @@ MD <- function(value) {
180 180
 #' @export
181 181
 #' 
182 182
 UP <- function() {
183
-  list <- list()
184
-  ## Set the name for the class
185
-  class(list) <- c("UP","DISTAL")
186
-  return(list)
183
+    list <- list()
184
+    ## Set the name for the class
185
+    class(list) <- c("UP","DISTAL")
186
+    return(list)
187 187
 }
188 188
 as.character.UP <- function(obj) {
189
-  class <- class(obj)[1]
190
-  c(class,"")
189
+    class <- class(obj)[1]
190
+    c(class,"")
191 191
 }
192 192
 
193 193
 
... ...
@@ -197,13 +197,13 @@ as.character.UP <- function(obj) {
197 197
 #' @export
198 198
 #' 
199 199
 DOWN <- function() {
200
-  list <- list()
201
-  ## Set the name for the class
202
-  class(list) <- c("DOWN","DISTAL")
203
-  return(list)
200
+    list <- list()
201
+    ## Set the name for the class
202
+    class(list) <- c("DOWN","DISTAL")
203
+    return(list)
204 204
 }
205 205
 as.character.DOWN <- function(obj) {
206
-  class <- class(obj)[1]
207
-  c(class,"")
206
+    class <- class(obj)[1]
207
+    c(class,"")
208 208
 }
209 209
 
Browse code

update with some news

Simone authored on 21/03/2021 14:34:30
Showing 1 changed files
1 1
old mode 100644
2 2
new mode 100755
... ...
@@ -2,31 +2,29 @@
2 2
 #       DISTAL          #
3 3
 #########################
4 4
 
5
-DISTAL <- function(value)
6
-{
7
-    op_list <- list(value = value)
8
-    ## Set the name for the class
9
-    class(op_list) <- "DISTAL"
10
-    return(op_list)
5
+DISTAL <- function(value) {
6
+  op_list <- list(value = value)
7
+  ## Set the name for the class
8
+  class(op_list) <- "DISTAL"
9
+  return(op_list)
11 10
 }
12 11
 
13 12
 print.DISTAL <- function(obj) {
14
-    print(as.character.DISTAL(obj))
13
+  print(as.character.DISTAL(obj))
15 14
 }
16 15
 
17 16
 as.character.DISTAL <- function(obj) {
18
-    class <- class(obj)[1]
19
-    val <- obj$value
20
-    c(class,val)
17
+  class <- class(obj)[1]
18
+  val <- obj$value
19
+  c(class,val)
21 20
 }
22 21
 
23
-check.DISTAL <- function(value)
24
-{
25
-    if(!is.numeric(value))
26
-        stop("value: is not a numeric")
27
-    
28
-    if(is.numeric(value) && length(value)>1)
29
-        stop("value: no multiple string")
22
+check.DISTAL <- function(value) {
23
+  if(!is.numeric(value))
24
+    stop("value: is not a numeric")
25
+  
26
+  if(is.numeric(value) && length(value)>1)
27
+    stop("value: no multiple string")
30 28
 }
31 29
 #' DISTAL object class constructor
32 30
 #'
... ...
@@ -115,13 +113,12 @@ check.DISTAL <- function(value)
115 113
 #' @rdname distal-class
116 114
 #' @export
117 115
 #' 
118
-DL <- function(value)
119
-{
120
-    check.DISTAL(value)
121
-    list <- list(value = as.integer(value))
122
-    ## Set the name for the class
123
-    class(list) <- c("DL","DISTAL")
124
-    return(list)
116
+DL <- function(value) {
117
+  check.DISTAL(value)
118
+  list <- list(value = as.integer(value))
119
+  ## Set the name for the class
120
+  class(list) <- c("DL","DISTAL")
121
+  return(list)
125 122
 }
126 123
 
127 124
 #' @name DG
... ...
@@ -129,13 +126,12 @@ DL <- function(value)
129 126
 #' @rdname distal-class
130 127
 #' @export
131 128
 #' 
132
-DG <- function(value)
133
-{
134
-    check.DISTAL(value)
135
-    list <- list(value = as.integer(value))
136
-    ## Set the name for the class
137
-    class(list) <- c("DG","DISTAL")
138
-    return(list)
129
+DG <- function(value) {
130
+  check.DISTAL(value)
131
+  list <- list(value = as.integer(value))
132
+  ## Set the name for the class
133
+  class(list) <- c("DG","DISTAL")
134
+  return(list)
139 135
 }
140 136
 
141 137
 #' @name DISTAL-Object
... ...
@@ -143,13 +139,12 @@ DG <- function(value)
143 139
 #' @rdname distal-class
144 140
 #' @export
145 141
 #' 
146
-DLE <- function(value)
147
-{
148
-    check.DISTAL(value)
149
-    list <- list(value = as.integer(value))
150
-    ## Set the name for the class
151
-    class(list) <- c("DLE","DISTAL")
152
-    return(list)
142
+DLE <- function(value) {
143
+  check.DISTAL(value)
144
+  list <- list(value = as.integer(value))
145
+  ## Set the name for the class
146
+  class(list) <- c("DLE","DISTAL")
147
+  return(list)
153 148
 }
154 149
 
155 150
 #' @name DISTAL-Object
... ...
@@ -157,13 +152,12 @@ DLE <- function(value)
157 152
 #' @rdname distal-class
158 153
 #' @export
159 154
 #' 
160
-DGE <- function(value)
161
-{
162
-    check.DISTAL(value)
163
-    list <- list(value = as.integer(value))
164
-    ## Set the name for the class
165
-    class(list) <- c("DGE","DISTAL")
166
-    return(list)
155
+DGE <- function(value) {
156
+  check.DISTAL(value)
157
+  list <- list(value = as.integer(value))
158
+  ## Set the name for the class
159
+  class(list) <- c("DGE","DISTAL")
160
+  return(list)
167 161
 }
168 162
 
169 163
 #' @name DISTAL-Object
... ...
@@ -171,13 +165,12 @@ DGE <- function(value)
171 165
 #' @rdname distal-class
172 166
 #' @export
173 167
 #' 
174
-MD <- function(value)
175
-{
176
-    check.DISTAL(value)
177
-    list <- list(value = as.integer(value))
178
-    ## Set the name for the class
179
-    class(list) <- c("MD","DISTAL")
180
-    return(list)
168
+MD <- function(value) {
169
+  check.DISTAL(value)
170
+  list <- list(value = as.integer(value))
171
+  ## Set the name for the class
172
+  class(list) <- c("MD","DISTAL")
173
+  return(list)
181 174
 }
182 175
 
183 176
 
... ...
@@ -186,16 +179,15 @@ MD <- function(value)
186 179
 #' @rdname distal-class
187 180
 #' @export
188 181
 #' 
189
-UP <- function()
190
-{
191
-    list <- list()
192
-    ## Set the name for the class
193
-    class(list) <- c("UP","DISTAL")
194
-    return(list)
182
+UP <- function() {
183
+  list <- list()
184
+  ## Set the name for the class
185
+  class(list) <- c("UP","DISTAL")
186
+  return(list)
195 187
 }
196 188
 as.character.UP <- function(obj) {
197
-    class <- class(obj)[1]
198
-    c(class,"")
189
+  class <- class(obj)[1]
190
+  c(class,"")
199 191
 }
200 192
 
201 193
 
... ...
@@ -204,17 +196,14 @@ as.character.UP <- function(obj) {
204 196
 #' @rdname distal-class
205 197
 #' @export
206 198
 #' 
207
-DOWN <- function()
208
-{
209
-    list <- list()
210
-    ## Set the name for the class
211
-    class(list) <- c("DOWN","DISTAL")
212
-    return(list)
199
+DOWN <- function() {
200
+  list <- list()
201
+  ## Set the name for the class
202
+  class(list) <- c("DOWN","DISTAL")
203
+  return(list)
213 204
 }
214
-
215
-
216 205
 as.character.DOWN <- function(obj) {
217
-    class <- class(obj)[1]
218
-    c(class,"")
206
+  class <- class(obj)[1]
207
+  c(class,"")
219 208
 }
220 209
 
Simone authored on 19/01/2018 11:06:58
Showing 1 changed files
... ...
@@ -80,7 +80,7 @@ check.DISTAL <- function(value)
80 80
 #' ## and creation of results on disk. Then, with system.file() it defines 
81 81
 #' ## the path to the folders "DATASET" and "DATASET_GDM" in the subdirectory 
82 82
 #' ## "example" of the package "RGMQL", and opens such folders as a GMQL 
83
-#' ## datasets named "TSS" and "HM", respectively, using customParser
83
+#' ## datasets named "TSS" and "HM", respectively, using CustomParser
84 84
 #' 
85 85
 #' init_gmql()
86 86
 #' test_path <- system.file("example", "DATASET", package = "RGMQL")
... ...
@@ -96,8 +96,8 @@ check.DISTAL <- function(value)
96 96
 #' ## samples are obtained from the same provider (joinby clause).
97 97
 #' 
98 98
 #' join_data = merge(TSS, HM, 
99
-#' genometric_predicate = list(MD(1), DL(1200)), conds("provider"), 
100
-#' region_output = "RIGHT")
99
+#'     genometric_predicate = list(MD(1), DL(1200)), conds("provider"), 
100
+#'     region_output = "RIGHT")
101 101
 #'
102 102
 #' ## Given a dataset HM and one called TSS with a sample including 
103 103
 #' ## Transcription Start Site annotations, this statement searches for those 
... ...
@@ -107,8 +107,8 @@ check.DISTAL <- function(value)
107 107
 #' ## TSS and HM samples are obtained from the same provider (joinby clause).
108 108
 #' 
109 109
 #' join_data = merge(TSS, HM, 
110
-#' genometric_predicate = list(MD(1), DGE(12000), DOWN()), conds("provider"), 
111
-#' region_output = "RIGHT")
110
+#'     genometric_predicate = list(MD(1), DGE(12000), DOWN()), 
111
+#'     conds("provider"), region_output = "RIGHT")
112 112
 #'
113 113
 #' @name DISTAL-Object
114 114
 #' @aliases DL
Browse code

minor fix

Simone authored on 11/01/2018 13:10:15
Showing 1 changed files
... ...
@@ -37,74 +37,74 @@ check.DISTAL <- function(value)
37 37
 #' \itemize{
38 38
 #' \item{DL: It denotes the less distance clause, 
39 39
 #' which selects all the regions of a joined experiment dataset sample such 
40
-#' that their distance from the anchor region of a joined reference dataset 
40
+#' that their distance from the anchor region of the joined reference dataset 
41 41
 #' sample is less than 'value' bases.}
42
-#' \item{DLE: It denotes the less distance clause, 
42
+#' \item{DLE: It denotes the less equal distance clause, 
43 43
 #' which selects all the regions of a joined experiment dataset sample such 
44
-#' that their distance from the anchor region of a joined reference dataset 
44
+#' that their distance from the anchor region of the joined reference dataset 
45 45
 #' sample is less than, or equal to, 'value' bases.}
46
-#' \item{DG: It denotes the less distance clause, 
46
+#' \item{DG: It denotes the great distance clause, 
47 47
 #' which selects all the regions of a joined experiment dataset sample such 
48
-#' that their distance from the anchor region of a joined reference dataset 
48
+#' that their distance from the anchor region of the joined reference dataset 
49 49
 #' sample is greater than 'value' bases. }
50
-#' \item{DGE: It denotes the less distance clause, 
50
+#' \item{DGE: It denotes the great equal distance clause, 
51 51
 #' which selects all the regions of a joined experiment dataset sample such 
52
-#' that their distance from the anchor region of a joined reference dataset 
52
+#' that their distance from the anchor region of the joined reference dataset 
53 53
 #' sample is greater than, or equal to, 'value' bases.}
54 54
 #' \item{MD: It denotes the minimum distance clause, which selects 
55
-#' the first 'value' regions of a joined experiment at minimial distance 
56
-#' from the anchor region of a joined reference dataset sample.}
55
+#' the first 'value' regions of the joined experiment at minimial distance 
56
+#' from the anchor region of the joined reference dataset sample.}
57 57
 #' \item{UP: It denotes the upstream direction of the genome.
58
-#' It makes predicates to be hold on the upstream of the regions of a joined 
59
-#' experiment dataset sample.
60
-#' UP is true when region of a joined experiment dataset sample is in the
61
-#' upstream genome of the anchor region of a joined reference dataset sample.
58
+#' It makes predicates to be hold on the upstream of the regions of the joined 
59
+#' reference dataset sample.
60
+#' UP is true when region of the joined experiment dataset sample is in the
61
+#' upstream genome of the anchor region of the joined reference dataset sample.
62 62
 #' When this clause is not present, distal conditions apply to both 
63 63
 #' directions of the genome.}
64 64
 #' \item{DOWN:  It denotes the downstream direction of the genome.
65
-#' It makes predicates to be hold on the downstream of the regions of a joined 
66
-#' experiment dataset sample.
67
-#' UP is true when region of a joined experiment dataset sample is in the
68
-#' downstream genome of the anchor region of a joined reference dataset sample.
69
-#' When this clause is not present, distal conditions apply to both 
65
+#' It makes predicates to be hold on the downstream of the regions of the 
66
+#' joined reference dataset sample.
67
+#' DOWN is true when region of the joined experiment dataset sample is in the
68
+#' downstream genome of the anchor region of the joined reference dataset 
69
+#' sample. When this clause is not present, distal conditions apply to both 
70 70
 #' directions of the genome.}
71 71
 #' }
72 72
 #' 
73 73
 #' @param value string identifying distance between genomic regions 
74
-#' in base pair, 
74
+#' in base pair
75 75
 #'
76 76
 #' @return Distal object
77 77
 #' 
78 78
 #' @examples
79
-#' ## Thi statement initializes and runs the GMQL server for local execution 
79
+#' ## This statement initializes and runs the GMQL server for local execution 
80 80
 #' ## and creation of results on disk. Then, with system.file() it defines 
81 81
 #' ## the path to the folders "DATASET" and "DATASET_GDM" in the subdirectory 
82
-#' ## "example" of the package "RGMQL" and opens such folder as a GMQL 
83
-#' ## dataset named "TSS" and "HM" respectively using customParser
82
+#' ## "example" of the package "RGMQL", and opens such folders as a GMQL 
83
+#' ## datasets named "TSS" and "HM", respectively, using customParser
84 84
 #' 
85 85
 #' init_gmql()
86 86
 #' test_path <- system.file("example", "DATASET", package = "RGMQL")
87 87
 #' test_path2 <- system.file("example", "DATASET_GDM", package = "RGMQL")
88
-#' TSS = read_GMQL(test_path)
89
-#' HM = read_GMQL(test_path2)
88
+#' TSS = read_gmql(test_path)
89
+#' HM = read_gmql(test_path2)
90 90
 #' 
91 91
 #' ## Given a dataset HM and one called TSS with a sample including 
92
-#' ## Transcription Start Site annotations, it searches for those regions of HM 
93
-#' ## that are at a minimal distance from a transcription start site (TSS) 
94
-#' ## and takes the first/closest one for each TSS, provided that such 
95
-#' ## distance is lesser than 1200 bases and joined TSS and HM samples are 
96
-#' ## obtained from the same provider (joinby clause).
92
+#' ## Transcription Start Site annotations, this statement  searches for those 
93
+#' ## regions of HM that are at a minimal distance from a transcription 
94
+#' ## start site (TSS) and takes the first/closest one for each TSS, provided 
95
+#' ## that such distance is lesser than 1200 bases and joined TSS and HM 
96
+#' ## samples are obtained from the same provider (joinby clause).
97 97
 #' 
98 98
 #' join_data = merge(TSS, HM, 
99 99
 #' genometric_predicate = list(MD(1), DL(1200)), conds("provider"), 
100 100
 #' region_output = "RIGHT")
101 101
 #'
102
-#' ## Given a dataset 'HM' and one called 'TSS' with a sample including 
103
-#' ## Transcription Start Site annotations, it searches for those regions of HM 
104
-#' ## that are at a minimal distance from a transcription start site (TSS) 
105
-#' ## and takes the first/closest one for each TSS, provided that such distance 
106
-#' ## is greater than 12K bases and joined 'tss' and 'hm' samples are obtained 
107
-#' ## from the same provider (joinby clause).
102
+#' ## Given a dataset HM and one called TSS with a sample including 
103
+#' ## Transcription Start Site annotations, this statement searches for those 
104
+#' ## regions of HM that are downstream and at a minimal distance from a 
105
+#' ## transcription start site (TSS) and takes the first/closest one for each 
106
+#' ## TSS, provided that such distance is greater than 12K bases and joined 
107
+#' ## TSS and HM samples are obtained from the same provider (joinby clause).
108 108
 #' 
109 109
 #' join_data = merge(TSS, HM, 
110 110
 #' genometric_predicate = list(MD(1), DGE(12000), DOWN()), conds("provider"), 
Simone authored on 02/01/2018 22:01:09
Showing 1 changed files
... ...
@@ -85,8 +85,8 @@ check.DISTAL <- function(value)
85 85
 #' init_gmql()
86 86
 #' test_path <- system.file("example", "DATASET", package = "RGMQL")
87 87
 #' test_path2 <- system.file("example", "DATASET_GDM", package = "RGMQL")
88
-#' TSS = read_dataset(test_path)
89
-#' HM = read_dataset(test_path2)
88
+#' TSS = read_GMQL(test_path)
89
+#' HM = read_GMQL(test_path2)
90 90
 #' 
91 91
 #' ## Given a dataset HM and one called TSS with a sample including 
92 92
 #' ## Transcription Start Site annotations, it searches for those regions of HM 
... ...
@@ -96,7 +96,7 @@ check.DISTAL <- function(value)
96 96
 #' ## obtained from the same provider (joinby clause).
97 97
 #' 
98 98
 #' join_data = merge(TSS, HM, 
99
-#' genometric_predicate = list(MD(1), DL(1200)), DF("provider"), 
99
+#' genometric_predicate = list(MD(1), DL(1200)), conds("provider"), 
100 100
 #' region_output = "RIGHT")
101 101
 #'
102 102
 #' ## Given a dataset 'HM' and one called 'TSS' with a sample including 
... ...
@@ -107,8 +107,8 @@ check.DISTAL <- function(value)
107 107
 #' ## from the same provider (joinby clause).
108 108
 #' 
109 109
 #' join_data = merge(TSS, HM, 
110
-#' genometric_predicate = list(MD(1), DGE(12000), DOWN()), 
111
-#' DF("provider"), region_output = "RIGHT")
110
+#' genometric_predicate = list(MD(1), DGE(12000), DOWN()), conds("provider"), 
111
+#' region_output = "RIGHT")
112 112
 #'
113 113
 #' @name DISTAL-Object
114 114
 #' @aliases DL
Simone authored on 10/12/2017 16:29:05
Showing 1 changed files
... ...
@@ -31,71 +31,80 @@ check.DISTAL <- function(value)
31 31
 #' DISTAL object class constructor
32 32
 #'
33 33
 #' This class constructor is used to create instances of DISTAL object
34
-#' to be used in GMQL functions that use genometric predicate parameter
35
-#' requiring distal condition on value
34
+#' to be used in GMQL JOIN operations (RGMQL merge functions) that use 
35
+#' genometric predicate parameter requiring distal condition on value
36 36
 #' 
37 37
 #' \itemize{
38 38
 #' \item{DL: It denotes the less distance clause, 
39
-#' which selects all the regions of the experiment such that their distance 
40
-#' from the anchor region is less than 'value' bases.}
39
+#' which selects all the regions of a joined experiment dataset sample such 
40
+#' that their distance from the anchor region of a joined reference dataset 
41
+#' sample is less than 'value' bases.}
41 42
 #' \item{DLE: It denotes the less distance clause, 
42
-#' which selects all the regions of the experiment such that their distance 
43
-#' from the anchor region is less than, or equal to, 'value' bases.}
44
-#' \item{DG: it denotes the less distance clause, 
45
-#' which selects all the regions of the experiment such that their distance 
46
-#' from the anchor region is greater than 'value' bases. }
47
-#' \item{DGE: It denotes the less distance clause, which selects all the 
48
-#' regions of the experiment such that their distance from the anchor region 
49
-#' is greater than, or equal to, 'value' bases.}
43
+#' which selects all the regions of a joined experiment dataset sample such 
44
+#' that their distance from the anchor region of a joined reference dataset 
45
+#' sample is less than, or equal to, 'value' bases.}
46
+#' \item{DG: It denotes the less distance clause, 
47
+#' which selects all the regions of a joined experiment dataset sample such 
48
+#' that their distance from the anchor region of a joined reference dataset 
49
+#' sample is greater than 'value' bases. }
50
+#' \item{DGE: It denotes the less distance clause, 
51
+#' which selects all the regions of a joined experiment dataset sample such 
52
+#' that their distance from the anchor region of a joined reference dataset 
53
+#' sample is greater than, or equal to, 'value' bases.}
50 54
 #' \item{MD: It denotes the minimum distance clause, which selects 
51
-#' the 'value' regions of the experiment at minimial distance from the 
52
-#' anchor region.}
55
+#' the first 'value' regions of a joined experiment at minimial distance 
56
+#' from the anchor region of a joined reference dataset sample.}
53 57
 #' \item{UP: It denotes the upstream direction of the genome.
54
-#' They are interpreted as predicates that must hold on the regions 
55
-#' of the experiment.
56
-#' UP is true when region of experiment is in the upstream genome 
57
-#' of the anchor region.
58
+#' It makes predicates to be hold on the upstream of the regions of a joined 
59
+#' experiment dataset sample.
60
+#' UP is true when region of a joined experiment dataset sample is in the
61
+#' upstream genome of the anchor region of a joined reference dataset sample.
58 62
 #' When this clause is not present, distal conditions apply to both 
59
-#' the directions of the genome.}
60
-#' \item{DOWN: It denotes the downstream direction of the genome.
61
-#' They are interpreted as predicates that must hold on the regions of 
62
-#' the experiment.
63
-#' DOWN is true when region of experiment is in the downstream genome of 
64
-#' the anchor region.
65
-#' When this clause is not present, distal conditions apply to both the 
66
-#' directions of the genome. }
63
+#' directions of the genome.}
64
+#' \item{DOWN:  It denotes the downstream direction of the genome.
65
+#' It makes predicates to be hold on the downstream of the regions of a joined 
66
+#' experiment dataset sample.
67
+#' UP is true when region of a joined experiment dataset sample is in the
68
+#' downstream genome of the anchor region of a joined reference dataset sample.
69
+#' When this clause is not present, distal conditions apply to both 
70
+#' directions of the genome.}
67 71
 #' }
68 72
 #' 
69 73
 #' @param value string identifying distance between genomic regions 
70
-#' in base pairs, 
74
+#' in base pair, 
71 75
 #'
72
-#' @return distal object
76
+#' @return Distal object
73 77
 #' 
74 78
 #' @examples
79
+#' ## Thi statement initializes and runs the GMQL server for local execution 
80
+#' ## and creation of results on disk. Then, with system.file() it defines 
81
+#' ## the path to the folders "DATASET" and "DATASET_GDM" in the subdirectory 
82
+#' ## "example" of the package "RGMQL" and opens such folder as a GMQL 
83
+#' ## dataset named "TSS" and "HM" respectively using customParser
75 84
 #' 
76 85
 #' init_gmql()
77
-#' test_path <- system.file("example","DATASET",package = "RGMQL")
78
-#' test_path2 <- system.file("example","DATASET_GDM",package = "RGMQL")
86
+#' test_path <- system.file("example", "DATASET", package = "RGMQL")
87
+#' test_path2 <- system.file("example", "DATASET_GDM", package = "RGMQL")
79 88
 #' TSS = read_dataset(test_path)
80 89
 #' HM = read_dataset(test_path2)
81 90
 #' 
82 91
 #' ## Given a dataset HM and one called TSS with a sample including 
83
-#' # Transcription Start Site annotations, it searches for those regions of hm 
84
-#' # that are at a minimal distance from a transcription start site (TSS) 
85
-#' # and takes the first/closest one for each TSS, 
86
-#' # provided that such distance is lesser than 1200 bases and joined TSS 
87
-#' # and HM samples are obtained from the same provider (joinby clause).
92
+#' ## Transcription Start Site annotations, it searches for those regions of HM 
93
+#' ## that are at a minimal distance from a transcription start site (TSS) 
94
+#' ## and takes the first/closest one for each TSS, provided that such 
95
+#' ## distance is lesser than 1200 bases and joined TSS and HM samples are 
96
+#' ## obtained from the same provider (joinby clause).
88 97
 #' 
89 98
 #' join_data = merge(TSS, HM, 
90 99
 #' genometric_predicate = list(MD(1), DL(1200)), DF("provider"), 
91 100
 #' region_output = "RIGHT")
92 101
 #'
93
-#' #' # Given a dataset 'hm' and one called 'tss' with a sample including 
94
-#' # Transcription Start Site annotations, it searches for those regions of hm 
95
-#' # that are at a minimal distance from a transcription start site (TSS) 
96
-#' # and takes the first/closest one for each TSS, provided that such distance 
97
-#' # is greater than 12K bases and joined 'tss' and 'hm' samples are obtained 
98
-#' # from the same provider (joinby clause).
102
+#' ## Given a dataset 'HM' and one called 'TSS' with a sample including 
103
+#' ## Transcription Start Site annotations, it searches for those regions of HM 
104
+#' ## that are at a minimal distance from a transcription start site (TSS) 
105
+#' ## and takes the first/closest one for each TSS, provided that such distance 
106
+#' ## is greater than 12K bases and joined 'tss' and 'hm' samples are obtained 
107
+#' ## from the same provider (joinby clause).
99 108
 #' 
100 109
 #' join_data = merge(TSS, HM, 
101 110
 #' genometric_predicate = list(MD(1), DGE(12000), DOWN()), 
Browse code

fix and clean

Simone authored on 06/12/2017 17:47:26
Showing 1 changed files
... ...
@@ -101,7 +101,7 @@ check.DISTAL <- function(value)
101 101
 #' genometric_predicate = list(MD(1), DGE(12000), DOWN()), 
102 102
 #' DF("provider"), region_output = "RIGHT")
103 103
 #'
104
-#' @name DL
104
+#' @name DISTAL-Object
105 105
 #' @aliases DL
106 106
 #' @rdname distal-class
107 107
 #' @export
... ...
@@ -129,7 +129,7 @@ DG <- function(value)
129 129
     return(list)
130 130
 }
131 131
 
132
-#' @name DLE
132
+#' @name DISTAL-Object
133 133
 #' @aliases DLE
134 134
 #' @rdname distal-class
135 135
 #' @export
... ...
@@ -143,7 +143,7 @@ DLE <- function(value)
143 143
     return(list)
144 144
 }
145 145
 
146
-#' @name DGE
146
+#' @name DISTAL-Object
147 147
 #' @aliases DGE
148 148
 #' @rdname distal-class
149 149
 #' @export
... ...
@@ -157,7 +157,7 @@ DGE <- function(value)
157 157
     return(list)
158 158
 }
159 159
 
160
-#' @name MD
160
+#' @name DISTAL-Object
161 161
 #' @aliases MD
162 162
 #' @rdname distal-class
163 163
 #' @export
... ...
@@ -172,7 +172,7 @@ MD <- function(value)
172 172
 }
173 173
 
174 174
 
175
-#' @name UP
175
+#' @name DISTAL-Object
176 176
 #' @aliases UP
177 177
 #' @rdname distal-class
178 178
 #' @export
... ...
@@ -190,7 +190,7 @@ as.character.UP <- function(obj) {
190 190
 }
191 191
 
192 192
 
193
-#' @name DOWN
193
+#' @name DISTAL-Object
194 194
 #' @aliases DOWN
195 195
 #' @rdname distal-class
196 196
 #' @export
Browse code

add group, fixed some function

Simone authored on 05/12/2017 10:34:47
Showing 1 changed files
... ...
@@ -87,7 +87,7 @@ check.DISTAL <- function(value)
87 87
 #' # and HM samples are obtained from the same provider (joinby clause).
88 88
 #' 
89 89
 #' join_data = merge(TSS, HM, 
90
-#' genometric_predicate = list(list(MD(1), DL(1200))), DF("provider"), 
90
+#' genometric_predicate = list(MD(1), DL(1200)), DF("provider"), 
91 91
 #' region_output = "RIGHT")
92 92
 #'
93 93
 #' #' # Given a dataset 'hm' and one called 'tss' with a sample including 
... ...
@@ -98,7 +98,7 @@ check.DISTAL <- function(value)
98 98
 #' # from the same provider (joinby clause).
99 99
 #' 
100 100
 #' join_data = merge(TSS, HM, 
101
-#' genometric_predicate = list(list(MD(1), DGE(12000), DOWN())), 
101
+#' genometric_predicate = list(MD(1), DGE(12000), DOWN()), 
102 102
 #' DF("provider"), region_output = "RIGHT")
103 103
 #'
104 104
 #' @name DL
Browse code

manual and parser

Simone authored on 22/11/2017 23:06:08
Showing 1 changed files
... ...
@@ -101,7 +101,8 @@ check.DISTAL <- function(value)
101 101
 #' genometric_predicate = list(list(MD(1), DGE(12000), DOWN())), 
102 102
 #' DF("provider"), region_output = "RIGHT")
103 103
 #'
104
-#' @name DISTAL
104
+#' @name DL
105
+#' @aliases DL
105 106
 #' @rdname distal-class
106 107
 #' @export
107 108
 #' 
... ...
@@ -114,7 +115,8 @@ DL <- function(value)
114 115
     return(list)
115 116
 }
116 117
 
117
-#' @name DISTAL
118
+#' @name DG
119
+#' @aliases DG
118 120
 #' @rdname distal-class
119 121
 #' @export
120 122
 #' 
... ...
@@ -127,7 +129,8 @@ DG <- function(value)
127 129
     return(list)
128 130
 }
129 131
 
130
-#' @name DISTAL
132
+#' @name DLE
133
+#' @aliases DLE
131 134
 #' @rdname distal-class
132 135
 #' @export
133 136
 #' 
... ...
@@ -140,7 +143,8 @@ DLE <- function(value)
140 143
     return(list)
141 144
 }
142 145
 
143
-#' @name DISTAL
146
+#' @name DGE
147
+#' @aliases DGE
144 148
 #' @rdname distal-class
145 149
 #' @export
146 150
 #' 
... ...
@@ -153,7 +157,8 @@ DGE <- function(value)
153 157
     return(list)
154 158
 }
155 159
 
156
-#' @name DISTAL
160
+#' @name MD
161
+#' @aliases MD
157 162
 #' @rdname distal-class
158 163
 #' @export
159 164
 #' 
... ...
@@ -167,7 +172,8 @@ MD <- function(value)
167 172
 }
168 173
 
169 174
 
170
-#' @name DISTAL
175
+#' @name UP
176
+#' @aliases UP
171 177
 #' @rdname distal-class
172 178
 #' @export
173 179
 #' 
... ...
@@ -184,7 +190,8 @@ as.character.UP <- function(obj) {
184 190
 }
185 191
 
186 192
 
187
-#' @name DISTAL
193
+#' @name DOWN
194
+#' @aliases DOWN
188 195
 #' @rdname distal-class
189 196
 #' @export
190 197
 #' 
Browse code

clean files and folder

Simone authored on 21/11/2017 13:43:55
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,204 @@
1
+##########################
2
+#       DISTAL          #
3
+#########################
4
+
5
+DISTAL <- function(value)
6
+{
7
+    op_list <- list(value = value)
8
+    ## Set the name for the class
9
+    class(op_list) <- "DISTAL"
10
+    return(op_list)
11
+}
12
+
13
+print.DISTAL <- function(obj) {
14
+    print(as.character.DISTAL(obj))
15
+}
16
+
17
+as.character.DISTAL <- function(obj) {
18
+    class <- class(obj)[1]
19
+    val <- obj$value
20
+    c(class,val)
21
+}
22
+
23
+check.DISTAL <- function(value)
24
+{
25
+    if(!is.numeric(value))
26
+        stop("value: is not a numeric")
27
+    
28
+    if(is.numeric(value) && length(value)>1)
29
+        stop("value: no multiple string")
30
+}
31
+#' DISTAL object class constructor
32
+#'
33
+#' This class constructor is used to create instances of DISTAL object
34
+#' to be used in GMQL functions that use genometric predicate parameter
35
+#' requiring distal condition on value
36
+#' 
37
+#' \itemize{
38
+#' \item{DL: It denotes the less distance clause, 
39
+#' which selects all the regions of the experiment such that their distance 
40
+#' from the anchor region is less than 'value' bases.}
41
+#' \item{DLE: It denotes the less distance clause, 
42
+#' which selects all the regions of the experiment such that their distance 
43
+#' from the anchor region is less than, or equal to, 'value' bases.}
44
+#' \item{DG: it denotes the less distance clause, 
45
+#' which selects all the regions of the experiment such that their distance 
46
+#' from the anchor region is greater than 'value' bases. }
47
+#' \item{DGE: It denotes the less distance clause, which selects all the 
48
+#' regions of the experiment such that their distance from the anchor region 
49
+#' is greater than, or equal to, 'value' bases.}
50
+#' \item{MD: It denotes the minimum distance clause, which selects 
51
+#' the 'value' regions of the experiment at minimial distance from the 
52
+#' anchor region.}
53
+#' \item{UP: It denotes the upstream direction of the genome.
54
+#' They are interpreted as predicates that must hold on the regions 
55
+#' of the experiment.
56
+#' UP is true when region of experiment is in the upstream genome 
57
+#' of the anchor region.
58
+#' When this clause is not present, distal conditions apply to both 
59
+#' the directions of the genome.}
60
+#' \item{DOWN: It denotes the downstream direction of the genome.
61
+#' They are interpreted as predicates that must hold on the regions of 
62
+#' the experiment.
63
+#' DOWN is true when region of experiment is in the downstream genome of 
64
+#' the anchor region.
65
+#' When this clause is not present, distal conditions apply to both the 
66
+#' directions of the genome. }
67
+#' }
68
+#' 
69
+#' @param value string identifying distance between genomic regions 
70
+#' in base pairs, 
71
+#'
72
+#' @return distal object
73
+#' 
74
+#' @examples
75
+#' 
76
+#' init_gmql()
77
+#' test_path <- system.file("example","DATASET",package = "RGMQL")
78
+#' test_path2 <- system.file("example","DATASET_GDM",package = "RGMQL")
79
+#' TSS = read_dataset(test_path)
80
+#' HM = read_dataset(test_path2)
81
+#' 
82
+#' ## Given a dataset HM and one called TSS with a sample including 
83
+#' # Transcription Start Site annotations, it searches for those regions of hm 
84
+#' # that are at a minimal distance from a transcription start site (TSS) 
85
+#' # and takes the first/closest one for each TSS, 
86
+#' # provided that such distance is lesser than 1200 bases and joined TSS 
87
+#' # and HM samples are obtained from the same provider (joinby clause).
88
+#' 
89
+#' join_data = merge(TSS, HM, 
90
+#' genometric_predicate = list(list(MD(1), DL(1200))), DF("provider"), 
91
+#' region_output = "RIGHT")
92
+#'
93
+#' #' # Given a dataset 'hm' and one called 'tss' with a sample including 
94
+#' # Transcription Start Site annotations, it searches for those regions of hm 
95
+#' # that are at a minimal distance from a transcription start site (TSS) 
96
+#' # and takes the first/closest one for each TSS, provided that such distance 
97
+#' # is greater than 12K bases and joined 'tss' and 'hm' samples are obtained 
98
+#' # from the same provider (joinby clause).