Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.8.4 release #31

Merged
merged 36 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
6fa21f4
Minor update about how NaN and Infinity are handled in CX2.
jingjingbic May 24, 2023
5700a7b
Minor update about NaN and Infinity handling.
jingjingbic May 24, 2023
79839cd
Ignore double values such as NaN, Infinity and -Infinity when exporting
jingjingbic Aug 4, 2023
be79129
Adding HCX spec as a new post. Make cx and cx2 spec link permanent.
jingjingbic Aug 17, 2023
bb8f0fa
Minor revision in hcx spec. 1. removed host name from networkAttribut…
jingjingbic Aug 24, 2023
0134c5f
Minor revision. Disallow declaring default value and alias for networ…
jingjingbic Aug 30, 2023
b4d8419
Adding HCX::memberName to the HCX spec.
jingjingbic Oct 7, 2023
3f673d9
fix the broken link for visualEditorProperties
jingjingbic Oct 7, 2023
53fac51
Resolve UD-2584. Support "type" attribute in cx2 mapping definition.
jingjingbic Oct 11, 2023
b80cc10
Bug fix. CX2 exporter gave errors when exporting a network that has
jingjingbic Oct 12, 2023
63af099
Remove the option of writing collection out to cx or cx2 from export UI.
jingjingbic Oct 12, 2023
9094d6c
Fix UD-2608. When importing a cx2 network, skip the fitcontent() call if
jingjingbic Oct 13, 2023
4e2c198
Bug fix. CX IDs were not preserved when writing cx out.
jingjingbic Oct 13, 2023
8f3d525
Update date on the cx2 spec docs
jingjingbic Oct 17, 2023
141b6d9
Clearify the behavior when success is true and error message exists in
jingjingbic Oct 31, 2023
9f8daec
Rename attribute HCX::memberName to HCX::memberNames to be consistent
jingjingbic Nov 6, 2023
8efc35d
Remove time from the date attribute in the front matter section.
jingjingbic Nov 6, 2023
3f610a3
Correcting typos and adding clarification regarding Hiview behavior when
jingjingbic Nov 6, 2023
b7f1e72
Fix UD-2668.
jingjingbic Nov 23, 2023
ed763d9
Fix UD-2675. Mapping on Edge unselected color was not handled correctly
jingjingbic Dec 5, 2023
41fc7f3
Bug fixes in cx2 exporter importer relates to complex VP values.
jingjingbic Dec 8, 2023
f759497
UD-2769 in progress. Minor refactoring.
jingjingbic Feb 6, 2024
b7f703f
Adding support of custom graphics in CX2 IO (UD-2769). Also gives
jingjingbic Feb 8, 2024
7d07f3e
Remove snapshot from ndex object model.
jingjingbic Feb 15, 2024
289a1ca
Resolve UD-2799. Adding null checker in places.
jingjingbic Feb 22, 2024
68ae63a
Adding HCX to the index file of GH page.
jingjingbic Feb 24, 2024
03e5691
Formating the HCX example file and fix the hcx example link
jingjingbic Feb 24, 2024
27696d5
Move the new hcx doc to /cx2/hcx-pecification, and put the old one on…
jingjingbic Feb 26, 2024
3a76b3a
Minor fix in HCX spec.
jingjingbic Mar 4, 2024
8f5ba52
Bump up ndex-object-model to 2.5.7-SNAPSHOT to resolve CYTOSCAPE-13147.
jingjingbic Aug 6, 2024
17dc87e
Change version in pom.xml from 2.8.4-snapshot to 2.8.4.
jingjingbic Sep 12, 2024
b97f970
Update the version of some dependencies.
jingjingbic Sep 13, 2024
5fbe9b5
No real change
GAOChengzhan Sep 13, 2024
03b6c21
Solved the bug on network visual properties
GAOChengzhan Sep 14, 2024
c6a20d9
Clean useless code
GAOChengzhan Sep 14, 2024
506d7bc
Merge pull request #30 from cytoscape/UD-2932
jingjingbic Sep 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ description: >- # this means to ignore newlines until "baseurl:"
Documentation of Cytoscape Exchange Format
baseurl: "/cx" # the subpath of your site, e.g. /blog
url: "https://www.cytoscape.org" # the base hostname & protocol for your site, e.g. http://example.com
twitter_username: jekyllrb
permalink: /:categories/:title/


github_username: jingjingbic

# Build settings
Expand All @@ -35,6 +37,10 @@ theme: minima
plugins:
- jekyll-feed

collections:
excluded_posts:
output: true

# Exclude from processing.
# The following items will not be processed, by default.
# Any item listed under the `exclude:` key here will be automatically added to
Expand Down
254 changes: 254 additions & 0 deletions docs/_excluded_posts/2023-08-09-hcx-specification.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
---
layout: post
title: Hierarchical Network Schema for CX (Version 0.1)
date: 2023-11-06
collection: excluded_posts
categories: schema
permalink: /:categories/:title/
published: true
---

This document outlines the CX schema designed to store hierarchical structures within a CX network. Within Ideker Lab's applications, a hierarchy typically encompasses two distinct data categories:

1. An interaction (or similarity) network.
2. A hierarchy that is derived from the aforementioned interaction network.

The hierarchy and the interaction network can be stored in one or more CX files, contingent upon specific application requirements. This CX schema is designed for Cytoscape-Hiview integration, it should also cover other common use cases in Ideker Lab.

Applicable solely to CX version 2 (CX2) only, this schema accommodates two primary storage models:

1. **Multi-file model** - In this approach, hierarchies and associated interaction network(s) reside within two or more CX files. This model aligns with our usage in Cytoscape Web.
2. **Single file model** - This model contains only one CX file. Its major use case is for archival.

## **Multi-file model**

In this model, the complete data set contains one network for the hierarchy, and one or more networks for the interaction networks. These networks can be stored as flat files in the file system. They can also be stored as CX networks in NDEx or a Cytoscape Web workspace.

![HCX 2 file model]({{ site.baseurl }}/assets/img/HCX-2-file-model.png)

### Hierarchy network

This network stores the hierarchy derived from the interaction network, including its visual styles and layouts. In general, users can put any attributes on nodes and edges, and the network. However, this schema adds these constraints to some of the core aspects.

#### networkAttributes
It should contain these attributes
1. Attribute name: **ndexSchema**

Attribute value type: string

Attribute value: hierarchy_v0.1

2. Attribute name: **HCX::modelFileCount**

Attribute value type: integer

Attribute value: Should be greater than 1. It is the actual count of all the files that this hierarchy references, including the hierarchy itself. This is the value that can be used to decide the type of a model file. 1 is a single file model and all other values means this is a multi-file model.

**Note**: nodes on this hierarchy can point to its own interaction network. It is normally a subnetwork of the top level interaction network, but it can also be any network.

3. One of these attributes to link to the interaction network.

- Attribute name: **HCX::interactionNetworkUUID**

Value: uuid of the interaction network. If the interaction network is stored on a NDEx server, this attribute should contain the uuid of that network. If the interaction network is a local network in users current Cytoscape Web workspace, this attribute contains the local uuid of that network.

<!---
- Attribute name: **HCX::interactionNetworkHost**

Attribute type: string

Attribute value: host name of the NDEx server that stores the interaction network.

NOTE: For production NDEx, use www.ndexbio.org as the hostname.

This attribute should only be populated when HCX::interactionNetworkUUID is defined. If this value is null or this attribute is missing, the HCX::interactionNetworkUUID value should be treated as a Cytoscape Web local network UUID in the currently opened workspace.
--->
- Attribute name: **HCX::interactionNetworkName**

Value: file name as a string, assume the file is located in the same directory of the hierarchy

- Attribute name: **HCX::interactionNetworkURL**

Value: a URL which points to the interaction network.

**Note**: If each node in the hierarchy points to its own interaction network, it is possible to omit the interaction links at the network level.


#### nodes

Each node in the hierarchy should have this attribute:
- Attribute name: **HCX::isRoot**

Attribute value type: boolean

Attribute value: Root node should have value true and all other nodes should have false on this attribute.

A node in the hierarchy can link to a subnetwork in the parent interaction network or a separate network. The linkage can be established using one of these attributes on a node in the hierarchy.

- Attribute name: **HCX::members**

Attribute value type: list of long

Attribute value: list of CX IDs of nodes in the interaction network. It is similar to the CD_memberList attribute in the hierarchy network generated by the CDAPS app in Cytoscape.

- Attribute name: **HCX::memberEdges**

Attribute value type: list of long

Attribute value: list of CX IDs of edges in the interaction network.

- Attribute name: **HCX::interactionNetworkUUID**, **HCX::interactionNetworkName** or **HCX::interactionNetworkURL**

Attribute value type: string

Attribute value: Using one of these attributes, a node can declare its own interaction network. When one of these attributes exists, it overwrites the value declared in the networkAttributes aspect.

<!--
- Attribute name: **HCX::size**

type: integer

Description: Hiview utilizes this value to determine the node size in the circle-packing layout. Typically, this value represents the number of genes (or proteins) within a subsystem. However, users have the flexibility to assign alternative meanings to this attribute, provided the value assigned to a parent node consistently remains larger than that assigned to a child node. In instances where this attribute is absent, Hiview defaults to utilizing the element count of the attribute **HCX::member** for the **HCX::size** value. Should neither **HCX::member** nor **HCX::size** be defined for at least one node, the circle-packing layout option will be disabled in Hiview.
-->

- Attribute name: **HCX::memberNames**

type: list of string

Description: Hiview uses this value to tag each member node in the circle-packing layout. Each element in this list need to be unique. Typically, each value in this list is the gene symbol of a member within a subsystem. However, users have the flexibility to assign alternative identifiers to this attribute. If this attribute is absent, Hiview will default to using the name attribute of the nodes specified in the **HCX::members** attribute for the node label. If neither **HCX::members** nor **HCX::memberNames** is defined for at least one node, the circle-packing layout option will be deactivated in Hiview. If both **HCX::members** and **HCX::memberNames** exist on a node, Hiview uses **HCX::members**.


- Attribute name: **HCX::memberQuery**

Attribute value type: string

Attribute value: a JSON string which describes a query on the interaction network. It has this structure:

```javascript
{
"nodes": {
"attribute": string // name of the attribute
"values": list of values
},
"edges": {
"attribute": string
"operator": string // supported values are ">", "=", "<" or "in"
"value": single value or a list of values
}
}
```

For example: this JSON structure


```javascript

{
"nodes":
{
"attribute": "name",
"values": ["AKT1", "MTOR","EGFR" ]
}
"edges": {
"Attribute":"score",
"operator": ">",
"value": 0.6
}
}
```

means this node links to a subnetwork derived from a direct query starting from nodes which have "AKT1","MTOR" or "EGFR" on its name,and the edges with score value above 0.6 between the starting nodes.

#### edges

Edges are directed. In the majority of our hierarchical networks, we adhere to the convention of designating the child node as the target node for each edge. However, users can opt to reverse the edge direction if it aligns more effectively with their use case.

#### Visualization of the hierarchy

The core aspects store the ball-and-stick (classic) view of the hierarchy, which includes a layout and one or many visual styles.

The default visual style for the classic view is stored in the visualProperties aspect. If the classic view has more than one style defined on it, these additional styles should be named and they should be stored in the otherVisualProperties aspect. This is the structure of the otherVisualProperties aspect:

```javascript
{
otherVisualProperties: [
{
"name": string // name of the style
"visualProperties": [
//Visual properties and mapping rules defined in the style.
]
}
]
}
```

Visualization data for circle-packing (Hiview) view are stored in these two aspects

1. circlePackingLayouts: This aspect contains the layout information for Hiview. It has this data structure:

```javascript
{
circlePackingLayouts:
[ {
"id": string // unique id
"cxId": //CX Id of node this circle represents
"X": number // x coordinate of the circle
"Y": number // y coordinate of the circle
"R": number // radius of the circle
"depth": integer // steps to the root node. It should be a non-negative integer.
"type": gene or assembly //
}
]
}
```

For circle packing Depth is 0 for root node (blue) as seen in this figure

![]({{ site.baseurl }}/assets/img/ball_n_stick_depth.png)

2. circlePackingStyles:

```
{
visualProperties and mappings
}
```

### Interaction network

There is no special requirements for the interaction network(s) in the multi-file model.

## **Single-file model**

In this model, a hierarchy and its interaction network are stored in a single CX network. The hierarchy is stored in the core aspects, such as "nodes" and "edges" aspects, and interaction network data are stored in opaque aspects prefixed with "interactionNetwork::" in the aspect name.

![HCX 2 file model]({{ site.baseurl }}/assets/img/HCX-1-file-model.png)

### Constraints on core CX aspects
In general, users can put any attributes on nodes and edges, and the network. However, this schema adds these constraints to some of the core aspects.

#### networkAttributes

It should contain these 2 attributes
1. Attribute name: **ndexSchema**

Attribute value type: string

Attribute value: hierarchy_v0.1

2. Attribute name: **HCX::modelFileCount**

Attribute value type: integer

Attribute value: 1

#### Nodes

All specifications regarding node attributes in the multi-file model apply to the nodes in the single-file model, with the exception that the HCX::interactionNetworkUUID, HCX::interactionNetworkName, and HCX::interactionNetworkURL attributes are not supported.

#### Interaction network

The data of the interaction network are stored in aspects that are prefixed with "interactionNetwork::". For example

interactionNetwsork::attributeDeclarations aspect stores the attributeDeclarations aspect of the interaction network, and interactionNetwork::nodes aspect stores the nodes aspect of the interaction network. The interaction network can contain any number of styles on it using the scheme we detailed in the "Visualization of the hierarchy" section. The only difference is that these aspects need to be prefixed with "interactionNetwork::" in the single file model.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: "Cytoscape Exchange Format Specification (Version 1)"
date: 2022-01-11
categories: specification
image: assets/img/datamodel1.png
order: 10
---


Expand Down
Loading
Loading