Answers.Body: <p>For outlier identification I suggest using the <a href="https://bmcsystbiol.biomedcentral.com/articles/10.1186/1752-0509-6-63" rel="nofollow noreferrer">sample network approach</a> developed by Oldham et al. It basically amounts to constructing a inter-sample connectivity (assuming <code>normalizedData</code> contains the log-normalized data with genes in colunms and samples in rows)</p>
  
  <p><code>k = colSums(cor(t(normalizedData)))</code>, </p>
  
  <p>scaling the connectivities </p>
  
  <p><code>Z.k = scale(k)</code> </p>
  
  <p>and then removing samples with high negative Z.k (e.g. Z.k &lt; -4). </p>
  
  <p>A slightly different approach is based on euclidean distances rather than correlations, </p>
  
  <p><code>Z.k = scale(as.matrix(dist(normalizedData)))</code> </p>
  
  <p>and removing samples with high <em>positive</em> Z.k (since distance is a measure of dissimilarity). </p>
  
  <p>Regarding the scale-free topology fit plot, I wouldn't worry about it too much, the fit index sometimes jumps around a bit. It certainly does not look like you have strong outliers or very heterogeneous data. But it is always a good idea to plot the sample clustering tree to check (1) that there are no strong clusters, and (2) that the outlier identification did something reasonable. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-23T15:29:59.940Z
Answers.Text: Thanks for your response ! I will check out the paper, looks interesting.
Answers.UserDisplayName: h3ab74
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-22T21:00:02.183Z
Answers.LastActivityDate: 2019-07-22T21:00:02.183Z
Answers.UserDisplayName: Peter Langfelder
Body: <p>I wish to conduct WGCNA on a single cell RNASeq dataset and, when choosing the optimal beta parameter after running <code>pickSoftThreshold</code> am presented with a rather strange plot: 
  <a href="https://i.sstatic.net/GkqGL.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/GkqGL.jpg" alt="enter image description here"></a></p>
  
  <p>I have normalized the data using <code>NormalizeData</code> in <code>Seurat</code> using the LogNormalize method.</p>
  
  <p>One of my colleagues suggested using <code>hclust</code> as a method for outlier detection to see potential cells/samples that could be excluded. I think this makes sense however I haven't found much information on such procedures besides the following paper: <a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5845381/" rel="nofollow noreferrer">https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5845381/</a>.</p>
  
  <p>My question would be, is this procedure just be as simple as running a hierarchical clustering on the data and seeing which samples cluster by themselves (and then removing those based on a minimum cluster size criteria) or is their more to it? Also, for those familiar with WGCNA, why does the scale-free topolgy plot generate such strange looking values, is this indicative of outliers being present in the data?</p>
  
  <p>Thank you for your time.</p>
  
Tags: <r><scrnaseq><seurat><clustering><wgcna>
Title: Hierarchical clustering for outlier detection - single cell RNASeq & WGCNA
ThreadText: # Hierarchical clustering for outlier detection - single cell RNASeq & WGCNA
  
  (Asked by: username_0 on 2019-07-22)
  
  I wish to conduct WGCNA on a single cell RNASeq dataset and, when choosing the optimal beta parameter after running `pickSoftThreshold` am presented with a rather strange plot:
  [![enter image description here](https://i.sstatic.net/GkqGL.jpg)](https://i.sstatic.net/GkqGL.jpg)
  
  I have normalized the data using `NormalizeData` in `Seurat` using the LogNormalize method.
  
  One of my colleagues suggested using `hclust` as a method for outlier detection to see potential cells/samples that could be excluded. I think this makes sense however I haven't found much information on such procedures besides the following paper: <https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5845381/>.
  
  My question would be, is this procedure just be as simple as running a hierarchical clustering on the data and seeing which samples cluster by themselves (and then removing those based on a minimum cluster size criteria) or is their more to it? Also, for those familiar with WGCNA, why does the scale-free topolgy plot generate such strange looking values, is this indicative of outliers being present in the data?
  
  Thank you for your time.
  
  **Tags:** r, scrnaseq, seurat, clustering, wgcna
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-07-22. Score: 2 | Accepted answer
  
  For outlier identification I suggest using the [sample network approach](https://bmcsystbiol.biomedcentral.com/articles/10.1186/1752-0509-6-63) developed by Oldham et al. It basically amounts to constructing a inter-sample connectivity (assuming `normalizedData` contains the log-normalized data with genes in colunms and samples in rows)
  
  `k = colSums(cor(t(normalizedData)))`,
  
  scaling the connectivities
  
  `Z.k = scale(k)`
  
  and then removing samples with high negative Z.k (e.g. Z.k < -4).
  
  A slightly different approach is based on euclidean distances rather than correlations,
  
  `Z.k = scale(as.matrix(dist(normalizedData)))`
  
  and removing samples with high *positive* Z.k (since distance is a measure of dissimilarity).
  
  Regarding the scale-free topology fit plot, I wouldn't worry about it too much, the fit index sometimes jumps around a bit. It certainly does not look like you have strong outliers or very heterogeneous data. But it is always a good idea to plot the sample clustering tree to check (1) that there are no strong clusters, and (2) that the outlier identification did something reasonable.
  
  > **Comments:**
  > **username_0**: Thanks for your response ! I will check out the paper, looks interesting.  
  
  ---
  
  