Body: <p>I wanted to help out a colleague and I wanted to know if the things I'm doing are making sense-ish.</p>
  <p>The data consists of tissue sections which had been stained for markers. The tissue segments are some small tubules, with around 6 different genes stained. They have counted the number of cells in segment, as well as how many cells are stained with different markers. They have around 30 samples  (Split into three categories, so 10 samples each category) and a ratio of  cells with marker / area of segment for 6 genes. The goal is to check if any marker is prevalent in any sample type.</p>
  <p>They are doing their own analysis, and as a fun side project, I thought I will try performing PCA on the generated data. I made PCA plot with the raw values, but couldn't see any clear clustering.</p>
  <p>I'm probably missing a normalization step, and at loss on which method would be best. However I fear even if I perform some normalization, would the analysis make sense?</p>
  <p>EDIT: The code I used for the analysis is fairly simple,</p>
  <pre><code>values # Contains table of ratios
  metadata # weather sample treated with chemo or not
  # Performing PCA and merging it with metadata for easier plotting
  pca_values &lt;- pca(values)
  metadata &lt;- merge(metadata, scores(pca_values), by=0)
  # plotting with ggplot
  ggplot(metadata, aes(PC1, PC2, color=chemo)) + geom_point()
  </code></pre>
  <p><a href="https://i.sstatic.net/UXblXaED.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/UXblXaED.png" alt="enter image description here" /></a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-10-15T01:16:26.347Z
Comments.Text: Please show this PCA plot, preferably with cells tagged for the different samples. Showing the script you used to make this PCA plot would also be helpful.
Comments.UserDisplayName: gringer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-10-18T12:39:12.993Z
Comments.Text: Have you looked at the eigenvalues (variance) for the other PC axes? It could be that the effect you're looking for is small, and only shows up on other axes. 
  
  Additionally, you could use stats to see if there is a significant effect. Check out PERMANOVAs, for instance.
Comments.UserDisplayName: dthorbur
Tags: <r><pca>
Title: Plotting PCA from cell counting data, viable way for analysis?
ThreadText: # Plotting PCA from cell counting data, viable way for analysis?
  
  (Asked by: username_0 on 2024-10-14)
  
  I wanted to help out a colleague and I wanted to know if the things I'm doing are making sense-ish.
  
  The data consists of tissue sections which had been stained for markers. The tissue segments are some small tubules, with around 6 different genes stained. They have counted the number of cells in segment, as well as how many cells are stained with different markers. They have around 30 samples (Split into three categories, so 10 samples each category) and a ratio of cells with marker / area of segment for 6 genes. The goal is to check if any marker is prevalent in any sample type.
  
  They are doing their own analysis, and as a fun side project, I thought I will try performing PCA on the generated data. I made PCA plot with the raw values, but couldn't see any clear clustering.
  
  I'm probably missing a normalization step, and at loss on which method would be best. However I fear even if I perform some normalization, would the analysis make sense?
  
  EDIT: The code I used for the analysis is fairly simple,
  
  ```
  values # Contains table of ratios
  metadata # weather sample treated with chemo or not
  # Performing PCA and merging it with metadata for easier plotting
  pca_values <- pca(values)
  metadata <- merge(metadata, scores(pca_values), by=0)
  # plotting with ggplot
  ggplot(metadata, aes(PC1, PC2, color=chemo)) + geom_point()
  
  ```
  
  [![enter image description here](https://i.sstatic.net/UXblXaED.png)](https://i.sstatic.net/UXblXaED.png)
  
  **Tags:** r, pca
  
  > **Comments:**
  > **username_1**: Please show this PCA plot, preferably with cells tagged for the different samples. Showing the script you used to make this PCA plot would also be helpful.  
  > **username_2**: Have you looked at the eigenvalues (variance) for the other PC axes? It could be that the effect you're looking for is small, and only shows up on other axes.   Additionally, you could use stats to see if there is a significant effect. Check out PERMANOVAs, for instance.  
  
  ---
  
  ## 0 answers
  
  