Skip to content

Instantly share code, notes, and snippets.

@keiono
Created August 30, 2012 19:55
Show Gist options
  • Save keiono/3539300 to your computer and use it in GitHub Desktop.
Save keiono/3539300 to your computer and use it in GitHub Desktop.
Cytoscape 3 Data Import UX

##Cytoscape 3 Data Import UX

Scinario 1: Multiple Species Session

=====================

User Data

  • n mouse network files
  • m human network files
  • 1 expression data for mouse
  • 1 expression data for human

####Steps

  1. File > Import > Network > File
  2. Select a mouse network file and load
  3. It creates a new (root) network
  4. Load a second mouse network file
  5. User will be asked to choose from the following options a. Add network existing network collection b. Create a new network collection
  6. User should choose a to add it to mouse network group
  7. Reoeat 4-6 for n-2 times to create a mouse network collection sharing same root
  8. Repeat the above for n networks for human
  9. At this point, user have two network collections (root networks), one is for mouse, and the other one is for human.
  10. File > Import > Table > File
  11. Select the mouse expression data file and press OK
  12. User will be asked the following: a. Map to selected network collection(s) - This means map to all networks under the selected roots b. Map to all networks c. Map to selected networks - User picks individual networks. Networks can exist in multiple roots
  13. User selects a and pick mouse network collection (mouse root network)
  14. Expression data sets are mapped to all mouse networks.
  15. Repeat 10-14 for human expression data file

Questions

  • For step 12, if we have option b and c, can we cover a? User have to select all mouse networks manually, but still it gives the same result.

Scinario 2: Map common annotations to networks

=====================

User Data

  • 2 human network files
  • Annnotation file for human genes

Assume annotation table has the following columns:

  1. NCBI Gene ID (Globally Unique)
  2. Official Symbol (BRCA1, etc.)
  3. Gene ontology terms (List of terms)
  4. Aliases (IDs used in other databases)

Steps

  1. Load the annotation file as a global table. Use NCBI Gene ID as primary key
  2. Load two human networks. It can be in same root or two different roots
  3. At this point, we should assume networks have a column (usually NAME) with NCBI Gene ID.
  4. Create links (i.e. create virtual columns) from global table to networks by using NCBI Gene ID and NAME column as join key.
  5. The final network has only one "real" column, NAME. All others are virtual.

This is how Gene Ontology Import function is hadnling annotations (Gene Association files are loaded as global tables). Most of the annotation files for genes/proteins can be linked to the network in this way.

Scinario 3: Import networks and annotations from web services

=====================

User Data

  • None. Just query to the services

Steps

  1. Send query to a web service.
  2. Web service returns network(s) and annotations in their custom data structure. Usually, it contains at least one unique ID field for each node.
  3. Convert returned data structure to CyNetwork. Use unique ID for NAME column of nodes.
  4. Create global table for node annotations. Use uqinque ID as primary key for the global table.
  5. Create links (i.e. create virtual columns) from global table to the new CyNetwork. Join key is the
  6. Create edge columns in local table. In many cases, it does not make sense to create global table for edges since it usually contains network-specific values, such as edge score, publication links, etc.
  7. Now, in the table browser, user can see node table with only one "real" column: NAME. All others are virtual. For edges, network has
  8. Send another query.
  9. Create a new network in existing network collection or create new root. It's user's choice.
  10. Convert to CyNetwork. Again, use same unique ID as NAME.
  11. For each annotation entry in the returned value, check the global table. If it exists, do not add. Otherwise, add a new row in the global table.
  12. Link it to nodes.
  13. Create local edge table values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment