Meta-data: Update RCX meta-data

Meta-dataR Documentation

Update RCX meta-data

Description

The meta-data aspect contains meta-data about the aspects in the RCX object. It can be generated automatically based on the aspects present in a RCX object:

  • for version and consistencyGroup default values are used

  • idCounter is inferred with hasIds and maxId of an aspect

  • elementCount is inferred from countElements

  • properties is left out by default

Usage

updateMetaData(
  x,
  version = NULL,
  consistencyGroup = NULL,
  properties = NULL,
  aspectClasses = getAspectClasses()
)

## S3 method for class 'RCX'
updateMetaData(
  x,
  version = NULL,
  consistencyGroup = NULL,
  properties = NULL,
  aspectClasses = getAspectClasses()
)

## Default S3 method:
updateMetaData(
  x,
  version = NULL,
  consistencyGroup = NULL,
  properties = NULL,
  aspectClasses = getAspectClasses()
)

Arguments

x

RCX object or an aspect of a RCX; its class must be one of the standard RCX aspect classes

version

named character (optional); version of the aspect (default:"1.0")

consistencyGroup

named numerical (optional); consistency group of the aspect (default:1)

properties

named list (optional); properties that need to be fetched or updated independently of aspect data

aspectClasses

named character; accession names and aspect classes aspectClasses

Details

If version, consistencyGroup or properties should have a different value, they can be set using a named vector (or named list for properties), where the name must be an accession name of that aspect in the RCX-object (e.g. nodes or cyVisualProperties).

Besides being a named list by aspect accession name, properties must also contain the single key-value pairs as a further named list. To remove all key-value pairs for one aspect, an empty list can be provided instead of a list with key-value pairs. To simplify adding of properties to a single aspect, there is the updateMetaDataProperties function available.

Value

MetaDataAspect object or RCX object

Note

The meta-data will always be updated automatically, when an aspect is added to or changed in the RCX object.

See Also

updateMetaDataProperties

Examples

## prepare RCX object:
nodes = createNodes(name = c("a","b","c","d","e","f"))
edges = createEdges(source=c(1,2,0,0,0,2), 
                    target=c(2,3,1,2,5,4))
rcx = createRCX(nodes, edges)
cySubNetworks = createCySubNetworks(
  id = c(1,2),
  nodes = list("all", c(1,2,3)),
  edges = list("all", c(0,2))                    
)
rcx = updateCySubNetworks(rcx, cySubNetworks)

## update meta-data manually
rcx = updateMetaData(rcx)

## update meta-data with some values
rcx = updateMetaData(rcx,
                     version=c(edges="2.0"),
                     consistencyGroup=c(nodes=3),
                     properties=list(cySubNetworks=list(some="value",
                                                        another="VALUE"),
                                     edges=list(some="edge",
                                                another="EDGE")))

## remove all properties for edges
rcx = updateMetaData(rcx, properties=list(edges=list()))

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