Answers.Body: <p><code>igraph</code> is a serious general network theory framework for any given data science application. It permits full directionality and describes vertices (nodes), edges (branches)  and does cool stuff like De Bruijn graphs and Laplacian graphs. Understanding graph theory would be helpful and will be a steep learning curve. It's a serious data science package.</p>
  <p><code>WGCNA</code> is a specific ready made RNA expression package which appears to be network theory and is undirectional, i.e. no directionality which is fine for RNA expression. It will have far less overall power but if you've a load of RNA-seq data and want 'plug and play' type stuff WGCNA is the only way. It's a correlation network, based on <em>r</em><sup>2</sup> (Pearson's correlation), to assess co-expression. I would assume the weighting is geared towards identifying co-expression. <em>There is an error in Fig. 2 legend</em> BTW Langfelder &amp; Horvath (2008): the legend states r^2 what they mean is <em>r</em><sup>2</sup>. I guess they messed up on their LaTeX.</p>
  <p>If this is a one of coexpression analysis <code>WGCNA</code>. If this is a big project, graph theory is central to that effort and you're looking towards developing a data science tool set then its <code>igraph</code>. There are other graph theory packages BTW.</p>
  <hr />
  <p>In case my answer wasn't clear <code>igraph</code> will do weighted edges via <code>is_weight</code>. The information is <a href="https://igraph.org/r/doc/is_weighted.html" rel="nofollow noreferrer">here</a>, basically it will do anything.</p>
  <p>If your question is &quot;what does weighting contribute to coexpression analysis&quot;, that is a good question. I know graph theory, I dunno the biology of gene expression versus the maths. What <code>WGCNA</code> is doing is statistically is simple if weighting is excluded ... my reasoning is it must be pivotal to its success.</p>
  <hr />
  <p><strong>To address the OPs comments.</strong></p>
  <p><em>Statistical power</em> In the pure sense, I was incorrect to use this term because technically 'lack of power' is the inability to reject a hypothesis when it is false. For example, parametric statistics are more powerful than non-parametric statistics for this reason.</p>
  <p>What I meant was two things:</p>
  <ol>
  <li>In graph theory you can do anything within the &quot;network&quot;, what is called a &quot;graph&quot;, e.g. find the centre of the graph, minimal distance across the &quot;graph&quot;, cyclisation, anything you can think of.</li>
  </ol>
  <p>1a. <code>WGCNA</code> is fixed it only does what is described in Langfelder &amp; Horvath (2008). Nothing can be done outside that without rewriting the underlying code and it would be better to use <code>igraph</code> instead if that was the objective in my opinion.</p>
  <p>Thus <code>igraph</code> is more &quot;powerful&quot; because it will do a lot more stuff.</p>
  <ol start="2">
  <li>My concern of <code>WGCNA</code> is its over-reliance on <em>r</em><sup>2</sup>. This is a parametric statistic and may not always be applicable but from my reading of the paper (albeit briefly) it was entirely dependent on that. To centre everything on <em>r</em><sup>2</sup>, personally  I would at a minimum use <em>r</em> in addition (Spearman's correlation). This is extremely complex data and there is a risk of over-simplification. <em>r</em>  and <em>r</em><sup>2</sup> can certainly give different results.</li>
  </ol>
  <p>The answer to the question however it is not what I think but everyone else thinks and Langfelder &amp; Horvath (2008) has almost 10000 citations. I am not aware that the calculation has been overturned, e.g. DSeq2 has been overturned and demonstrated to be inappropriate. So I would assume it must be capturing the overall picture, so the positives outweigh potential negatives.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-11-30T10:19:56.473Z
Answers.Text: thanks @M__ for your insights into both packages, it has been very useful and  it has been explained in a very concise way the objectives,  do you know why WGCNA present less statistical power.
Answers.UserDisplayName: María José
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-11-30T13:03:35.670Z
Answers.Text: @MaríaJosé I've updated updated the post.
Answers.UserDisplayName: M__
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-11-29T23:44:53.483Z
Answers.LastActivityDate: 2022-11-30T14:46:49.147Z
Answers.LastEditDate: 2022-11-30T14:46:49.147Z
Answers.UserDisplayName: M__
Body: <p>I have a question related with the most popular frameworks for network construction: <a href="https://bmcbioinformatics.biomedcentral.com/articles/10.1186/1471-2105-9-559" rel="nofollow noreferrer">WGCNA</a> for weighted networks and <a href="https://igraph.org/r/" rel="nofollow noreferrer">igraph</a> package for unweighted networks.</p>
  <p>What are the advantages or disadvantages of applying these approaches and when it is recommended to use one over another.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-11-30T11:19:07.343Z
Comments.Text: Hi, this is a very open-ended discussion question that doesn't work well for the Stack Exchange format. Do you have a particular application in mind that could be linked to your question to make it more targeted?
Comments.UserDisplayName: gringer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-11-30T13:22:41.117Z
Comments.Text: I suspect the OP has been recommended an `igraph` recipe or concept for an unweighted graph theory calculation of co-expression  and they believe this represents a "plug and play" package like WGCNA (albeit thats a guess). The answer is they are not really the same thing.
Comments.UserDisplayName: M__
Tags: <r><networks><wgcna><coexpression>
Title: Coexpression network analysis
ThreadText: # Coexpression network analysis
  
  (Asked by: username_0 on 2022-11-29)
  
  I have a question related with the most popular frameworks for network construction: [WGCNA](https://bmcbioinformatics.biomedcentral.com/articles/10.1186/1471-2105-9-559) for weighted networks and [igraph](https://igraph.org/r/) package for unweighted networks.
  
  What are the advantages or disadvantages of applying these approaches and when it is recommended to use one over another.
  
  **Tags:** r, networks, wgcna, coexpression
  
  > **Comments:**
  > **username_1**: Hi, this is a very open-ended discussion question that doesn't work well for the Stack Exchange format. Do you have a particular application in mind that could be linked to your question to make it more targeted?  
  > **username_2**: I suspect the OP has been recommended an `igraph` recipe or concept for an unweighted graph theory calculation of co-expression  and they believe this represents a "plug and play" package like WGCNA (albeit thats a guess). The answer is they are not really the same thing.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2022-11-29. Score: 3 | Accepted answer
  
  `igraph` is a serious general network theory framework for any given data science application. It permits full directionality and describes vertices (nodes), edges (branches) and does cool stuff like De Bruijn graphs and Laplacian graphs. Understanding graph theory would be helpful and will be a steep learning curve. It's a serious data science package.
  
  `WGCNA` is a specific ready made RNA expression package which appears to be network theory and is undirectional, i.e. no directionality which is fine for RNA expression. It will have far less overall power but if you've a load of RNA-seq data and want 'plug and play' type stuff WGCNA is the only way. It's a correlation network, based on *r*2 (Pearson's correlation), to assess co-expression. I would assume the weighting is geared towards identifying co-expression. *There is an error in Fig. 2 legend* BTW Langfelder & Horvath (2008): the legend states r^2 what they mean is *r*2. I guess they messed up on their LaTeX.
  
  If this is a one of coexpression analysis `WGCNA`. If this is a big project, graph theory is central to that effort and you're looking towards developing a data science tool set then its `igraph`. There are other graph theory packages BTW.
  
  ---
  
  In case my answer wasn't clear `igraph` will do weighted edges via `is_weight`. The information is [here](https://igraph.org/r/doc/is_weighted.html), basically it will do anything.
  
  If your question is "what does weighting contribute to coexpression analysis", that is a good question. I know graph theory, I dunno the biology of gene expression versus the maths. What `WGCNA` is doing is statistically is simple if weighting is excluded ... my reasoning is it must be pivotal to its success.
  
  ---
  
  **To address the OPs comments.**
  
  *Statistical power* In the pure sense, I was incorrect to use this term because technically 'lack of power' is the inability to reject a hypothesis when it is false. For example, parametric statistics are more powerful than non-parametric statistics for this reason.
  
  What I meant was two things:
  
  1. In graph theory you can do anything within the "network", what is called a "graph", e.g. find the centre of the graph, minimal distance across the "graph", cyclisation, anything you can think of.
  
  1a. `WGCNA` is fixed it only does what is described in Langfelder & Horvath (2008). Nothing can be done outside that without rewriting the underlying code and it would be better to use `igraph` instead if that was the objective in my opinion.
  
  Thus `igraph` is more "powerful" because it will do a lot more stuff.
  
  2. My concern of `WGCNA` is its over-reliance on *r*2. This is a parametric statistic and may not always be applicable but from my reading of the paper (albeit briefly) it was entirely dependent on that. To centre everything on *r*2, personally I would at a minimum use *r* in addition (Spearman's correlation). This is extremely complex data and there is a risk of over-simplification. *r* and *r*2 can certainly give different results.
  
  The answer to the question however it is not what I think but everyone else thinks and Langfelder & Horvath (2008) has almost 10000 citations. I am not aware that the calculation has been overturned, e.g. DSeq2 has been overturned and demonstrated to be inappropriate. So I would assume it must be capturing the overall picture, so the positives outweigh potential negatives.
  
  > **Comments:**
  > **username_0**: thanks @username_2 for your insights into both packages, it has been very useful and  it has been explained in a very concise way the objectives,  do you know why WGCNA present less statistical power.  
  > **username_2**: @username_0 I've updated updated the post.  
  
  ---
  
  