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

Group attribute layout with certain ordering of the members? #126

Open
gmhhope opened this issue Dec 17, 2023 · 4 comments
Open

Group attribute layout with certain ordering of the members? #126

gmhhope opened this issue Dec 17, 2023 · 4 comments

Comments

@gmhhope
Copy link

gmhhope commented Dec 17, 2023

Hi Barry,

Trying to use group attribute to do layout, at the same time ordering the members in the group with a fixed order? What might be a good way to do that? How the order was settled in cytoscape?
Screenshot 2023-12-17 at 2 16 22 PM

I am in very urgent need for this settled. Thanks for any input you can provide!

Thanks very much! Happy holiday!

Best,
Minghao Gong

@bdemchak
Copy link
Collaborator

Hi, Minghao ... Glad to see you working on this. I see the screenshot. Is this a circular layout? If so, what column did you use as the key, and how would you like for this to look instead?

@gmhhope
Copy link
Author

gmhhope commented Dec 17, 2023

Thanks for the prompt response Barry!

I want this to be ordered by Factor #. I would like to make it work both using Circular layout or Group Attribute layout. Both based on two groups (being HC, shown in the screenshot as well as other groups). So the column I used here is anything like "group", "tag" or whatever with character-type string

Hope that clarify.

Best,
Minghao Gong

@bdemchak
Copy link
Collaborator

Hi, Minghao Gong -

I have a question into the developers about this ... they haven't answered yet. When they do, I'll relay the information I get.

Thanks!

@GeneCodeSavvy
Copy link
Collaborator

GeneCodeSavvy commented Sep 1, 2024

@gmhhope

Hi Minghao Gong,

I noticed this question is from a while back, but if you’re still looking for a solution or if it might help others, I wanted to share a potential approach!

https://github.com/user-attachments/assets/8bbb487c-35e9-4ef3-8584-738b86d1c739
Here’s a step-by-step breakdown of how you can arrange nodes in a fixed order:

  1. Export the Node Table:

    • Start by exporting your node table from Cytoscape. This will generate a file containing the nodes and their attributes.
  2. Add the 'Order' Column:

    • Open the exported file in a spreadsheet editor (e.g., Excel). Add a new column named order, and fill in the values according to the desired node sequence. For large networks, automating this process programmatically might be more efficient.
  3. Import the Updated Table Back into Cytoscape:

    • Navigate to File → Import → Table from File....
    • Select your updated file (with the order column).
    • In the Target Table Data section, choose where to import the data (e.g., your existing network).
    • For more details on this process, check out the Cytoscape manual.
  4. Use the 'Order' Column for Layout:

    • Once imported, utilize the order column to guide the layout arrangement of your nodes.

Bonus: You can further refine the layout using the Layout → Layout Tools options for scaling, aligning, distributing, stacking, and rotating the network and selected nodes.

Hope this helps!

Best,
Harsh Sharma

cc: @bdemchak

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants