Title: | NDEx R client library |
---|---|
Description: | This package offers an interface to NDEx servers, e.g. the public server at http://ndexbio.org/. It can retrieve and save networks via the API. Networks are offered as RCX object and as igraph representation. |
Authors: | Florian Auer [cre, aut] , Frank Kramer [ctb], Alex Ishkin [ctb], Dexter Pratt [ctb] |
Maintainer: | Florian Auer <[email protected]> |
License: | BSD_3_clause + file LICENSE |
Version: | 1.29.0 |
Built: | 2024-12-18 03:23:24 UTC |
Source: | https://github.com/bioc/ndexr |
The ndexr package offers an interface to NDEx servers, e.g. the public server at http://ndexbio.org/. It can retrieve and save networks via the API. Networks are offered as RCX objects.
Package: | ndexr |
Type: | Package |
Version: | 1.19.2 |
Date: | 2016-12-02 |
License: | BSD_3_clause |
Florian Auer [email protected]
Zaynab Hammoud [email protected]
Frank Kramer [email protected]
## Not run: require(ndexr) ## login to the NDEx server ndexcon <- ndex_connect("username", "password") ## search the networks for "EGFR" networks <- ndex_find_networks(ndexcon, "EGFR") head(networks, 3) ## UUID of the first search result networkId <- networks[1,'externalId'] networkId ## get summary of the network ndex_network_get_summary(ndexcon, networkId) ## get the entire network as RCX object rcx <- ndex_get_network(ndexcon, networkId) ## show the content (aspects) of the network rcx$metaData ## visualize the network with RCX RCX::visualize(rcx) ## upload network as a new network to the NDEx server networkId <- ndex_create_network(ndexcon, rcx) ## do some other fancy stuff with the network, then ## update the network on the server networkId <- ndex_update_network(ndexcon, rcx) ## realize, you did bad things to the poor network, so better ## delete it on the server ndex_delete_network(ndexcon, networkId) ## End(Not run)
## Not run: require(ndexr) ## login to the NDEx server ndexcon <- ndex_connect("username", "password") ## search the networks for "EGFR" networks <- ndex_find_networks(ndexcon, "EGFR") head(networks, 3) ## UUID of the first search result networkId <- networks[1,'externalId'] networkId ## get summary of the network ndex_network_get_summary(ndexcon, networkId) ## get the entire network as RCX object rcx <- ndex_get_network(ndexcon, networkId) ## show the content (aspects) of the network rcx$metaData ## visualize the network with RCX RCX::visualize(rcx) ## upload network as a new network to the NDEx server networkId <- ndex_create_network(ndexcon, rcx) ## do some other fancy stuff with the network, then ## update the network on the server networkId <- ndex_update_network(ndexcon, rcx) ## realize, you did bad things to the poor network, so better ## delete it on the server ndex_delete_network(ndexcon, networkId) ## End(Not run)
This nested list contains the url and methods for accessing the NDEx server via its REST full api. It contains specifications for NDEx server api version 1.3 and 2.0. The default api is specified by 'defaultVersion'. If possible, the version 2.0 should be used. Own configurations must contain a 'version' entry!
ndex_config
ndex_config
An object of class list
of length 4.
Nested list resembling the NDEx server REST API structure
names(ndex_config$Version_2.0)
names(ndex_config$Version_2.0)
This function creates an NDExConnection which stores options and authentication details. It is a parameter required for most of the other ndexr functions. If username and password are missing an anonymous connection is created, which already offers most of the retrieval functionality.
ndex_connect( username, password, host = ndexConf$connection$host, apiPath = ndexConf$connection$api, ndexConf = ndex_config, verbose = FALSE )
ndex_connect( username, password, host = ndexConf$connection$host, apiPath = ndexConf$connection$api, ndexConf = ndex_config, verbose = FALSE )
username |
character (optional); username |
password |
character (optional); password |
host |
character (default: ndexConf$connection$host); Host address of NDEx server; By default the url set in ndexConf$defaults$connection$host is used. ("http://www.ndexbio.org") |
apiPath |
character (default: ndexConf$connection$api); URL path of the REST api; By default the url set in ndexConf$defaults$connection$api is used. ("/v2" for NDEx version 2.0, "/rest" for NDEx version 1.3) |
ndexConf |
config object (nested list, default: ndex_config); Configuration of NDEx REST server; Set in ndex_config (set in ndex_api_config.r or ndex_api_config.yml): It contains specifications for NDEx server api version 1.3 and 2.0. The default api is specified by 'defaultVersion' |
verbose |
logical (optional); whether to print out extended feedback |
returns object of class NDExConnection which stores options, authentication and api configuration if successfull, NULL otherwise
## log in anonymously ndexcon = ndex_connect() ## same as above with extended feedback ndexcon = ndex_connect(verbose=TRUE) ## Not run: ## log in with credentials ndexcon = ndex_connect('user','password') ## running some NDEx server locally ndexcon = ndex_connect(host='localhost:8765') ## manually change the api and connection configuration ndexcon = ndex_connect(ndexConf=ndex_config$Version_2.0) ## End(Not run)
## log in anonymously ndexcon = ndex_connect() ## same as above with extended feedback ndexcon = ndex_connect(verbose=TRUE) ## Not run: ## log in with credentials ndexcon = ndex_connect('user','password') ## running some NDEx server locally ndexcon = ndex_connect(host='localhost:8765') ## manually change the api and connection configuration ndexcon = ndex_connect(ndexConf=ndex_config$Version_2.0) ## End(Not run)
Create a group owned by the authenticated user based on the supplied group JSON object.
ndex_create_group(ndexcon, groupName, image, website, description, properties)
ndex_create_group(ndexcon, groupName, image, website, description, properties)
ndexcon |
object of class NDExConnection linkndex_connect |
groupName |
character; name of the new graoup |
image |
character (optional); URL of the account owner's image |
website |
character (optional); URL of the account owner's web site |
description |
character (optional); Short description of this user |
properties |
list (optional); additional properties for the group |
url (including the UUID) of the newly created group
POST: ndex_config$api$group$create
Requires an authorized user! (ndex_connect with credentials)
Compatible to NDEx server version 2.0
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') # groupURL = ndex_create_group(ndexcon, 'SomeGroupName') ## [1] "http://public.ndexbio.org/v2/group/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" # groupURL = ndex_create_group(ndexcon, 'SomeGroupName', # image='http://bit.ly/1M3NoQZ', # website='www.gidf.com', # description='A very special group..') NULL
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') # groupURL = ndex_create_group(ndexcon, 'SomeGroupName') ## [1] "http://public.ndexbio.org/v2/group/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" # groupURL = ndex_create_group(ndexcon, 'SomeGroupName', # image='http://bit.ly/1M3NoQZ', # website='www.gidf.com', # description='A very special group..') NULL
This method creates a new network on the NDEx server from the given RCX object
ndex_create_network(ndexcon, rcx)
ndex_create_network(ndexcon, rcx)
ndexcon |
object of class NDExConnection linkndex_connect |
rcx |
|
Note: In future 'ndexr' uses the RCX-object from the corresponding package to handle the networks!
UUID of the newly created network
POST (multipart/form-data): ndex_config$api$network$create$url data: CXNetworkStream = data
Requires an authorized user! (ndex_connect with credentials)
Compatible to NDEx server version 1.3 and 2.0
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find a network and get its UUID # networks = ndex_find_networks(ndexcon,"p53", "nci-pid") # networkId = networks[1,"externalId"] ## Get the network data # rcx = ndex_get_network(ndexcon, networkId) ## Do some changes to rcx.. ## and create a new network # networkId = ndex_create_network(ndexcon, rcx) NULL
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find a network and get its UUID # networks = ndex_find_networks(ndexcon,"p53", "nci-pid") # networkId = networks[1,"externalId"] ## Get the network data # rcx = ndex_get_network(ndexcon, networkId) ## Do some changes to rcx.. ## and create a new network # networkId = ndex_create_network(ndexcon, rcx) NULL
Create a new user based on a JSON object specifying username, password, and emailAddress. Username and emailAddress must be unique in the database. If email verification is turned on on the server, this call returns code 220 (Accepted), the location field in the header has the URL to check the status of the newly created user account. If email verification is turned on off on the server, this function returns 201 (Created). The URL for getting the newly created user is in the response body and the Location header.
ndex_create_user( ndexcon, userName, password, emailAddress, isIndividual = TRUE, displayName, firstName, lastName, image, website, description, verbose = FALSE )
ndex_create_user( ndexcon, userName, password, emailAddress, isIndividual = TRUE, displayName, firstName, lastName, image, website, description, verbose = FALSE )
ndexcon |
object of class NDExConnection linkndex_connect |
userName |
character; name of the new user |
password |
character; password for the new user |
emailAddress |
character (optional); email address (used for verification if enabled) |
isIndividual |
boolean (default: TRUE); True if this account is for an individual user. False means this account is for an organization or a project etc. |
displayName |
character (optional); Display name of this account, only applied to non-individual accounts. |
firstName |
character (optional); Account owner's first name, only applies to individual accounts. |
lastName |
character (optional); Account owner's last name, only appliies to individual accounts. |
image |
character (optional); URL of the account owner's image. |
website |
character (optional); URL of the account owner's web site |
description |
character (optional); Short description of this user. |
verbose |
logical (optional); whether to print out extended feedback |
UUID of the newly created user if email verification is turned off, else an empty string ("")
GET: ndex_config$api$user$create
Requires an authorized user! (ndex_connect with credentials)
Compatible to NDEx server version 2.0
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Create a new user # userId = ndex_create_user(ndexcon, 'SomeUserName', 'SecretPassword', '[email protected]') ## [1] "uuuuuuuu-ssss-eeee-rrrr-123456789abc" # userId = ndex_create_user(ndexcon, 'ASpecialProject', 'SecretPassword', # '[email protected]', isIndividual=TRUE, # displayName='Area51', firstName='John', lastName='Doe', # website='www.gidf.com', description='Nothing to see here..') NULL
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Create a new user # userId = ndex_create_user(ndexcon, 'SomeUserName', 'SecretPassword', '[email protected]') ## [1] "uuuuuuuu-ssss-eeee-rrrr-123456789abc" # userId = ndex_create_user(ndexcon, 'ASpecialProject', 'SecretPassword', # '[email protected]', isIndividual=TRUE, # displayName='Area51', firstName='John', lastName='Doe', # website='www.gidf.com', description='Nothing to see here..') NULL
Delete the group specified by groupId
ndex_delete_group(ndexcon, groupId)
ndex_delete_group(ndexcon, groupId)
ndexcon |
object of class NDExConnection linkndex_connect |
groupId |
character; unique ID (UUID) of the group |
NULL if successfull, else an error is thrown
DELETE: ndex_config$api$group$delete
Requires an authorized user! (ndex_connect with credentials)
Compatible to NDEx server version 2.0
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find user and get its id # user = ndex_find_user_byName(ndexcon, 'MyAccountName') # userId = user$externalId ## Find the user's groups and get one group id # groups = ndex_user_list_groups(ndexcon, userId) # groupId = groups[1,"externalId"] #ndex_delete_group(ndexcon,groupId) NULL
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find user and get its id # user = ndex_find_user_byName(ndexcon, 'MyAccountName') # userId = user$externalId ## Find the user's groups and get one group id # groups = ndex_user_list_groups(ndexcon, userId) # groupId = groups[1,"externalId"] #ndex_delete_group(ndexcon,groupId) NULL
Delete a network
ndex_delete_network(ndexcon, networkId)
ndex_delete_network(ndexcon, networkId)
ndexcon |
object of class NDExConnection linkndex_connect |
networkId |
unique ID of the network |
NULL on success; Error else
DELETE: ndex_config$api$network$delete
Requires an authorized user! (ndex_connect with credentials)
Compatible to NDEx server version 1.3 and 2.0
## Establish a server connections with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find a network and get its UUID # networks = ndex_find_networks(ndexcon,"p53", "nci-pid") # networkId = networks[1,"externalId"] ## Delete the network # ndex_delete_network(ndexcon, networkId) NULL
## Establish a server connections with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find a network and get its UUID # networks = ndex_find_networks(ndexcon,"p53", "nci-pid") # networkId = networks[1,"externalId"] ## Delete the network # ndex_delete_network(ndexcon, networkId) NULL
Deletes the authenticated user, removing any other objects in the database that depend on the user
ndex_delete_user(ndexcon, userId)
ndex_delete_user(ndexcon, userId)
ndexcon |
object of class NDExConnection linkndex_connect |
userId |
character; unique ID (UUID) of the user |
NULL if successfull, else an error is thrown
GET: ndex_config$api$user$delete
Requires an authorized user! (ndex_connect with credentials)
Compatible to NDEx server version 2.0
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find user and get its id # user = ndex_find_user_byName(ndexcon, 'SomeUserName') # userId = user$externalId ## Delete user # ndex_delete_user(ndexcon, userId) NULL
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find user and get its id # user = ndex_find_user_byName(ndexcon, 'SomeUserName') # userId = user$externalId ## Delete user # ndex_delete_user(ndexcon, userId) NULL
Returns a SearchResult object which contains an array of Group objects
ndex_find_groups(ndexcon, searchString = "", start, size)
ndex_find_groups(ndexcon, searchString = "", start, size)
ndexcon |
object of class NDExConnection linkndex_connect |
searchString |
string by which to search |
start |
integer (optional); specifies that the result is the nth page of the requested data. The default value is 0 |
size |
integer (optional); specifies the number of data items in each page. The default value is 100 |
Data frame with group information; NULL if no groups are found.
GET: ndex_config$api$search$user
Compatible to NDEx server version 1.3 and 2.0
Search strings may be structured
## Establish a server connection ndexcon = ndex_connect() ## Find a group groups = ndex_find_groups(ndexcon,"Ideker Lab") names(groups) ## [1] "properties" "groupName" "image" "website" "description" ## [6] "externalId" "isDeleted" "modificationTime" "creationTime"
## Establish a server connection ndexcon = ndex_connect() ## Find a group groups = ndex_find_groups(ndexcon,"Ideker Lab") names(groups) ## [1] "properties" "groupName" "image" "website" "description" ## [6] "externalId" "isDeleted" "modificationTime" "creationTime"
This functions searches the public networks on an NDEx server for networks containing the supplied search string. T his search can be limited to certain accounts as well as in length.
ndex_find_networks(ndexcon, searchString = "", accountName, start, size)
ndex_find_networks(ndexcon, searchString = "", accountName, start, size)
ndexcon |
object of class NDExConnection linkndex_connect |
searchString |
string by which to search |
accountName |
string (optional); constrain search to networks administered by this account |
start |
integer (optional); specifies that the result is the nth page of the requested data. The default value is 0 |
size |
integer (optional); specifies the number of data items in each page. The default value is 100 |
Data frame with network information: ID, name, whether it is public, edge and node count; source and format of network. NULL if no networks are found.
GET: ndex_config$api$search$network$search
Compatible to NDEx server version 1.3 and 2.0
Search strings may be structured
ndexcon = ndex_connect() networks = ndex_find_networks(ndexcon,"p53")
ndexcon = ndex_connect() networks = ndex_find_networks(ndexcon,"p53")
Get User By UUID
ndex_find_user_byId(ndexcon, userId)
ndex_find_user_byId(ndexcon, userId)
ndexcon |
object of class NDExConnection linkndex_connect |
userId |
character; unique ID (UUID) of the user |
list of properties describing the user (externalId, emailAddress, website, etc.). Throws error (404) if user isn't found!
GET: ndex_config$api$user$get$byId
Compatible to NDEx server version 2.0
## Establish a server connection ndexcon = ndex_connect() ## Find user by name user = ndex_find_user_byName(ndexcon, 'ndextutorials') ## Find user by Id user = ndex_find_user_byId(ndexcon, user$externalId)
## Establish a server connection ndexcon = ndex_connect() ## Find user by name user = ndex_find_user_byName(ndexcon, 'ndextutorials') ## Find user by Id user = ndex_find_user_byId(ndexcon, user$externalId)
Get User By Name
ndex_find_user_byName(ndexcon, name)
ndex_find_user_byName(ndexcon, name)
ndexcon |
object of class NDExConnection linkndex_connect |
name |
name of the user |
list of properties describing the user (externalId, emailAddress, website, etc.). Throws error (404) if user isn't found!
GET: ndex_config$api$user$get$byName
Compatible to NDEx server version 2.0
## Establish a server connection ndexcon = ndex_connect() ## Find user by name user = ndex_find_user_byName(ndexcon, 'ndextutorials')
## Establish a server connection ndexcon = ndex_connect() ## Find user by name user = ndex_find_user_byName(ndexcon, 'ndextutorials')
Returns a SearchResult object which contains an array of User objects
ndex_find_users(ndexcon, searchString = "", start, size)
ndex_find_users(ndexcon, searchString = "", start, size)
ndexcon |
object of class NDExConnection linkndex_connect |
searchString |
string by which to search |
start |
integer (optional); specifies that the result is the nth page of the requested data. The default value is 0 |
size |
integer (optional); specifies the number of data items in each page. The default value is 100 |
Data frame with user information; NULL if no user are found.
GET: ndex_config$api$search$user
Compatible to NDEx server version 1.3 and 2.0
Search strings may be structured
## Establish a server connection ndexcon = ndex_connect() ## Find a user users = ndex_find_users(ndexcon,"ndextutorials") names(users) ## [1] "properties" "displayName" "isIndividual" "userName" "password" ## [6] "isVerified" "firstName" "lastName" "diskQuota" "diskUsed" ##[11] "emailAddress" "image" "website" "description" "externalId" ##[16] "isDeleted" "modificationTime" "creationTime"
## Establish a server connection ndexcon = ndex_connect() ## Find a user users = ndex_find_users(ndexcon,"ndextutorials") names(users) ## [1] "properties" "displayName" "isIndividual" "userName" "password" ## [6] "isVerified" "firstName" "lastName" "diskQuota" "diskUsed" ##[11] "emailAddress" "image" "website" "description" "externalId" ##[16] "isDeleted" "modificationTime" "creationTime"
Get a Group
ndex_get_group(ndexcon, groupId)
ndex_get_group(ndexcon, groupId)
ndexcon |
object of class NDExConnection linkndex_connect |
groupId |
character; unique ID (UUID) of the group |
list of properties describing the group (externalId, emailAddress, website, etc.). Throws error (404) if group isn't found!
GET: ndex_config$api$group$get
Compatible to NDEx server version 2.0
## Establish a server connection ndexcon = ndex_connect() ## Find a group groups = ndex_find_groups(ndexcon,"Ideker Lab") groupId = groups[1,"externalId"] ## Get group information group = ndex_get_group(ndexcon, groupId)
## Establish a server connection ndexcon = ndex_connect() ## Find a group groups = ndex_find_groups(ndexcon,"Ideker Lab") groupId = groups[1,"externalId"] ## Get group information group = ndex_get_group(ndexcon, groupId)
Returns the specified network as RCX-object.
ndex_get_network(ndexcon, networkId)
ndex_get_network(ndexcon, networkId)
ndexcon |
object of class NDExConnection linkndex_connect |
networkId |
unique ID of the network |
Note: In future 'ndexr' uses the RCX-object from the corresponding package to handle the networks!
This is performed as a monolithic operation, so it is typically advisable for applications to first use the getNetworkSummary method to check the node and edge counts for a network before retrieving the network. Uses getEdges (this procedure will return complete network with all elements) Nodes use primary ID of the base term ('represents' element) Edges use primary ID of the base term ('predicate', or 'p' element) Mapping table for the nodes is retrieved ('alias' and 'related' terms) to facilitate conversions/data mapping
RCX-object
object
GET: ndex_config$api$network$get
Compatible to NDEx server version 1.3 and 2.0
## Establish a server connection ndexcon = ndex_connect() ## Find a network and get its UUID networks = ndex_find_networks(ndexcon,"p53", "nci-pid") networkId = networks[1,"externalId"] ## Get the network data rcx = ndex_get_network(ndexcon, networkId)
## Establish a server connection ndexcon = ndex_connect() ## Find a network and get its UUID networks = ndex_find_networks(ndexcon,"p53", "nci-pid") networkId = networks[1,"externalId"] ## Get the network data rcx = ndex_get_network(ndexcon, networkId)
Removes the member from the group
ndex_group_delete_membership(ndexcon, groupId, userId)
ndex_group_delete_membership(ndexcon, groupId, userId)
ndexcon |
object of class NDExConnection linkndex_connect |
groupId |
character; unique ID (UUID) of the group |
userId |
character; unique ID (UUID) of the user |
Empty string ("") on success, else error
DELETE: ndex_config$api$user$membership$delete
Requires an authorized user! (ndex_connect with credentials)
Compatible to NDEx server version 2.0
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find user and get own id # user = ndex_find_user_byName(ndexcon, 'MyAccountName') # userId = user$externalId ## Find own groups and get one group id # groups = ndex_user_list_groups(ndexcon, userId) # groupId = groups[1,"externalId"] ## Find an other user of the group and get the id # users = ndex_group_list_users(ndexcon, groupId) ## Choose one user # userId = users[1,"externalId"] ## Remove user from the group # ndex_group_delete_membership(ndexcon, groupId, userId) NULL
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find user and get own id # user = ndex_find_user_byName(ndexcon, 'MyAccountName') # userId = user$externalId ## Find own groups and get one group id # groups = ndex_user_list_groups(ndexcon, userId) # groupId = groups[1,"externalId"] ## Find an other user of the group and get the id # users = ndex_group_list_users(ndexcon, groupId) ## Choose one user # userId = users[1,"externalId"] ## Remove user from the group # ndex_group_delete_membership(ndexcon, groupId, userId) NULL
Get Network Permissions of a Group
ndex_group_list_networks( ndexcon, groupId, permission = NULL, start = NULL, size = NULL )
ndex_group_list_networks( ndexcon, groupId, permission = NULL, start = NULL, size = NULL )
ndexcon |
object of class NDExConnection linkndex_connect |
groupId |
character; unique ID (UUID) of the group |
permission |
character (optional) ("WRITE"|"READ) (default: "READ"); constrains the type of the returned permission. |
start |
integer (optional); specifies that the result is the nth page of the requested data. |
size |
integer (optional); specifies the number of data items in each page. |
List of network permissions of that group or empty object
GET: ndex_config$api$group$network$list
Compatible to NDEx server version 2.0
## Establish a server connection ndexcon = ndex_connect() ## Find a group groups = ndex_find_groups(ndexcon,"Ideker Lab") groupId = groups[1,"externalId"] ## List networks of the group networks = ndex_group_list_networks(ndexcon, groupId) networks = ndex_group_list_networks(ndexcon, groupId, permission='READ', start=0, size=10)
## Establish a server connection ndexcon = ndex_connect() ## Find a group groups = ndex_find_groups(ndexcon,"Ideker Lab") groupId = groups[1,"externalId"] ## List networks of the group networks = ndex_group_list_networks(ndexcon, groupId) networks = ndex_group_list_networks(ndexcon, groupId, permission='READ', start=0, size=10)
Get Members of a Group
ndex_group_list_users(ndexcon, groupId, type = NULL, start = NULL, size = NULL)
ndex_group_list_users(ndexcon, groupId, type = NULL, start = NULL, size = NULL)
ndexcon |
object of class NDExConnection linkndex_connect |
groupId |
character; unique ID (UUID) of the group |
type |
character (optional); constrains the type of the returned membership. If not set (or NULL), all permission types will be returned. |
start |
integer (optional); specifies that the result is the nth page of the requested data. |
size |
integer (optional); specifies the number of data items in each page. |
List of permissions of that group or empty object
GET: ndex_config$api$group$membership$get
Compatible to NDEx server version 2.0
## Establish a server connection ndexcon = ndex_connect() ## Find a group groups = ndex_find_groups(ndexcon,"Ideker Lab") groupId = groups[1,"externalId"] ## Find other users of the group # users = ndex_group_list_users(ndexcon, groupId) # users = ndex_group_list_users (ndexcon, groupId, type='ADMIN', start=0, size=10)
## Establish a server connection ndexcon = ndex_connect() ## Find a group groups = ndex_find_groups(ndexcon,"Ideker Lab") groupId = groups[1,"externalId"] ## Find other users of the group # users = ndex_group_list_users(ndexcon, groupId) # users = ndex_group_list_users (ndexcon, groupId, type='ADMIN', start=0, size=10)
Get Group Permission for a Specific Network
ndex_group_network_get_permission(ndexcon, groupId, networkId)
ndex_group_network_get_permission(ndexcon, groupId, networkId)
ndexcon |
object of class NDExConnection ndex_connect |
groupId |
character; unique ID (UUID) of the group |
networkId |
character; unique ID (UUID) of the network |
Network permissions of that group or empty object
GET: ndex_config$api$group$network$get
Compatible to NDEx server version 2.0
## Establish a server connection ndexcon = ndex_connect() ## Find a group groups = ndex_find_groups(ndexcon,"Ideker Lab") groupId = groups[1,"externalId"] ## List networks of the group networks = ndex_group_list_networks(ndexcon, groupId) networkId = names(networks)[1] ## Get group's permission to the network #group = ndex_group_network_get_permission(ndexcon, groupId, networkId)
## Establish a server connection ndexcon = ndex_connect() ## Find a group groups = ndex_find_groups(ndexcon,"Ideker Lab") groupId = groups[1,"externalId"] ## List networks of the group networks = ndex_group_list_networks(ndexcon, groupId) networkId = names(networks)[1] ## Get group's permission to the network #group = ndex_group_network_get_permission(ndexcon, groupId, networkId)
Updates the membership corresponding to the GroupMembership type specified in the URL parameter.
ndex_group_set_membership(ndexcon, groupId, userId, type = "MEMBER")
ndex_group_set_membership(ndexcon, groupId, userId, type = "MEMBER")
ndexcon |
object of class NDExConnection linkndex_connect |
groupId |
character; unique ID (UUID) of the group |
userId |
character; unique ID (UUID) of the user |
type |
character (optional)("GROUPADMIN"|"MEMBER")(default: "MEMBER"); Type of group membership |
Empty string ("") on success, else error
PUT: ndex_config$api$user$membership$update
Requires an authorized user! (ndex_connect with credentials)
Compatible to NDEx server version 2.0
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find user and get own id # user = ndex_find_user_byName(ndexcon, 'MyAccountName') # userId = user$externalId ## Find own groups and get one group id # groups = ndex_user_list_groups(ndexcon, userId) # groupId = groups[1,"externalId"] ## Find an other user and get the id # user = ndex_find_user_byName(ndexcon, 'SomeOtherAccountName') # userId = user$externalId ## Add other user to the group # ndex_group_set_membership(ndexcon, groupId, userId) ## Update other user's group permission # ndex_group_set_membership(ndexcon, groupId, userId, type='MEMBER') ## same as before ## Make other user to group admin (lose own admin permission) # ndex_group_set_membership(ndexcon, groupId, userId, type='GROUPADMIN') NULL
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find user and get own id # user = ndex_find_user_byName(ndexcon, 'MyAccountName') # userId = user$externalId ## Find own groups and get one group id # groups = ndex_user_list_groups(ndexcon, userId) # groupId = groups[1,"externalId"] ## Find an other user and get the id # user = ndex_find_user_byName(ndexcon, 'SomeOtherAccountName') # userId = user$externalId ## Add other user to the group # ndex_group_set_membership(ndexcon, groupId, userId) ## Update other user's group permission # ndex_group_set_membership(ndexcon, groupId, userId, type='MEMBER') ## same as before ## Make other user to group admin (lose own admin permission) # ndex_group_set_membership(ndexcon, groupId, userId, type='GROUPADMIN') NULL
This function retrieves the metadata associated with the supplied network UUID.
ndex_network_aspect_get_metadata(ndexcon, networkId, aspect)
ndex_network_aspect_get_metadata(ndexcon, networkId, aspect)
ndexcon |
object of class NDExConnection linkndex_connect |
networkId |
character; unique ID (UUID) of the network |
aspect |
character; aspect name |
metadata for an aspect as list: consistencyGroup, elementCount, lastUpdate, data, name, properties, version and idCounter
GET: ndex_config$api$network$aspect$getMetaDataByName
Compatible to NDEx server version 2.0
Server error (version 2.0) since March 13th 2017
## Establish a server connection ndexcon = ndex_connect() ## Find a network and get its UUID networks = ndex_find_networks(ndexcon,"p53", "nci-pid") networkId = networks[1,"externalId"] ## Get the meta-data of an aspect of a network ndex_network_aspect_get_metadata(ndexcon, networkId, 'nodeAttributes')
## Establish a server connection ndexcon = ndex_connect() ## Find a network and get its UUID networks = ndex_find_networks(ndexcon,"p53", "nci-pid") networkId = networks[1,"externalId"] ## Get the meta-data of an aspect of a network ndex_network_aspect_get_metadata(ndexcon, networkId, 'nodeAttributes')
Removes any permission for the network for the user or group specified
ndex_network_delete_permission(ndexcon, networkId, user = NULL, group = NULL)
ndex_network_delete_permission(ndexcon, networkId, user = NULL, group = NULL)
ndexcon |
object of class NDExConnection linkndex_connect |
networkId |
unique ID of the network |
user |
character (optional); uuid of the user. Only either user or group may be set! |
group |
character (optional); uuid of the group. Only either user or group may be set! |
1 integer on success, 0 if user/group allready has no permissions on the network
GET: ndex_config$api$network$permission$delete
Requires an authorized user! (ndex_connect with credentials)
Compatible to NDEx server version 1.3 and 2.0
In version 1.3 the function only works for user permissions!
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find one of your networks and get its UUID # networks = ndex_find_networks(ndexcon, accountName='MyAccountName') # networkId = networks[1,"externalId"] ## Get the UUID for a user and group # someUserUuid = "uuuuuuuu-ssss-eeee-rrrr-111111111111" # someGroupUuid = "ggggggg-rrrr-oooo-uuuu-pppppppppppp" ## Delete the permissions #ndex_network_delete_permission(ndexcon, networkId, user=someUserUuid) # => returns 1 #ndex_network_delete_permission(ndexcon, networkId, user=someUserUuid) # => returns 0, because user already lost permission on network #ndex_network_delete_permission(ndexcon, networkId, group=someGroupUuid) NULL
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find one of your networks and get its UUID # networks = ndex_find_networks(ndexcon, accountName='MyAccountName') # networkId = networks[1,"externalId"] ## Get the UUID for a user and group # someUserUuid = "uuuuuuuu-ssss-eeee-rrrr-111111111111" # someGroupUuid = "ggggggg-rrrr-oooo-uuuu-pppppppppppp" ## Delete the permissions #ndex_network_delete_permission(ndexcon, networkId, user=someUserUuid) # => returns 1 #ndex_network_delete_permission(ndexcon, networkId, user=someUserUuid) # => returns 0, because user already lost permission on network #ndex_network_delete_permission(ndexcon, networkId, group=someGroupUuid) NULL
This function retrieves the provided aspect as CX. The result is the same as accessing an aspect of a RCX object.
ndex_network_get_aspect(ndexcon, networkId, aspect, size)
ndex_network_get_aspect(ndexcon, networkId, aspect, size)
ndexcon |
object of class NDExConnection linkndex_connect |
networkId |
character; unique ID of the network |
aspect |
character; name of the aspect |
size |
integer; specifies the number of elements returned |
Note: In future 'ndexr' uses the RCX-object from the corresponding package to handle the networks!
data.frame of the aspect data (the same as rcx[[aspectName]])
GET: ndex_config$api$network$aspect$getMetaDataByName
Compatible to NDEx server version 1.3 and 2.0, but doesn't work for version 1.3
## Establish a server connection ndexcon = ndex_connect() ## Find a network and get its UUID networks = ndex_find_networks(ndexcon,"p53", "nci-pid") networkId = networks[1,"externalId"] ## Get the aspect of a network aspect = ndex_network_get_aspect(ndexcon, networkId, 'nodeAttributes') # limit the returned elements of the aspect to the first 10 elements aspect = ndex_network_get_aspect(ndexcon, networkId, 'nodeAttributes', 10)
## Establish a server connection ndexcon = ndex_connect() ## Find a network and get its UUID networks = ndex_find_networks(ndexcon,"p53", "nci-pid") networkId = networks[1,"externalId"] ## Get the aspect of a network aspect = ndex_network_get_aspect(ndexcon, networkId, 'nodeAttributes') # limit the returned elements of the aspect to the first 10 elements aspect = ndex_network_get_aspect(ndexcon, networkId, 'nodeAttributes', 10)
This function retrieves the (aspect) meta-data of the network identified by the supplied network UUID string.
ndex_network_get_metadata(ndexcon, networkId)
ndex_network_get_metadata(ndexcon, networkId)
ndexcon |
object of class NDExConnection linkndex_connect |
networkId |
character; unique ID (UUID) of the network |
Note: In future 'ndexr' uses the RCX-object from the corresponding package to handle the networks! See also Meta-data for more information.
metadata as list: consistencyGroup, elementCount, lastUpdate, name, properties, version and idCounter
GET: ndex_config$api$network$aspect$getMetaData
Compatible to NDEx server version 1.3 and 2.0, but doesn't work for version 1.3
## Establish a server connection ndexcon = ndex_connect() ## Find a network and get its UUID networks = ndex_find_networks(ndexcon,"p53", "nci-pid") networkId = networks[1,"externalId"] ## Get the network meta-data ndex_network_get_metadata(ndexcon, networkId)
## Establish a server connection ndexcon = ndex_connect() ## Find a network and get its UUID networks = ndex_find_networks(ndexcon,"p53", "nci-pid") networkId = networks[1,"externalId"] ## Get the network meta-data ndex_network_get_metadata(ndexcon, networkId)
This function retrieves the user or group permissions for a network
ndex_network_get_permission(ndexcon, networkId, type, permission, start, size)
ndex_network_get_permission(ndexcon, networkId, type, permission, start, size)
ndexcon |
object of class NDExConnection linkndex_connect |
networkId |
unique ID of the network |
type |
character ("user"|"group"); specifies whether user or group permissions should be returned |
permission |
character (optional)("READ"|"WRITE"|"ADMIN"); constrains the type of the returned membership. If not set (or NULL), all permission types will be returned. |
start |
integer (optional); specifies that the result is the nth page of the requested data. |
size |
integer (optional); specifies the number of data items in each page. |
data.frame containing user or group UUIDs and the highest permission assigned to that user or group
GET: ndex_config$api$network$permission$get
Compatible to NDEx server version 1.3 and 2.0
In version 1.3 the function only returns user permissions and differs in the returned data (more columns)!
Requires an authorized user! (ndex_connect with credentials)
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find one of your networks and get its UUID # networks = ndex_find_networks(ndexcon, accountName='MyAccountName') # networkId = networks[1,"externalId"] ## Get the permissions # permissions = ndex_network_get_permission(ndexcon, networkId, 'user') ## Version 2.0: ## names(permission) ## [1] "memberUUID" "permission" ## Version 1.3: ## names(permission) ## [1] "membershipType" "memberUUID" "resourceUUID" ## [4] "memberAccountName" "permissions" "resourceName" # permissions = ndex_network_get_permission(ndexcon, networkId, 'user', NULL) # same as previous # permissions = ndex_network_get_permission(ndexcon, networkId, 'user', 'READ', 0, 10) # permissions = ndex_network_get_permission(ndexcon, networkId, 'group') NULL
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find one of your networks and get its UUID # networks = ndex_find_networks(ndexcon, accountName='MyAccountName') # networkId = networks[1,"externalId"] ## Get the permissions # permissions = ndex_network_get_permission(ndexcon, networkId, 'user') ## Version 2.0: ## names(permission) ## [1] "memberUUID" "permission" ## Version 1.3: ## names(permission) ## [1] "membershipType" "memberUUID" "resourceUUID" ## [4] "memberAccountName" "permissions" "resourceName" # permissions = ndex_network_get_permission(ndexcon, networkId, 'user', NULL) # same as previous # permissions = ndex_network_get_permission(ndexcon, networkId, 'user', 'READ', 0, 10) # permissions = ndex_network_get_permission(ndexcon, networkId, 'group') NULL
This function retrieves the provenance of the network identified by the supplied network UUID string.
ndex_network_get_provenance(ndexcon, networkId)
ndex_network_get_provenance(ndexcon, networkId)
ndexcon |
object of class NDExConnection linkndex_connect |
networkId |
unique ID of the network |
List of network metadata: ID, name, whether it is public, edge and node count; source and format of network
GET: ndex_config$api$network$provenance$get
Compatible to NDEx server version 1.3 and 2.0
## Establish a server connection ndexcon = ndex_connect() ## Find a network and get its UUID networks = ndex_find_networks(ndexcon,"p53", "nci-pid") networkId = networks[1,"externalId"] ## Get the network provenace provenance = ndex_network_get_provenance(ndexcon, networkId)
## Establish a server connection ndexcon = ndex_connect() ## Find a network and get its UUID networks = ndex_find_networks(ndexcon,"p53", "nci-pid") networkId = networks[1,"externalId"] ## Get the network provenace provenance = ndex_network_get_provenance(ndexcon, networkId)
This function retrieves the summary of the network identified by the supplied network UUID string.
ndex_network_get_summary(ndexcon, networkId)
ndex_network_get_summary(ndexcon, networkId)
ndexcon |
object of class NDExConnection linkndex_connect |
networkId |
unique ID of the network |
List of network metadata: ID, name, whether it is public, edge and node count; source and format of network
GET: ndex_config$api$network$summary$get
Compatible to NDEx server version 1.3 and 2.0
## Establish a server connection ndexcon = ndex_connect() ## Find a network and get its UUID networks = ndex_find_networks(ndexcon,"p53", "nci-pid") networkId = networks[1,"externalId"] ## Get the network summary summary = ndex_network_get_summary(ndexcon, networkId)
## Establish a server connection ndexcon = ndex_connect() ## Find a network and get its UUID networks = ndex_find_networks(ndexcon,"p53", "nci-pid") networkId = networks[1,"externalId"] ## Get the network summary summary = ndex_network_get_summary(ndexcon, networkId)
Network System properties are the properties that describe the network's status in a particular NDEx server but that are not part of the corresponding CX network object.
ndex_network_set_systemProperties( ndexcon, networkId, readOnly = NULL, visibility = NULL, showcase = NULL )
ndex_network_set_systemProperties( ndexcon, networkId, readOnly = NULL, visibility = NULL, showcase = NULL )
ndexcon |
object of class NDExConnection linkndex_connect |
networkId |
unique ID of the network |
readOnly |
boolean (optional); Sets the network to only readable. At least one of readOnly, visibility or showcase have to be set! |
visibility |
character (optional) ('PUBLIC'|'PRIVATE'); Sets the network to only readable. At least one of readOnly, visibility or showcase have to be set! |
showcase |
boolean (optional); Authenticated user can use this property to control whether this network will display in his or her home page. Caller will receive an error if the user does not have explicit permission to that network. At least one of readOnly, visibility or showcase have to be set! |
NULL on success; Error else
GET: ndex_config$api$network$systemproperties$set
Requires an authorized user! (ndex_connect with credentials)
Compatible to NDEx server version 1.3 and 2.0
In version 1.3 only the parameter readOnly is supported
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find one of your networks and get its UUID # networks = ndex_find_networks(ndexcon, accountName='MyAccountName') # networkId = networks[1,"externalId"] ## Set network system properties # ndex_network_set_systemProperties(ndexcon, networkId, readOnly=TRUE) # ndex_network_set_systemProperties(ndexcon, networkId, visibility="PUBLIC") # ndex_network_set_systemProperties(ndexcon, networkId, showcase=TRUE) # ndex_network_set_systemProperties(ndexcon, networkId, # readOnly=FALSE, visibility="PRIVATE", showcase=FALSE) NULL
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find one of your networks and get its UUID # networks = ndex_find_networks(ndexcon, accountName='MyAccountName') # networkId = networks[1,"externalId"] ## Set network system properties # ndex_network_set_systemProperties(ndexcon, networkId, readOnly=TRUE) # ndex_network_set_systemProperties(ndexcon, networkId, visibility="PUBLIC") # ndex_network_set_systemProperties(ndexcon, networkId, showcase=TRUE) # ndex_network_set_systemProperties(ndexcon, networkId, # readOnly=FALSE, visibility="PRIVATE", showcase=FALSE) NULL
This function updates an aspect with the provided CX for the aspect.
ndex_network_update_aspect( ndexcon, networkId, aspectName, aspectAsRCX, isJson = FALSE )
ndex_network_update_aspect( ndexcon, networkId, aspectName, aspectAsRCX, isJson = FALSE )
ndexcon |
object of class NDExConnection linkndex_connect |
networkId |
unique ID of the network |
aspectName |
name of the aspect |
aspectAsRCX |
rcx data for the aspect (rcx[[aspectName]]) |
isJson |
logical if aspectAsRCX is already JSON |
networkId unique ID of the modified network
PUT: ndex_config$api$network$aspect$update
Requires an authorized user! (ndex_connect with credentials)
Compatible to NDEx server version 2.0
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find one of your networks and get its UUID # networks = ndex_find_networks(ndexcon, accountName='MyAccountName') # networkId = networks[1,"externalId"] ## Get the network data # aspect = ndex_network_get_aspect(ndexcon, networkId, 'nodeAttributes') ## Do some changes to the aspect.. # aspectModified = aspect[1:5,] ## and update the aspect # ndex_network_update_aspect(ndexcon,pws[1,"externalId"], 'nodeAttributes', aspectModified) NULL
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find one of your networks and get its UUID # networks = ndex_find_networks(ndexcon, accountName='MyAccountName') # networkId = networks[1,"externalId"] ## Get the network data # aspect = ndex_network_get_aspect(ndexcon, networkId, 'nodeAttributes') ## Do some changes to the aspect.. # aspectModified = aspect[1:5,] ## and update the aspect # ndex_network_update_aspect(ndexcon,pws[1,"externalId"], 'nodeAttributes', aspectModified) NULL
Updates the permission of a user specified by userid or group specified by groupid for the network
ndex_network_update_permission( ndexcon, networkId, user = NULL, group = NULL, permission )
ndex_network_update_permission( ndexcon, networkId, user = NULL, group = NULL, permission )
ndexcon |
object of class NDExConnection linkndex_connect |
networkId |
unique ID of the network |
user |
character (optional); uuid of the user. Only either user or group may be set! |
group |
character (optional); uuid of the group. Only either user or group may be set! |
permission |
character (optional)("READ"|"WRITE"|"ADMIN"); type of permission to be given. If granted admin permission, the current admin loses the admin status. |
1 integer on success, 0 if user/group allready has this permissions on the network
GET: ndex_config$api$network$permission$update
Requires an authorized user! (ndex_connect with credentials)
Compatible to NDEx server version 1.3 and 2.0, but doesn't work for version 1.3
In version 1.3 the function only works for user permissions!
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find one of your networks and get its UUID # networks = ndex_find_networks(ndexcon, accountName='MyAccountName') # networkId = networks[1,"externalId"] ## Get the UUID for a user and group # someUserUuid = "uuuuuuuu-ssss-eeee-rrrr-111111111111" # someGroupUuid = "ggggggg-rrrr-oooo-uuuu-pppppppppppp" ## Change the permissions # ndex_network_update_permission(ndexcon, networkId, user=someUserUuid, 'WRITE') # ndex_network_update_permission(ndexcon, networkId, group=someGroupUuid, 'READ') ## Set a new admin (lose own admin status) # ndex_network_update_permission(ndexcon, networkId, user=someUserUuid, 'ADMIN') NULL
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find one of your networks and get its UUID # networks = ndex_find_networks(ndexcon, accountName='MyAccountName') # networkId = networks[1,"externalId"] ## Get the UUID for a user and group # someUserUuid = "uuuuuuuu-ssss-eeee-rrrr-111111111111" # someGroupUuid = "ggggggg-rrrr-oooo-uuuu-pppppppppppp" ## Change the permissions # ndex_network_update_permission(ndexcon, networkId, user=someUserUuid, 'WRITE') # ndex_network_update_permission(ndexcon, networkId, group=someGroupUuid, 'READ') ## Set a new admin (lose own admin status) # ndex_network_update_permission(ndexcon, networkId, user=someUserUuid, 'ADMIN') NULL
Updates the profile information of the network. Any profile attributes specified will be updated but attributes that are not specified will have no effect - omission of an attribute does not mean deletion of that attribute.
ndex_network_update_profile( ndexcon, networkId, name = NULL, description = NULL, version = NULL )
ndex_network_update_profile( ndexcon, networkId, name = NULL, description = NULL, version = NULL )
ndexcon |
object of class NDExConnection linkndex_connect |
networkId |
unique ID of the network |
name |
character (optional); Changes the name the network. At least one of name, description or version have to be set! |
description |
character (optional); Changes the description the network. At least one of name, description or version have to be set! |
version |
character (optional); Changes the version the network. At least one of name, description or version have to be set! |
NULL on success; Error else
GET: ndex_config$api$network$profile$update
Requires an authorized user! (ndex_connect with credentials)
Compatible to NDEx server version 1.3 and 2.0
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find one of your networks and get its UUID # networks = ndex_find_networks(ndexcon, accountName='MyAccountName') # networkId = networks[1,"externalId"] ## Update network profile # ndex_network_update_profile(ndexcon, networkId, name="Some fancy name for the network") # ndex_network_update_profile(ndexcon, networkId, description="Description of the network") # ndex_network_update_profile(ndexcon, networkId, version="1.2.3.4") # ndex_network_update_profile(ndexcon, networkId, name="Special test network", # description="Nothing to see here", version="1.3") NULL
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find one of your networks and get its UUID # networks = ndex_find_networks(ndexcon, accountName='MyAccountName') # networkId = networks[1,"externalId"] ## Update network profile # ndex_network_update_profile(ndexcon, networkId, name="Some fancy name for the network") # ndex_network_update_profile(ndexcon, networkId, description="Description of the network") # ndex_network_update_profile(ndexcon, networkId, version="1.2.3.4") # ndex_network_update_profile(ndexcon, networkId, name="Special test network", # description="Nothing to see here", version="1.3") NULL
Updates the group based on the data.
ndex_update_group( ndexcon, groupId, groupName, image, website, description, properties )
ndex_update_group( ndexcon, groupId, groupName, image, website, description, properties )
ndexcon |
object of class NDExConnection linkndex_connect |
groupId |
character; unique ID (UUID) of the group |
groupName |
character; name of the new graoup |
image |
character (optional); URL of the account owner's image. |
website |
character (optional); URL of the account owner's web site |
description |
character (optional); Short description of this user. |
properties |
list (optional); additional properties for the group |
Empty string ("") on success, else error
PUT: ndex_config$api$user$update
Requires an authorized user! (ndex_connect with credentials)
Compatible to NDEx server version 2.0
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find user and get its id # user = ndex_find_user_byName(ndexcon, 'MyAccountName') # userId = user$externalId ## Find the user's groups and get one group id # groups = ndex_user_list_groups(ndexcon, userId) # groupId = groups[1,"externalId"] ## Update the group # ndex_update_group(ndexcon, groupId, description='A really nice group!') NULL
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find user and get its id # user = ndex_find_user_byName(ndexcon, 'MyAccountName') # userId = user$externalId ## Find the user's groups and get one group id # groups = ndex_user_list_groups(ndexcon, userId) # groupId = groups[1,"externalId"] ## Update the group # ndex_update_group(ndexcon, groupId, description='A really nice group!') NULL
Note: In future 'ndexr' uses the RCX-object from the corresponding package to handle the networks!
ndex_update_network(ndexcon, rcx, networkId)
ndex_update_network(ndexcon, rcx, networkId)
ndexcon |
object of class NDExConnection linkndex_connect |
rcx |
|
networkId |
(optional); unique ID of the network |
This method updates/replaces a existing network on the NDEx server with new content from the given RCX object. The UUID can either be specified manually or it will be extracted from the RCX object (i.e. from rcx$ndexStatus$externalId).
UUID of the updated network
PUT (multipart/form-data): ndex_config$api$network$update$url data: CXNetworkStream = data
Requires an authorized user! (ndex_connect with credentials)
Compatible to NDEx server version 1.3 and 2.0
## Establish a server connections with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find one of your networks and get its UUID # networks = ndex_find_networks(ndexcon, accountName='MyAccountName') # networkId = networks[1,"externalId"] ## Get the network data # rcx = ndex_get_network(ndexcon, networkId) ## Do some changes to rcx.. ## and update the network # networkId = ndex_update_network(ndexcon, rcx, networkId) # networkId = ndex_update_network(ndexcon, rcx) ## same as previous NULL
## Establish a server connections with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find one of your networks and get its UUID # networks = ndex_find_networks(ndexcon, accountName='MyAccountName') # networkId = networks[1,"externalId"] ## Get the network data # rcx = ndex_get_network(ndexcon, networkId) ## Do some changes to rcx.. ## and update the network # networkId = ndex_update_network(ndexcon, rcx, networkId) # networkId = ndex_update_network(ndexcon, rcx) ## same as previous NULL
Updates the authenticated user based on the data. Errors, if the user for ndexcon and uuid are different.
ndex_update_user( ndexcon, userId, emailAddress, isIndividual, displayName, firstName, lastName, image, website, description, verbose = FALSE )
ndex_update_user( ndexcon, userId, emailAddress, isIndividual, displayName, firstName, lastName, image, website, description, verbose = FALSE )
ndexcon |
object of class NDExConnection linkndex_connect |
userId |
character; unique ID of the user |
emailAddress |
character (optional); email address (used for verification if enabled) |
isIndividual |
boolean (default:True); True if this account is for an individual user. False means this account is for an organization or a project etc. |
displayName |
character (optional); Display name of this account, only applied to non-individual accounts. |
firstName |
character (optional); Account owner's first name, only applies to individual accounts. |
lastName |
character (optional); Account owner's last name, only appliies to individual accounts. |
image |
character (optional); URL of the account owner's image. |
website |
character (optional); URL of the account owner's web site |
description |
character (optional); Short description of this user. |
verbose |
logical (optional); whether to print out extended feedback |
Empty string ("") on success, else error
GET: ndex_config$api$user$update
Requires an authorized user! (ndex_connect with credentials)
Compatible to NDEx server version 2.0
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find user and get its id # user = ndex_find_user_byName(ndexcon, 'SomeUserName') # userId = user$externalId ## Update user # ndex_update_user(ndexcon, userId, firstName = 'Homer Jay', lastName = 'Simpson') # ndex_update_user(ndexcon, userId, displayName = 'Max Power', # image='https://upload.wikimedia.org/wikipedia/en/0/02/Homer_Simpson_2006.png', # description='One of the most influential characters in the history of TV') NULL
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find user and get its id # user = ndex_find_user_byName(ndexcon, 'SomeUserName') # userId = user$externalId ## Update user # ndex_update_user(ndexcon, userId, firstName = 'Homer Jay', lastName = 'Simpson') # ndex_update_user(ndexcon, userId, displayName = 'Max Power', # image='https://upload.wikimedia.org/wikipedia/en/0/02/Homer_Simpson_2006.png', # description='One of the most influential characters in the history of TV') NULL
Changes the authenticated user's password to the new password
ndex_user_change_password(ndexcon, userId, password)
ndex_user_change_password(ndexcon, userId, password)
ndexcon |
object of class NDExConnection linkndex_connect |
userId |
character; unique ID of the user |
password |
character; New password |
Empty string on success, else error
GET: ndex_config$api$user$password$change
Requires an authorized user! (ndex_connect with credentials)
Compatible to NDEx server version 2.0
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find user and get its id # user = ndex_find_user_byName(ndexcon, 'SomeUserName') # userId = user$externalId ## Change user password # ndex_user_change_password(ndexcon, userId, 'SuperSaveNewPassword') NULL
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find user and get its id # user = ndex_find_user_byName(ndexcon, 'SomeUserName') # userId = user$externalId ## Change user password # ndex_user_change_password(ndexcon, userId, 'SuperSaveNewPassword') NULL
Causes a new password to be generated for the given user account and then emailed to the user's emailAddress
ndex_user_forgot_password(ndexcon, userId)
ndex_user_forgot_password(ndexcon, userId)
ndexcon |
object of class NDExConnection linkndex_connect |
userId |
character; unique ID of the user |
Empty string on success, else error
GET: ndex_config$api$user$password$mail Wrapper for ndex_user_mail_password()
Compatible to NDEx server version 2.0
## Establish a server connection # ndexcon = ndex_connect() ## Find user and get its id # user = ndex_find_user_byName(ndexcon, 'SomeUserName') # userId = user$externalId ## Request new password via email # ndex_user_forgot_password(ndexcon, userId) NULL
## Establish a server connection # ndexcon = ndex_connect() ## Find user and get its id # user = ndex_find_user_byName(ndexcon, 'SomeUserName') # userId = user$externalId ## Request new password via email # ndex_user_forgot_password(ndexcon, userId) NULL
This is a convenience function designed to support "My Account" pages in NDEx applications. It returns a list of NetworkSummary objects to display.
ndex_user_get_networksummary(ndexcon, userId)
ndex_user_get_networksummary(ndexcon, userId)
ndexcon |
object of class NDExConnection linkndex_connect |
userId |
character; unique ID (UUID) of the user |
data.frame of networks (name, description, externalId, uri, etc.) on the account page of the specified user
GET: ndex_config$api$user$networksummary
Requires an authorized user! (ndex_connect with credentials)
Compatible to NDEx server version 2.0
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## get user by name to get UUID # user = ndex_find_user_byName(ndexcon, 'MyAccountName') # userId = user$externalId ## get all network permissions of the user # networkSummary = ndex_user_get_networksummary(con, user$externalId) # names(networkSummary) ## [1] "ownerUUID" "isReadOnly" "subnetworkIds" "errorMessage" "isValid" ## [6] "warnings" "isShowcase" "visibility" "edgeCount" "nodeCount" ##[11] "uri" "version" "owner" "name" "properties" ##[16] "description" "externalId" "isDeleted" "modificationTime" "creationTime" NULL
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## get user by name to get UUID # user = ndex_find_user_byName(ndexcon, 'MyAccountName') # userId = user$externalId ## get all network permissions of the user # networkSummary = ndex_user_get_networksummary(con, user$externalId) # names(networkSummary) ## [1] "ownerUUID" "isReadOnly" "subnetworkIds" "errorMessage" "isValid" ## [6] "warnings" "isShowcase" "visibility" "edgeCount" "nodeCount" ##[11] "uri" "version" "owner" "name" "properties" ##[16] "description" "externalId" "isDeleted" "modificationTime" "creationTime" NULL
This is a convenience function to support "user pages" in NDEx applications. This function returns a list of network summary objects that the user who is specified by userid chose to display in his or her home page. For authenticated users, this function returns the networks that the authenticated user can read, for anonymous users, this function returns only public networks.
ndex_user_get_showcase(ndexcon, userId)
ndex_user_get_showcase(ndexcon, userId)
ndexcon |
object of class NDExConnection linkndex_connect |
userId |
character; unique ID (UUID) of the user |
data.frame of networks (name, description, externalId, uri, etc.) in the showcase of the specified user
GET: ndex_config$api$user$showcase
Compatible to NDEx server version 2.0
## Establish a server connection ndexcon = ndex_connect() ## get user by name to get UUID user = ndex_find_user_byName(ndexcon, 'ndextutorials') userId = user$externalId ## get all network permissions of the user showcase = ndex_user_get_showcase(ndexcon, userId) names(showcase) ## [1] "ownerUUID" "isReadOnly" "subnetworkIds" "errorMessage" "isValid" ## [6] "warnings" "isShowcase" "visibility" "edgeCount" "nodeCount" ##[11] "uri" "version" "owner" "name" "properties" ##[16] "description" "externalId" "isDeleted" "modificationTime" "creationTime"
## Establish a server connection ndexcon = ndex_connect() ## get user by name to get UUID user = ndex_find_user_byName(ndexcon, 'ndextutorials') userId = user$externalId ## get all network permissions of the user showcase = ndex_user_get_showcase(ndexcon, userId) names(showcase) ## [1] "ownerUUID" "isReadOnly" "subnetworkIds" "errorMessage" "isValid" ## [6] "warnings" "isShowcase" "visibility" "edgeCount" "nodeCount" ##[11] "uri" "version" "owner" "name" "properties" ##[16] "description" "externalId" "isDeleted" "modificationTime" "creationTime"
Query finds groups for which the current user has the specified membership type. If the "type' parameter is omitted, all membership types will be returned. Returns a map which maps a group UUID to the membership type the authenticated user has.
ndex_user_list_groups(ndexcon, userId, type = NULL, start = NULL, size = NULL)
ndex_user_list_groups(ndexcon, userId, type = NULL, start = NULL, size = NULL)
ndexcon |
object of class NDExConnection linkndex_connect |
userId |
character; unique ID (UUID) of the user |
type |
character (optional)("MEMBER"|"GROUPADMIN"); constrains the type of the returned membership. If not set (or NULL), all permission types will be returned. |
start |
integer (optional); specifies that the result is the nth page of the requested data. |
size |
integer (optional); specifies the number of data items in each page. |
List of permissions of that user or empty object
GET: ndex_config$api$user$group$list
Requires an authorized user! (ndex_connect with credentials)
Compatible to NDEx server version 2.0
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find user and get its id # user = ndex_find_user_byName(ndexcon, 'MyAccountName') # userId = user$externalId ## Find the user's groups and get one group id # groups = ndex_user_list_groups(ndexcon, userId) ## $`ggggggg-rrrr-oooo-uuuu-pppppp111111` ## [1] "MEMBER" ## ## $`ggggggg-rrrr-oooo-uuuu-pppppp222222` ## [1] "GROUPADMIN" # groupIds = names(groups) ## [1] "ggggggg-rrrr-oooo-uuuu-pppppp111111" "ggggggg-rrrr-oooo-uuuu-pppppp222222" NULL
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find user and get its id # user = ndex_find_user_byName(ndexcon, 'MyAccountName') # userId = user$externalId ## Find the user's groups and get one group id # groups = ndex_user_list_groups(ndexcon, userId) ## $`ggggggg-rrrr-oooo-uuuu-pppppp111111` ## [1] "MEMBER" ## ## $`ggggggg-rrrr-oooo-uuuu-pppppp222222` ## [1] "GROUPADMIN" # groupIds = names(groups) ## [1] "ggggggg-rrrr-oooo-uuuu-pppppp111111" "ggggggg-rrrr-oooo-uuuu-pppppp222222" NULL
This function returns networks for which the authenticated user is assigned the specified permission. Userid is the UUID of the authenticated user. Returns a JSON map in which the keys are network UUIDs and values are the highest permission assigned to the authenticated user.#'
ndex_user_list_permissions( ndexcon, userId, type = NULL, directonly = FALSE, start = NULL, size = NULL )
ndex_user_list_permissions( ndexcon, userId, type = NULL, directonly = FALSE, start = NULL, size = NULL )
ndexcon |
object of class NDExConnection linkndex_connect |
userId |
character; unique ID (UUID) of the user |
type |
character (optional)("READ"|"WRITE"|"ADMIN"); constrains the type of the returned permission. If not set (or NULL), all permission types will be returned. |
directonly |
logical (default: FALSE); If directonly is set to true, permissions granted through groups are not included in the result |
start |
integer (optional); specifies that the result is the nth page of the requested data. |
size |
integer (optional); specifies the number of data items in each page. |
List of highest permissions of that user or empty object
GET: ndex_config$api$user$permission$list
Requires an authorized user! (ndex_connect with credentials)
Compatible to NDEx server version 2.0
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## get user by name to get UUID # user = ndex_find_user_byName(ndexcon, 'MyAccountName') # userId = user$externalId ## get all network permissions of the user # networkPermissions = ndex_user_list_permissions(ndexcon, userId) ## $`nnneeett-wwww-oooo-rrrr-kkkkkkk11111` ## [1] "ADMIN" ## $`nnneeett-wwww-oooo-rrrr-kkkkkkk22222` ## [1] "WRITE" ## $`nnneeett-wwww-oooo-rrrr-kkkkkkk33333` ## [1] "READ" # networkIds = names(networkPermissions) ## [1] "nnneeett-wwww-oooo-rrrr-kkkkkkk11111" "nnneeett-wwww-oooo-rrrr-kkkkkkk22222" ## [3] "nnneeett-wwww-oooo-rrrr-kkkkkkk33333" ## get all networks for which the user has Admin permissions # networkPermissions = ndex_user_list_permissions(ndexcon, userId, type='ADMIN') ## $`nnneeett-wwww-oooo-rrrr-kkkkkkk11111` ## [1] "ADMIN" ## get all networks for which the user has direct access # networkPermissions = ndex_user_list_permissions(ndexcon, user$externalId, directonly=TRUE) ## $`nnneeett-wwww-oooo-rrrr-kkkkkkk11111` ## [1] "ADMIN" NULL
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## get user by name to get UUID # user = ndex_find_user_byName(ndexcon, 'MyAccountName') # userId = user$externalId ## get all network permissions of the user # networkPermissions = ndex_user_list_permissions(ndexcon, userId) ## $`nnneeett-wwww-oooo-rrrr-kkkkkkk11111` ## [1] "ADMIN" ## $`nnneeett-wwww-oooo-rrrr-kkkkkkk22222` ## [1] "WRITE" ## $`nnneeett-wwww-oooo-rrrr-kkkkkkk33333` ## [1] "READ" # networkIds = names(networkPermissions) ## [1] "nnneeett-wwww-oooo-rrrr-kkkkkkk11111" "nnneeett-wwww-oooo-rrrr-kkkkkkk22222" ## [3] "nnneeett-wwww-oooo-rrrr-kkkkkkk33333" ## get all networks for which the user has Admin permissions # networkPermissions = ndex_user_list_permissions(ndexcon, userId, type='ADMIN') ## $`nnneeett-wwww-oooo-rrrr-kkkkkkk11111` ## [1] "ADMIN" ## get all networks for which the user has direct access # networkPermissions = ndex_user_list_permissions(ndexcon, user$externalId, directonly=TRUE) ## $`nnneeett-wwww-oooo-rrrr-kkkkkkk11111` ## [1] "ADMIN" NULL
Causes a new password to be generated for the given user account and then emailed to the user's emailAddress
ndex_user_mail_password(ndexcon, userId)
ndex_user_mail_password(ndexcon, userId)
ndexcon |
object of class NDExConnection linkndex_connect |
userId |
character; unique ID of the user |
Empty string on success, else error
GET: ndex_config$api$user$password$mail
Compatible to NDEx server version 2.0
## Establish a server connection # ndexcon = ndex_connect() ## Find user and get its id # user = ndex_find_user_byName(ndexcon, 'SomeUserName') # userId = user$externalId ## Request new password via email # ndex_user_mail_password(ndexcon, userId) NULL
## Establish a server connection # ndexcon = ndex_connect() ## Find user and get its id # user = ndex_find_user_byName(ndexcon, 'SomeUserName') # userId = user$externalId ## Request new password via email # ndex_user_mail_password(ndexcon, userId) NULL
Returns the permission that the user specified in the URL has on the given group. Returns an empty object if the authenticated user is not a member of this group.
ndex_user_show_group(ndexcon, userId, groupId)
ndex_user_show_group(ndexcon, userId, groupId)
ndexcon |
object of class NDExConnection linkndex_connect |
userId |
character; unique ID (UUID) of the user |
groupId |
character; unique ID (UUID) of the group |
List of permissions of that user or empty object
GET: ndex_config$api$user$group$get
Requires an authorized user! (ndex_connect with credentials)
Compatible to NDEx server version 2.0
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find user and get its id # user = ndex_find_user_byName(ndexcon, 'SomeUserName') # userId = user$externalId ## Find the user's groups and get one group id # groups = ndex_user_list_groups(ndexcon, userId) # groupId = groups[1,"externalId"] ## get users's permission in the group # userPermissions = ndex_user_show_group(ndexcon, userId, groupId) ## $`uuuuuuuu-ssss-eeee-rrrr-123456789abc` ## [1] "MEMBER" NULL
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## Find user and get its id # user = ndex_find_user_byName(ndexcon, 'SomeUserName') # userId = user$externalId ## Find the user's groups and get one group id # groups = ndex_user_list_groups(ndexcon, userId) # groupId = groups[1,"externalId"] ## get users's permission in the group # userPermissions = ndex_user_show_group(ndexcon, userId, groupId) ## $`uuuuuuuu-ssss-eeee-rrrr-123456789abc` ## [1] "MEMBER" NULL
Get the type(s) of permission assigned to the authenticated user for the specified network. Returns a map which maps a network UUID to the highest permission assigned to the authenticated user.
ndex_user_show_permission(ndexcon, userId, networkId, directonly = FALSE)
ndex_user_show_permission(ndexcon, userId, networkId, directonly = FALSE)
ndexcon |
object of class NDExConnection linkndex_connect |
userId |
character; unique ID (UUID) of the user |
networkId |
character; unique ID (UUID) of the group |
directonly |
logical (default: FALSE); If directonly is set to true, permissions granted through groups are not included in the result |
List of permissions of that user ("READ"|"WRITE"|"ADMIN") or empty object
GET: ndex_config$api$user$permission$get
Requires an authorized user! (ndex_connect with credentials)
Compatible to NDEx server version 2.0
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## get user by name to get UUID # user = ndex_find_user_byName(ndexcon, 'MyAccountName') # userId = user$externalId ## Find one of your networks and get its UUID # networks = ndex_find_networks(ndexcon, accountName='MyAccountName') # networkId = networks[1,"externalId"] ## get users's permission to a network # networkPermissions = ndex_user_show_permission(ndexcon, userId, networkId, directonly=TRUE) ## $`nnneeett-wwww-oooo-rrrr-kkkkkkk11111` ## [1] "ADMIN" NULL
## Establish a server connection with credentials # ndexcon = ndex_connect('MyAccountName', 'MyPassword') ## get user by name to get UUID # user = ndex_find_user_byName(ndexcon, 'MyAccountName') # userId = user$externalId ## Find one of your networks and get its UUID # networks = ndex_find_networks(ndexcon, accountName='MyAccountName') # networkId = networks[1,"externalId"] ## get users's permission to a network # networkPermissions = ndex_user_show_permission(ndexcon, userId, networkId, directonly=TRUE) ## $`nnneeett-wwww-oooo-rrrr-kkkkkkk11111` ## [1] "ADMIN" NULL
Verify the given user with UUID and verification code, which is set by email
ndex_verify_user(ndexcon, userId, code)
ndex_verify_user(ndexcon, userId, code)
ndexcon |
object of class NDExConnection linkndex_connect |
userId |
character; unique ID of the user |
code |
character; Verification code sent by email |
string "User account XXX has been activated." when this user's account is successfully activated.
GET: ndex_config$api$user$verify
Compatible to NDEx server version 2.0
## Establish a server connection # ndexcon = ndex_connect() ## Find user and get its id # user = ndex_find_user_byName(ndexcon, 'SomeUserName') # userId = user$externalId ## Verify user with verification code # ndex_verify_user(ndexcon, userId, 'Osqy11mRZ9') ## [1] "User account XXX has been activated." NULL
## Establish a server connection # ndexcon = ndex_connect() ## Find user and get its id # user = ndex_find_user_byName(ndexcon, 'SomeUserName') # userId = user$externalId ## Verify user with verification code # ndex_verify_user(ndexcon, userId, 'Osqy11mRZ9') ## [1] "User account XXX has been activated." NULL