CyHiddenAttributes: Cytoscape hidden attributes

CyHiddenAttributesR Documentation

Cytoscape hidden attributes

Description

This function is used to create Cytoscape hidden attributes aspects.

Usage

createCyHiddenAttributes(
  name,
  value,
  dataType = NULL,
  isList = NULL,
  subnetworkId = NULL
)

Arguments

name

character; key of the attribute

value

character or list of character; value of the attribute

dataType

character (optional); data type of the attribute

isList

logical (optional); a value should be considered as list

subnetworkId

integer (optional); refers to the IDs of a subnetwork aspect, but left blank (or NA) if root-network

Details

Cytoscape contributes aspects that organize subnetworks, attribute tables, and visual attributes for use by its own layout and analysis tools. Furthermore are the aspects used in web-based visualizations like within the NDEx platform.

Besides network attributes, networks may have additional describing attributes originated from and used by Cytoscape. They are also defined in a key-value like manner, with the name of the attribute as key. The same attribute can also be defined for different subnetworks with different values. The values itself may differ in their data types, therefore it is necessary to provide the values as a list of the single values instead of a vector.

With isList it can be set, if a value should be considered as a list. This is of minor significance while working solely with RCX objects, unless it will be transformed to JSON. For some attributes it might be necessary that the values are encoded as lists, even if they contain only one element (or even zero elements). To force an element to be encoded correctly, this parameter can be used, for example: name="A", value=a, isList=T will be encoded in JSON as A=["a"].

Value

CyHiddenAttributesAspect object

See Also

updateCyHiddenAttributes;

Examples

## a minimal example
hiddenAttributes = createCyHiddenAttributes(
  name="A", 
  value="a"
)

## defining several properties at once
hiddenAttributes = createCyHiddenAttributes(
  name=c("A", "B"), 
  value=c("a","b")
)

## with characters and numbers mixed
hiddenAttributes = createCyHiddenAttributes(
  name=c("A","B"),
  value=list("a",3.14)
)

## force the number to be characters
hiddenAttributes = createCyHiddenAttributes(
  name=c("A","B"),
  value=list("a",3.14),
  dataType=c("character","character")
)

## with a list as input for one value
hiddenAttributes = createCyHiddenAttributes(
  name=c("A","B"),
  value=list(c("a1","a2"),
             "b")
)

## force "B" to be a list as well
hiddenAttributes = createCyHiddenAttributes(
  name=c("A","B"),
  value=list(c("a1","a2"),
             "b"),
  isList=c(TRUE,TRUE)
)

## with a subnetwork
hiddenAttributes = createCyHiddenAttributes(
  name=c("A","A"),
  value=c("a","a with subnetwork"),
  subnetworkId=c(NA,1)
)

## with all parameters
hiddenAttributes = createCyHiddenAttributes(
  name=c("A","A","B","B"),
  value=list(c("a1","a2"),
             "a with subnetwork",
             "b",
             "b with subnetwork"),
  isList=c(TRUE,FALSE,TRUE,FALSE),
  subnetworkId=c(NA,1,NA,1)
)

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