This functions add nodes in the form of a
Nodes object to an other
Nodes or an
1 2 3 4 5 6 7
logical (optional); whether to stop, if duplicates in
logical (optional); if ids are re-assigned, the original ids are kept in the column
When nodes should be added to a
Nodes or a
RCX-object object some conflicts may rise, since the aspects might use
the same IDs. If the aspects do not share any IDs, the two aspects are simply combined. Otherwise, the IDs of the new nodes are re-assinged
continuing with the next available ID (i.e.
maxId(nodesAspect) + 1 and
maxId(rcx$nodes) + 1, respectively).
To keep track of the changes, it is possible to keep the old IDs of the newly added nodes in the automatically added column oldId.
This can be omitted by setting keepOldIds to
Otherwise, if a re-assignment of the IDs is not desired, this can be prevented by setting stopOnDuplicates to
This forces the function to stop and raise an error, if duplicated IDs are present.
Nodes or RCX object with added nodes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
## create some nodes nodes1 = createNodes(name = c("EGFR","AKT1","WNT")) nodes2 = createNodes(name=c("CDK1", "CDK2", "CDK3"), represents=c("HGNC:CDK1", "Uniprot:P24941", "Ensembl:ENSG00000250506")) ## simply add the nodes and keep old ids nodes3 = updateNodes(nodes1, nodes2) ## add the nodes nodes4 = updateNodes(nodes1, nodes2, keepOldIds=FALSE) ## force an error because of duplicated ids try(updateNodes(nodes1, nodes2, stopOnDuplicates=TRUE)) ## =>Error: ## Elements of "id" (in updateNodes) must not contain duplicates! ## create an RCX object with nodes rcx = createRCX(nodes1) ## add additional nodes rcx = updateNodes(rcx, nodes2, keepOldIds=FALSE) ## force an error becauses of duplicated ids try(updateNodes(rcx, nodes2, stopOnDuplicates=TRUE)) ## =>Error: ## Elements of "id" (in updateNodes) must not contain duplicates!
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.