run_query: Run a GMQL query

Description Usage Arguments Details Value Examples

View source: R/web-services.R

Description

It runs a GMQL query into repository taken from file or inserted as text string, using the proper GMQL web service available on a remote server

Usage

1
2
3
run_query(url, queryName, query, output_gtf = TRUE)

run_query_fromfile(url, filePath, output_gtf = TRUE)

Arguments

url

string url of server: It must contain the server address and base url; service name is added automatically

queryName

string name of the GMQL query file

query

string text of the GMQL query

output_gtf

logical value indicating file format used for storing samples generated by the query. The possiblities are:

  • GTF

  • TAB

filePath

string path of a txt file containing a GMQL query

Details

If error occurs, a specific error is printed

Value

None

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 

## Login to GMQL REST services suite as guest

remote_url = "http://www.gmql.eu/gmql-rest/"
login_gmql(remote_url)

## Run query as string input parameter
## NOTE: not very suitable for long queries

run_query(remote_url, "query_1", "DATASET = SELECT() Example_Dataset1;
    MATERIALIZE DATASET INTO RESULT_DS;", output_gtf = FALSE)

## With system.file() this statement defines the path to the folder 
## "example" of the package "RGMQL", and then it executes the query 
## written in the text file "query1.txt"

test_path <- system.file("example", package = "RGMQL")
test_query <- file.path(test_path, "query1.txt")
run_query_fromfile(remote_url, test_query, output_gtf = FALSE)

## End(Not run)

RGMQL documentation built on Nov. 8, 2020, 5:59 p.m.