R-api client
The MOLGENIS R API client allows you to retrieve, create, update and delete entities from within the R environment.
Just add
at the top of your script and you can connect to a MOLGENIS server. Typically the first thing you do is login and the last thing is logout.
NOTE: For https connections use
NOTE: The MOLGENIS R-api client supports up to R-version 3.2.x
Overview example
login
Login to the MOLGENIS REST API
logout
Logout from the MOLGENIS REST API and destroy the session.
##get
Retrieves entities and returns the result in a dataframe.
entity
The entity name
yes
q
Query string in rsql/fiql format (see below)
No
NULL
start
The index of the thirst row to return
No
0
num
The maximum number of rows to return (max 10000)
No
1000
attributes
Vector of attributenames(columns) to return
No
All attributes
sortColumn
attributeName of the column to sort on
No
NULL
sortOrder
sort order, 'ASC' of 'DESC'
No
NULL
Supported RSQL/FIQL query operators (see https://github.com/jirutka/rsql-parser)
Logical AND
;
or and
Logical OR
,
or or
Group
(
and )
Equal to
==
Less then
=lt=
or <
Less then or equal to
=le=
or <=
Greater than
=gt=
or >
Greater tha or equal to
=ge=
or >=
Argument can be a single value, or multiple values in parenthesis separated by comma. Value that doesn’t contain any reserved character or a white space can be unquoted, other arguments must be enclosed in single or double quotes.
Examples
## add ``` molgenis.add(entity, ...) ```
Creates a new instance of an entity (i.e. a new row of the entity data table) and returns the id.
entity
The entity name of the entity to create
yes
...
Var arg list of attribute names and values
yes
Example
addAll
Creates new instances of an entity (i.e. adds new rows to the entity data table) and returns the ids.
entity
The entity name of the entity to create
yes
rows
data frame where each row represents an entity instance
yes
Example
## update ``` molgenis.update(entity, id, ...) ```
Updates un existing entity
entity
The entity name
yes
id
The id of the entity
Yes
...
Var arg list of attribute names and values
yes
Example
delete
Deletes an entity.
entity
The entity name
yes
id
The id of the entity
Yes
Example
deleteList
Deletes a list of entities in an entityType.
entity
The entityType name
yes
rows
List with ids of the rows
yes
Example
getEntityMetaData
Gets the entity metadata as list.
Example
getAttributeMetaData
Gets attribute metadata as list.
entity
The entity name
yes
attribute
The name of the attribute
Yes
Example
Last updated