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

Reproducible Workflow #226

Open
GuntaasShergill opened this issue Nov 12, 2024 · 2 comments
Open

Reproducible Workflow #226

GuntaasShergill opened this issue Nov 12, 2024 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@GuntaasShergill
Copy link

GuntaasShergill commented Nov 12, 2024

Hello,

I hope you're doing well. Thank you for creating this package. I had 2 questions, pertaining to creating a reproducible workflow:

  1. Is there a way to use RCy3 to generate the same networks each time by setting a seed? I question the presentability of the my results if am unable to recreate it, thus I was looking for a way to make network generation reproducible.

  2. I am using WGCNA, so I am creating networks using Adjacency and TOM. Interestingly Cytoscape (individually and with RCy3) treats Adjacency as a weight in the form of distance (nodes with higher weight further away) whereas TOM weight is interpreted in the form of strength of connection (nodes with higher weight closer). Is there any way to explicitly indicate to RCy3 that weight should be interpreted as strength of connection.

Thank you so much for your time and attention!

@AlexanderPico AlexanderPico self-assigned this Nov 12, 2024
@AlexanderPico AlexanderPico added the question Further information is requested label Nov 12, 2024
@AlexanderPico
Copy link
Member

Thanks for your questions!

  1. Overall, RCy3 does not have a random or stochastic step requiring a seed. It should reproduce the same output every time. Perhaps there is a particular layout or app you are using that does have a random step? I'd need to know which step you believe requires seed in order to advise on how to provide it. In general, one of the main reasons I use RCy3 is to reproduce work and I don't provide a seed.

  2. If you look at the settings for any Cytoscape edge-weighted layout (screenshot) you have the option to set how you want the weights to be treated. You can set any of these parameters via RCy3. I often test out the syntax via the Command Line interface (screenshot). Try: help layout force-directed to see all the options.

Screenshot 2024-11-12 at 3 35 01 PM Screenshot 2024-11-12 at 3 37 20 PM

@GuntaasShergill
Copy link
Author

GuntaasShergill commented Nov 14, 2024

Thank you so much for the response Dr. Pico!

  1. I was using Edge-Weighted Spring Embedded layout (Kamada-Kawai), this must have been the root cause of the randomness as I do not observe the randomness in network generation in prefuse force directed layout - as you pointed out. I will continue to use this layout. Thank you!

  2. I was experimenting with this prior to using RCy3 and for some reason upon changing settings particularly "Edge column that contains the weight" and "How to interpret weight values" however it doesn't seem clicking "apply layout" reflects those changes. I have attached pictures of the plot before and after applying layout, the color represents the pearson correlation relative to the central gene (who's adjacency I'm showing relative to all other genes), so dark green and red nodes should be closer to the circle (as seen in the before plot), since weights are based on adjacency (power function applied pearson correlation) but it becomes random after applying layout.

Choosing the correct options, clicking done, and generating the networks again using RCy3, instead of applying layout seems to bring the desired result - however, only when using "normalized value". When choosing "1 - normalized value", the layout is once again random rather than inverse of the "normalized value" layout.

  1. Something I noticed, which is trivial, is that I'm unable to create a network: createNetworkFromDataFrames(), when using node (500 nodes) and edge files (500x500 = 250000 edges) which create a network larger than the view threshold on cytoscape prompting the popup "Do you want to create a view for your large networks now?". The code does not progress past this line (I waited 5-6 minutes), so I manually loaded the network from table, on cytoscape and it took only 10 seconds, so I don't believe this issue is associated with the network being too large). I then proceeded with the rest of the RCy3 code to make the desired modifications. Is this an issue on my end? As I assume many people use RCy3 to create large networks everyday.

Overall, my problem is resolved thanks to your generous input and any further feedback would just be a plus. Thank you so much for your time and insight

Plot Before:
Plot Before

Settings:
Settings

Plot After:
Plot After

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

No branches or pull requests

2 participants