Layout Using Node Attributes

69 views
Skip to first unread message

Bill

unread,
Nov 12, 2012, 2:18:52 PM11/12/12
to biofabr...@googlegroups.com
The "Layout Using Node Attributes" feature is the way that the user can explicitly specify the ordering of the node rows in a BioFabric presentation.  Once you specify the node order, the program then goes on to layout the edges using its standard technique.  To layout both nodes and edges,
you would do this step first, followed by the "Layout Using Link Attributes" feature that I will cover in a future posting.

To use this feature, select Layout->Layout Using Node Attributes... from the main menu.  You will then be prompted to specify a node attribute file.  This file follows the traditional Cytoscape format, and is usually tagged with an .na or .noa suffix.  After this file is specified, BioFabric will relayout the network using this directive.

So what is the format of the file?  Basically, each line of the file is of the form "nodeName = rowNumber".  Here are some rules:

1) EVERY node needs to appear in this file.  If a node is missing, you will get an error.
2) A node can only appear once in the file.  If a node is duplicated, you will get an error.
3) There can be NO gaps in the row assignments.  If there is a gap, you will get a error.
4) The row numbers start with 0 (zero).  Start with 1, that's an error. Sorry, I've been a C programmer for over 25 years; my bad.
5) The first row of the file must read "Node Row" (without the quotes).
6) Make sure the last line of the file has a newline.

I'm sorry, the error message is terse and not very informative.  Something on the todo list for when/if I get the resources to build version 2.

So here is a snippet of a file for a network with 2666 nodes:

Node Row
LAPTM5 = 0
AFF3 = 1
STAT4 = 2
CD79A = 3
HPN = 4
...
BMP4 = 2665

If you have an ordered list of node names in a text file "ListOfNodes.txt", this Unix command line will get you the desired attributes file:

cat ListOfNodes.txt | awk '{print $1 " = " NR-1}' | sed '1 i Node Row' > RowAssignments.noa

Questions?  Feel free to post them...

Bill

 
Reply all
Reply to author
Forward
0 new messages