Answers.Body: <p>The simplest way is to re-calculate (or load, if saved) the TOM matrix and find the genes with the highest TOM to MALAT1. If you have enough RAM to carry out WGCNA in a single block, you can use TOMsimilarityFromExpr, make sure you give it the same arguments as the ones you used in network construction, and select the appropriate column from the result. Then order the column and retain top genes, as many as you think is reasonable. You can also use adjacency instead of TOM, though TOM is a more natural quantity to use if you used in your network construction. Once you figure out which genes you want to retain, you can subset the TOM matrix (both rows and columns) to those genes and you have the sub-network among these genes.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-11-02T14:28:01.070Z
Answers.Text: thanks a lot Peter
Answers.UserDisplayName: user9114
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-11-16T10:34:39.543Z
Answers.Text: small question again...I'm interested in modules blue and brown...So, extracted the expression for the genes in those modules and used this way `TOM2 = TOMsimilarityFromExpr(t(expr_of_interest),power = softPower,networkType = "unsigned", TOMType = "unsigned")` And this gave me correlation values. I can see all correlation values are above 0 only....there are no negative correlation values....why is it like that?
Answers.UserDisplayName: user9114
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-11-18T08:23:19.507Z
Answers.Text: As the function name says, it returns a topological overlap matrix (TOM) which is by definition non-negative. If you want correlation, use cor.
Answers.UserDisplayName: Peter Langfelder
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-11-24T18:27:49.883Z
Answers.Text: thanks peter. how to get the correlation values for the genes in specific interesting modules or genes from a couple of modules?
Answers.UserDisplayName: user9114
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-11-28T01:27:51.333Z
Answers.Text: Well, you can select the genes using labels, something like (using the notation from WGCNA tutorials) ```select = moduleColors %in% c(module1, module2,...)``` (replace module1, module2, .... with the module labels you want to select), then use ```cor(datExpr[, select])```.
Answers.UserDisplayName: Peter Langfelder
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-11-01T13:52:00.387Z
Answers.LastActivityDate: 2022-11-01T13:52:00.387Z
Answers.UserDisplayName: Peter Langfelder
Body: <p>I have used WGCNA by integrating several datasets which are processed in a similar way. Identified 17 modules, followed by performed pathway analysis with the genes present in those modules.</p>
  <p>Among all the protein-coding genes,ncRNAs and other genes, I'm particularly interested in a specific lncRNA <code>MALAT1</code>.</p>
  <p>I found that <code>MALAT1</code> is co-expressed with more than 800 genes in a module named <code>blue</code>. I have few questions, can anyone please help me in this?</p>
  <p>Questions:</p>
  <ol>
  <li><p>I would like to check which are the closest co-expressed genes to <code>MALAT1</code>. How can I know that?</p>
  </li>
  <li><p>Once I get the closest genes to <code>MALAT1</code>, I would like to make a network with those genes and MALAT1. How to do this network?</p>
  </li>
  </ol>
  
Tags: <r><rna-seq><networks><wgcna>
Title: How to find closely related genes for a specific gene from WGCNA modules?
ThreadText: # How to find closely related genes for a specific gene from WGCNA modules?
  
  (Asked by: username_0 on 2022-10-29)
  
  I have used WGCNA by integrating several datasets which are processed in a similar way. Identified 17 modules, followed by performed pathway analysis with the genes present in those modules.
  
  Among all the protein-coding genes,ncRNAs and other genes, I'm particularly interested in a specific lncRNA `MALAT1`.
  
  I found that `MALAT1` is co-expressed with more than 800 genes in a module named `blue`. I have few questions, can anyone please help me in this?
  
  Questions:
  
  1. I would like to check which are the closest co-expressed genes to `MALAT1`. How can I know that?
  2. Once I get the closest genes to `MALAT1`, I would like to make a network with those genes and MALAT1. How to do this network?
  
  **Tags:** r, rna-seq, networks, wgcna
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-11-01. Score: 3 | Accepted answer
  
  The simplest way is to re-calculate (or load, if saved) the TOM matrix and find the genes with the highest TOM to MALAT1. If you have enough RAM to carry out WGCNA in a single block, you can use TOMsimilarityFromExpr, make sure you give it the same arguments as the ones you used in network construction, and select the appropriate column from the result. Then order the column and retain top genes, as many as you think is reasonable. You can also use adjacency instead of TOM, though TOM is a more natural quantity to use if you used in your network construction. Once you figure out which genes you want to retain, you can subset the TOM matrix (both rows and columns) to those genes and you have the sub-network among these genes.
  
  > **Comments:**
  > **username_0**: thanks a lot username_1  
  > **username_0**: small question again...I'm interested in modules blue and brown...So, extracted the expression for the genes in those modules and used this way `TOM2 = TOMsimilarityFromExpr(t(expr_of_interest),power = softPower,networkType = "unsigned", TOMType = "unsigned")` And this gave me correlation values. I can see all correlation values are above 0 only....there are no negative correlation values....why is it like that?  
  > **username_1**: As the function name says, it returns a topological overlap matrix (TOM) which is by definition non-negative. If you want correlation, use cor.  
  > **username_0**: thanks username_1. how to get the correlation values for the genes in specific interesting modules or genes from a couple of modules?  
  > **username_1**: Well, you can select the genes using labels, something like (using the notation from WGCNA tutorials) ```select = moduleColors %in% c(module1, module2,...)``` (replace module1, module2, .... with the module labels you want to select), then use ```cor(datExpr[, select])```.  
  
  ---
  
  