Interface CyJSONUtil


  • public interface CyJSONUtil
    This interface provides some very basic JSON representations of Cytoscape objects. The implementation of this interface should be included as part of a core app, to allow updates to the schemas outside of the regular Cytoscape release cycle. As a guideline, any JSON produced should be compatible with both R (using JSONIO) and python (using pandas).
    Author:
    David Otasek (dotasek.dev@gmail.com)
    • Method Detail

      • toJson

        String toJson​(CyIdentifiable cyIdentifiable)
        Returns a reference (via SUID) for a CyIdentifiable.
        Parameters:
        cyIdentifiable -
        Returns:
        a reference (via SUID) for a CyIdentifiable.
      • cyIdentifiablesToJson

        String cyIdentifiablesToJson​(Collection<? extends CyIdentifiable> collection)
        Returns a list of references (via SUID) for a collection of CyIdentifiable.
        Parameters:
        collection -
        Returns:
        a list of references (via SUID) for a collection of CyIdentifiable.
      • toJson

        String toJson​(CyNetwork network,
                      CyNode cyNode,
                      CyColumn... columns)
        Returns a JSON representation of a single CyNode and its relevant data. This JSON will be identical to the relevant row in the node table.
        Parameters:
        network -
        cyNode -
        columns - The columns to be included in the output. If none are passed, return all.
        Returns:
        a JSON representation of a single CyNode and its relevant data.
      • toJson

        String toJson​(CyNetwork network,
                      CyEdge cyEdge,
                      CyColumn... columns)
        Returns a JSON representation of a single CyEdge and its relevant data. This JSON will be identical to the relevant row in the edge table, with the exception of additional source and target columns.
        Parameters:
        network -
        cyEdge -
        columns - The columns to be included in the output. If none are passed, return all.
        Returns:
        a JSON representation of a single CyEdge and its relevant data.
      • toJson

        String toJson​(CyNetwork cyNetwork)
        Returns a JSON representation of a network and its relevant data. This JSON will be identical to the relevant row in the network table.
        Parameters:
        cyNetwork -
        Returns:
        a JSON representation of a network and its relevant data.
      • toJson

        String toJson​(CyTable cyTable,
                      boolean includeDefinition,
                      boolean includeRows)
        Returns a JSON representation of a CyTable. The output can be customized to provide table definition information, as well as the rows in the table. Note that setting both includeDefinition and includeRows to false will result in an empty JSON object.
        Parameters:
        cyTable -
        includeDefinition - defines whether or not to include definitions like table name in the output.
        includeRows - defines whether or not to include the table's row data in the output.
        Returns:
        a JSON representation of a CyTable
      • cyColumnsToJson

        String cyColumnsToJson​(Collection<CyColumn> collection)
        Returns a list of references (via column name) for a collection of CyColumn.
        Parameters:
        collection -
        Returns:
        a list of references (via column name) for a collection of CyColumn
      • toJson

        String toJson​(CyColumn cyColumn,
                      boolean includeDefinition,
                      boolean includeValues)
        Returns a JSON representation of CyColumn. The output can be customized to provide column definition information, as well as the values in the column. Note that setting both includeDefinition and includeValues to false will result in an empty JSON object.
        Parameters:
        cyColumn -
        includeDefinition - defines whether or not to include definitions like column name in the output.
        includeValues - defines whether or not to include the column's data in the output.
        Returns:
        a JSON representation of a CyColumn.
      • toJson

        String toJson​(CyRow cyRow,
                      CyColumn... columns)
        Returns a JSON representation of a table row.
        Parameters:
        cyRow -
        columns - The columns to be included in the output. If none are passed, return all.
        Returns:
        a JSON representation of a table row.