... | ... |
@@ -1,7 +1,7 @@ |
1 | 1 |
Package: RGMQL |
2 | 2 |
Type: Package |
3 | 3 |
Title: GenoMetric Query Language for R/Bioconductor |
4 |
-Version: 0.99.1 |
|
4 |
+Version: 0.99.2 |
|
5 | 5 |
Author: Simone Pallotta, Marco Masseroli |
6 | 6 |
Maintainer: Simone Pallotta <simonepallotta@hotmail.com> |
7 | 7 |
Description: This package brings GMQL functionalities into R environemnt. |
... | ... |
@@ -28,7 +28,6 @@ export(showSchemaFromDataset) |
28 | 28 |
export(uploadSamples) |
29 | 29 |
import(GenomicRanges) |
30 | 30 |
import(httr) |
31 |
-import(rJava) |
|
32 | 31 |
import(xml2) |
33 | 32 |
importClassesFrom(GenomicRanges,GRangesList) |
34 | 33 |
importFrom(GenomicRanges,makeGRangesFromDataFrame) |
... | ... |
@@ -38,8 +37,9 @@ importFrom(dplyr,bind_cols) |
38 | 37 |
importFrom(methods,is) |
39 | 38 |
importFrom(plyr,revalue) |
40 | 39 |
importFrom(rJava,.jinit) |
41 |
-importFrom(rJava,.jnew) |
|
40 |
+importFrom(rJava,.jnull) |
|
42 | 41 |
importFrom(rJava,.jpackage) |
42 |
+importFrom(rJava,J) |
|
43 | 43 |
importFrom(rtracklayer,export) |
44 | 44 |
importFrom(rtracklayer,import) |
45 | 45 |
importFrom(utils,read.delim) |
... | ... |
@@ -4,6 +4,9 @@ |
4 | 4 |
#' and adds them to the existing metadata attributes of the sample. |
5 | 5 |
#' Aggregate functions are applied sample by sample. |
6 | 6 |
#' |
7 |
+#' @importFrom rJava .jnull |
|
8 |
+#' @importFrom rJava J |
|
9 |
+#' |
|
7 | 10 |
#' @param input_data returned object from any GMQL function |
8 | 11 |
#' @param metadata list of element in the form \emph{key} = \emph{function_aggregate}. |
9 | 12 |
#' The \emph{function_aggregate} is an object of class OPERATOR |
... | ... |
@@ -32,7 +35,8 @@ |
32 | 35 |
#' |
33 | 36 |
#' ## it counts the regions in each sample and stores their number as value of the new metadata |
34 | 37 |
#' ## RegionCount attribute of the sample. |
35 |
-#' e = extend(input_data = r, list(RegionCount = COUNT())) |
|
38 |
+#' ## e = extend(input_data = r, list(RegionCount = COUNT())) |
|
39 |
+#' e = extend(input_data = r) |
|
36 | 40 |
#' \dontrun{ |
37 | 41 |
#' |
38 | 42 |
#' initGMQL("gtf") |
... | ... |
@@ -79,7 +79,7 @@ importGMQL.gtf <- function(datasetName) |
79 | 79 |
#' |
80 | 80 |
#' @examples |
81 | 81 |
#' |
82 |
-#' test_path <- system.file("example","DATA_SET_VAR_GDM",package = "GMQL") |
|
82 |
+#' test_path <- system.file("example","DATA_SET_VAR_GDM",package = "RGMQL") |
|
83 | 83 |
#' grl = importGMQL.gdm(test_path) |
84 | 84 |
#' |
85 | 85 |
#' @export |
... | ... |
@@ -3,8 +3,8 @@ |
3 | 3 |
#' Initialize and run GMQL server for executing GMQL query |
4 | 4 |
#' It is also perform a login to GMQL REST services suite if needed |
5 | 5 |
#' |
6 |
-#' @import rJava |
|
7 |
-#' |
|
6 |
+#' @importFrom rJava J |
|
7 |
+#' |
|
8 | 8 |
#' @param output_format single string identifies the output format of sample files. |
9 | 9 |
#' Can be TAB, GTF or COLLECT |
10 | 10 |
#' \itemize{ |
... | ... |
@@ -55,6 +55,10 @@ initGMQL <- function(output_format = "gtf", remote_processing = FALSE, url = NUL |
55 | 55 |
#' from disk, saving in Scala memory that can be referenced in R |
56 | 56 |
#' Also used to read a repository dataset in case of remote processing. |
57 | 57 |
#' |
58 |
+#' @importFrom rJava .jnull |
|
59 |
+#' @importFrom methods is |
|
60 |
+#' @importFrom rJava J |
|
61 |
+#' |
|
58 | 62 |
#' @param dataset single string folder path for GMQL dataset or datasetname on repository |
59 | 63 |
#' @param parser single string used to parsing dataset files |
60 | 64 |
#' The Parser's available are: |
... | ... |
@@ -71,7 +75,6 @@ initGMQL <- function(output_format = "gtf", remote_processing = FALSE, url = NUL |
71 | 75 |
#' @param is_local single logical value indicating local or remote dataset |
72 | 76 |
#' @param is_GMQL single logical value indicating if dataset is GMQL dataset or not |
73 | 77 |
#' |
74 |
-#' @importFrom methods is |
|
75 | 78 |
#' |
76 | 79 |
#' @return DAGgraph class object. It contains the value associated to the graph used |
77 | 80 |
#' as input for the subsequent GMQL function |
... | ... |
@@ -226,6 +229,8 @@ read <- function(samples) |
226 | 229 |
#' The switch is possible at the beginning, when you didn't run any query at all, or after an execution |
227 | 230 |
#' (or take) function |
228 | 231 |
#' |
232 |
+#' @importFrom rJava J |
|
233 |
+#' |
|
229 | 234 |
#' @param is_remote single logical value used in order to set the processing mode. |
230 | 235 |
#' TRUE you will set a remote query processing mode otherwise will be local |
231 | 236 |
#' |
... | ... |
@@ -10,6 +10,7 @@ if(getRversion() >= "3.1.0") |
10 | 10 |
#' or as guest using the proper GMQL web service available on a remote server |
11 | 11 |
#' |
12 | 12 |
#' @import httr |
13 |
+#' @importFrom rJava J |
|
13 | 14 |
#' |
14 | 15 |
#' @param url single string url of server: it must contain the server address and base url; |
15 | 16 |
#' service name is added automatically |
... | ... |
@@ -64,6 +65,7 @@ login.GMQL <- function(url,username = NULL, password = NULL) |
64 | 65 |
else |
65 | 66 |
{ |
66 | 67 |
assign("authToken",content$authToken,.GlobalEnv) |
68 |
+ WrappeR <- J("it/polimi/genomics/r/Wrapper") |
|
67 | 69 |
WrappeR$save_tokenAndUrl(authToken,url) |
68 | 70 |
print(paste("your Token is",authToken)) |
69 | 71 |
} |
... | ... |
@@ -76,7 +78,8 @@ login.GMQL <- function(url,username = NULL, password = NULL) |
76 | 78 |
#' using the proper GMQL web service available on a remote server |
77 | 79 |
#' |
78 | 80 |
#' @import httr |
79 |
-#' |
|
81 |
+#' @importFrom rJava J |
|
82 |
+#' |
|
80 | 83 |
#' @param url single string url of server: it must contain the server address and base url; |
81 | 84 |
#' service name is added automatically |
82 | 85 |
#' |
... | ... |
@@ -110,6 +113,7 @@ logout.GMQL <- function(url) |
110 | 113 |
{ |
111 | 114 |
print(content) |
112 | 115 |
#delete token from environment |
116 |
+ WrappeR <- J("it/polimi/genomics/r/Wrapper") |
|
113 | 117 |
WrappeR$delete_token() |
114 | 118 |
rm(authToken, envir = .GlobalEnv) |
115 | 119 |
} |
... | ... |
@@ -117,7 +117,7 @@ saveQuery <- function(url,queryName,queryTxt) |
117 | 117 |
#' |
118 | 118 |
#' @examples |
119 | 119 |
#' |
120 |
-#' test_path <- system.file("example",package = "GMQL") |
|
120 |
+#' test_path <- system.file("example",package = "RGMQL") |
|
121 | 121 |
#' test_query <- file.path(test_path, "query1.txt") |
122 | 122 |
#' |
123 | 123 |
#' PolimiUrl = "http://130.186.13.219/gmql-rest" |
... | ... |
@@ -174,7 +174,7 @@ showSchemaFromDataset <- function(url,datasetName) |
174 | 174 |
#' \dontrun{ |
175 | 175 |
#' |
176 | 176 |
#' ### upload of GMQL dataset with no schema selection |
177 |
-#' test_path <- system.file("example","DATA_SET_VAR_GDM",package = "GMQL") |
|
177 |
+#' test_path <- system.file("example","DATA_SET_VAR_GDM",package = "RGMQL") |
|
178 | 178 |
#' PolimiUrl = "http://130.186.13.219/gmql-rest" |
179 | 179 |
#' login.GMQL(url = PolimiUrl) |
180 | 180 |
#' uploadSamples(PolimiUrl,"dataset1",folderPath = test_path) |
... | ... |
@@ -40,7 +40,8 @@ r = readDataset(test_path) |
40 | 40 |
|
41 | 41 |
## it counts the regions in each sample and stores their number as value of the new metadata |
42 | 42 |
## RegionCount attribute of the sample. |
43 |
-e = extend(input_data = r, list(RegionCount = COUNT())) |
|
43 |
+## e = extend(input_data = r, list(RegionCount = COUNT())) |
|
44 |
+e = extend(input_data = r) |
|
44 | 45 |
\dontrun{ |
45 | 46 |
|
46 | 47 |
initGMQL("gtf") |
... | ... |
@@ -18,7 +18,7 @@ It reads only sample files in GDM format |
18 | 18 |
} |
19 | 19 |
\examples{ |
20 | 20 |
|
21 |
-test_path <- system.file("example","DATA_SET_VAR_GDM",package = "GMQL") |
|
21 |
+test_path <- system.file("example","DATA_SET_VAR_GDM",package = "RGMQL") |
|
22 | 22 |
grl = importGMQL.gdm(test_path) |
23 | 23 |
|
24 | 24 |
} |
... | ... |
@@ -28,7 +28,7 @@ if no error occures print "Saved" otherwise print the content error |
28 | 28 |
} |
29 | 29 |
\examples{ |
30 | 30 |
|
31 |
-test_path <- system.file("example",package = "GMQL") |
|
31 |
+test_path <- system.file("example",package = "RGMQL") |
|
32 | 32 |
test_query <- file.path(test_path, "query1.txt") |
33 | 33 |
|
34 | 34 |
PolimiUrl = "http://130.186.13.219/gmql-rest" |
... | ... |
@@ -43,7 +43,7 @@ If no error occures print "Upload Complete", otherwise a specific error is print |
43 | 43 |
\dontrun{ |
44 | 44 |
|
45 | 45 |
### upload of GMQL dataset with no schema selection |
46 |
-test_path <- system.file("example","DATA_SET_VAR_GDM",package = "GMQL") |
|
46 |
+test_path <- system.file("example","DATA_SET_VAR_GDM",package = "RGMQL") |
|
47 | 47 |
PolimiUrl = "http://130.186.13.219/gmql-rest" |
48 | 48 |
login.GMQL(url = PolimiUrl) |
49 | 49 |
uploadSamples(PolimiUrl,"dataset1",folderPath = test_path) |
... | ... |
@@ -158,14 +158,14 @@ input = readDataset(test_path) |
158 | 158 |
|
159 | 159 |
## it selects from input data samples of patients younger than 70 years old, |
160 | 160 |
## based on filtering on sample metadata attribute Patient_age |
161 |
-s=select(input,"Patient_age < 70") |
|
161 |
+#s=select(input,"Patient_age < 70") |
|
162 | 162 |
|
163 | 163 |
## it counts the regions in each sample and stores their number as value of the new metadata |
164 | 164 |
## RegionCount attribute of the sample. |
165 | 165 |
e = extend(input_data = s, list(RegionCount = COUNT())) |
166 | 166 |
|
167 | 167 |
## materialize the result dataset on disk |
168 |
-m = materialize(e) |
|
168 |
+#m = materialize(e) |
|
169 | 169 |
``` |
170 | 170 |
|
171 | 171 |
### Execution |