rcxToJson: Convert RCX aspects to JSON

View source: R/Json-toJson.R

rcxToJsonR Documentation

Convert RCX aspects to JSON

Description

Functions for converting the different aspects to JSON following the CX data structure definition (see NDEx documentation: https://home.ndexbio.org/data-model/).

Usage

rcxToJson(aspect, verbose = FALSE, ...)

## Default S3 method:
rcxToJson(aspect, verbose = FALSE, ...)

## S3 method for class 'MetaDataAspect'
rcxToJson(aspect, verbose = FALSE, ...)

## S3 method for class 'NodesAspect'
rcxToJson(aspect, verbose = FALSE, ...)

## S3 method for class 'EdgesAspect'
rcxToJson(aspect, verbose = FALSE, ...)

## S3 method for class 'NodeAttributesAspect'
rcxToJson(aspect, verbose = FALSE, ...)

## S3 method for class 'EdgeAttributesAspect'
rcxToJson(aspect, verbose = FALSE, ...)

## S3 method for class 'NetworkAttributesAspect'
rcxToJson(aspect, verbose = FALSE, ...)

## S3 method for class 'CartesianLayoutAspect'
rcxToJson(aspect, verbose = FALSE, ...)

## S3 method for class 'CyGroupsAspect'
rcxToJson(aspect, verbose = FALSE, ...)

## S3 method for class 'CyHiddenAttributesAspect'
rcxToJson(aspect, verbose = FALSE, ...)

## S3 method for class 'CyNetworkRelationsAspect'
rcxToJson(aspect, verbose = FALSE, ...)

## S3 method for class 'CySubNetworksAspect'
rcxToJson(aspect, verbose = FALSE, ...)

## S3 method for class 'CyTableColumnAspect'
rcxToJson(aspect, verbose = FALSE, ...)

## S3 method for class 'CyVisualPropertiesAspect'
rcxToJson(aspect, verbose = FALSE, ...)

## S3 method for class 'CyVisualProperty'
rcxToJson(aspect, verbose = FALSE, propertyOf = "", ...)

## S3 method for class 'CyVisualPropertyProperties'
rcxToJson(aspect, verbose = FALSE, ...)

## S3 method for class 'CyVisualPropertyDependencies'
rcxToJson(aspect, verbose = FALSE, ...)

## S3 method for class 'CyVisualPropertyMappings'
rcxToJson(aspect, verbose = FALSE, ...)

Arguments

aspect

aspects of an RCX object

verbose

logical; whether to print what is happening

...

additional parameters, that might needed for extending

propertyOf

character; provide propertyOf (only necessary for CyVisualProperty)

Details

For converting RCX objects to JSON, each aspect is processed by a generic function for its aspect class. Those functions return a character only containing the JSON of this aspect, which is then combined by toCX to be a valid CX data structure.

To support the conversion for non-standard or own-defined aspects, generic functions for those aspect classes have to be implemented.

Value

character; JSON of an aspect

See Also

toCX, writeCX, jsonToRCX, readCX

Examples

nodes = createNodes(name = c("a","b","c","d","e","f"))
rcxToJson(nodes)

frankkramer-lab/RCX documentation built on Feb. 4, 2023, 5:12 p.m.