toCX | R Documentation |
This function converts an RCX object to JSON in a valid CX data structure (see NDEx documentation: https://home.ndexbio.org/data-model/).
toCX(rcx, verbose = FALSE, pretty = FALSE)
rcx |
RCX object |
verbose |
logical; whether to print what is happening |
pretty |
logical; adds indentation whitespace to JSON output.
Can be TRUE/FALSE or a number specifying the number of spaces to indent. See |
The single aspects of the RCX object are processed by generic functions of rcxToJson for each aspect class. Therefore, not only the single aspects are converted to JSON, but also necessary additional aspects are added, so the resulting CX is accepted by the NDEx platform (https://ndexbio.org/):
numberVerication shows the supported maximal number
status is needed at the end to show, that no errors have occurred while creation
If the RCX object contains additional aspects besides the officially defined ones, the corresponding rcxToJson functions for those aspect classes have to be implemented in order to include them in the resulting CX.
CX (JSON) text
toCX, rcxToJson, readCX, writeCX
rcx = createRCX( nodes = createNodes( name = LETTERS[seq_len(10)] ), edges = createEdges( source=c(1,2), target = c(2,3) ) ) json = toCX(rcx, pretty=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.