Answers.Body: <p>Your data don't have obvious outliers so you don't have to worry about removing them. The problem is that both sets show prominent sample clusters. I would try to figure out what drives those clusters (is it technical or biological), and whether the variation should be removed. See the comments in <a href="https://horvath.genetics.ucla.edu/html/CoexpressionNetwork/Rpackages/WGCNA/faq.html" rel="nofollow noreferrer">WGCNA FAQ</a> under point 5 (My data are heterogeneous. Can I still use WGCNA?). This looks like data from GEO, so look into the sample annotation for these data sets and see if any of the recorded sample characteristics align with the clusters you see in the sample trees.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-10T03:59:41.110Z
Answers.Text: "If one has a categorical source of variation (e.g., sex or tissue differences) and the number of samples in each category is large enough (at least 30, say) " i do have required number of samples although , yes I did made network separately for each of them ,but by doing separate network analysis can i still do consensus module analysis which is what Im trying ..
Answers.UserDisplayName: kcm
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-11T04:24:45.313Z
Answers.Text: The text refers to running a consensus analysis with each set being one of the large clusters. Those clusters only have less than 20 samples, so they aren't really big enough to use as independent sets. You should try to figure out what sample characteristic correlated with the clusters and possibly adjust for it.
Answers.UserDisplayName: Peter Langfelder
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-11T06:22:19.647Z
Answers.Text: now i got it when i was telling 30 samples which i was confused .Thank you @Peter Langfelder i will look into the traits
Answers.UserDisplayName: kcm
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-09T17:47:58.457Z
Answers.LastActivityDate: 2019-12-09T17:47:58.457Z
Answers.UserDisplayName: Peter Langfelder
Body: <p>I have tried different combination of tree cut heights but im getting the exprSize as one sample as full the other one as empty .</p>
  
  <pre><code># Choose the "base" cut height for the female data set
  baseHeight = 135
  # Adjust the cut height for the male data set for the number of samples
  cutHeights = c(135, 145*exprSize<span class="math-container">$nSamples[2]/exprSize$</span>nSamples[1]);
  # Re-plot the dendrograms including the cut lines
  pdf(file = "SampleClustering.pdf", width = 12, height = 12);
  par(mfrow=c(2,1))
  par(mar = c(0, 4, 2, 0))
  for (set in 1:nSets)
  {
    plot(sampleTrees[[set]], main = paste("Sample clustering on all genes in", setLabels[set]),
         xlab="", sub="", cex = 0.7);
    abline(h=cutHeights[set], col = "red");
  }
  dev.off();
  </code></pre>
  
  <p>My figure <a href="https://i.sstatic.net/Pi7QD.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Pi7QD.jpg" alt="tree cut"></a></p>
  
  <p>When i see the cutHeights and exprSize i do see its higher than 120 but still i get only one set of sample which is 55 whereas the my other set which is </p>
  
  <pre><code>exprSize
  $nSets
  [1] 2
  
  $nGenes
  [1] 8213
  
  $nSamples
  [1] 55 47
  
  $structureOK
  [1] TRUE
  </code></pre>
  
  <p>This is after tree cut </p>
  
  <pre><code>exprSize
  $nSets
  [1] 2
  
  $nGenes
  [1] 8213
  
  $nSamples
  [1] 55  0
  
  $structureOK
  [1] TRUE
  
  &gt; cutHeights
  [1] 135.0000 123.9091
  </code></pre>
  
  <p>Im not able to figure out what is wrong </p>
  
Tags: <wgcna>
Title: Tree cut height for Consensus data input not working
ThreadText: # Tree cut height for Consensus data input not working
  
  (Asked by: username_0 on 2019-12-09)
  
  I have tried different combination of tree cut heights but im getting the exprSize as one sample as full the other one as empty .
  
  ```
  # Choose the "base" cut height for the female data set
  baseHeight = 135
  # Adjust the cut height for the male data set for the number of samples
  cutHeights = c(135, 145*exprSize$nSamples[2]/exprSize$nSamples[1]);
  # Re-plot the dendrograms including the cut lines
  pdf(file = "SampleClustering.pdf", width = 12, height = 12);
  par(mfrow=c(2,1))
  par(mar = c(0, 4, 2, 0))
  for (set in 1:nSets)
  {
    plot(sampleTrees[[set]], main = paste("Sample clustering on all genes in", setLabels[set]),
         xlab="", sub="", cex = 0.7);
    abline(h=cutHeights[set], col = "red");
  }
  dev.off();
  
  ```
  
  My figure [![tree cut](https://i.sstatic.net/Pi7QD.jpg)](https://i.sstatic.net/Pi7QD.jpg)
  
  When i see the cutHeights and exprSize i do see its higher than 120 but still i get only one set of sample which is 55 whereas the my other set which is
  
  ```
  exprSize
  $nSets
  [1] 2
  
  $nGenes
  [1] 8213
  
  $nSamples
  [1] 55 47
  
  $structureOK
  [1] TRUE
  
  ```
  
  This is after tree cut
  
  ```
  exprSize
  $nSets
  [1] 2
  
  $nGenes
  [1] 8213
  
  $nSamples
  [1] 55  0
  
  $structureOK
  [1] TRUE
  
  > cutHeights
  [1] 135.0000 123.9091
  
  ```
  
  Im not able to figure out what is wrong
  
  **Tags:** wgcna
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-12-09. Score: 1
  
  Your data don't have obvious outliers so you don't have to worry about removing them. The problem is that both sets show prominent sample clusters. I would try to figure out what drives those clusters (is it technical or biological), and whether the variation should be removed. See the comments in [WGCNA FAQ](https://horvath.genetics.ucla.edu/html/CoexpressionNetwork/Rpackages/WGCNA/faq.html) under point 5 (My data are heterogeneous. Can I still use WGCNA?). This looks like data from GEO, so look into the sample annotation for these data sets and see if any of the recorded sample characteristics align with the clusters you see in the sample trees.
  
  > **Comments:**
  > **username_0**: "If one has a categorical source of variation (e.g., sex or tissue differences) and the number of samples in each category is large enough (at least 30, say) " i do have required number of samples although , yes I did made network separately for each of them ,but by doing separate network analysis can i still do consensus module analysis which is what Im trying ..  
  > **username_1**: The text refers to running a consensus analysis with each set being one of the large clusters. Those clusters only have less than 20 samples, so they aren't really big enough to use as independent sets. You should try to figure out what sample characteristic correlated with the clusters and possibly adjust for it.  
  > **username_0**: now i got it when i was telling 30 samples which i was confused .Thank you @username_1 i will look into the traits  
  
  ---
  
  