Body: <p>I have RNA-seq data in response to treatment vs non response; By machine learning I selected three principle components likely can predict the response based on the gene expression. Now I have something like this</p>
  
  <pre><code>&gt; head(pca<span class="math-container">$rotation[1:10,1:6])
                 PC1          PC2          PC3          PC4           PC5          PC6
  ACTB   -0.01858031 -0.005810636  0.014939832 -0.009594126 -0.0118313644 -0.011534401
  ATP5F1 -0.01822611  0.014851900 -0.016401920 -0.015616379  0.0254850111 -0.010225516
  DDX5   -0.02477827 -0.020573978  0.002199966 -0.009296852  0.0006222345  0.014506614
  EEF1G  -0.02803284  0.001126758 -0.010570521 -0.017035205  0.0007583815  0.011225639
  GAPDH  -0.02691309  0.005503228  0.006446502 -0.012686738 -0.0289737909  0.007036631
  NCL    -0.03019765 -0.003011778 -0.015534611 -0.002019556 -0.0126401245  0.013977142
  &gt; 
  &gt; dim(pca$</span>rotation)
  [1] 3962   56
  &gt; 
  </code></pre>
  
  <p>Machine learning says PC 6, PC 21 and PC 39 are better; how I know from 3962 genes in each of these PCs which genes is more contribute to response to treatment?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-04T09:43:55.993Z
Comments.Text: Have you looked at the loadings in those PCs?
Comments.UserDisplayName: Devon Ryan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-04T09:45:49.780Z
Comments.Text: Hi @Fereshteh you should know this, you have enough experience in ML. PCA cannot solve this but you can use the classification for supervised learning which will tell you
Comments.UserDisplayName: M__
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-04T09:46:05.160Z
Comments.Text: Thank you, yes; But I can not conclude which genes I should select from preferred PCs
Comments.UserDisplayName: Zizogolu
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-04T09:55:40.893Z
Comments.Text: Like @DevonRyan mentioned, you can go by the loadings, which will be sort( abs(pca$rotation[,"PC6"]),decreasing=T) for example in your case. But it kind of defeats the purpose of PCA right? You use PCA to get linear combinations of the genes..
Comments.UserDisplayName: StupidWolf
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-04T10:03:34.877Z
Comments.Text: Thank you @StupidWolf; So you think genes with higher loading scores in each PCs don't necessarily can predict the response to treatment as here I am supposing a linear relationships between genes?
Comments.UserDisplayName: Zizogolu
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-04T11:31:50.660Z
Comments.Text: Yes the genes with the higher loadings in the better PCs should contribute more towards response / non-response. My point is, it should be a combination of the genes. For example, if PC6 has strong +ve loadings for gene 1,2,3 and strong -ve loadings for gene 4,5,6, I would interpret it as, a strong expression of genes 1-3 and low expression of genes 4-6 contribute towards a response phenotype
Comments.UserDisplayName: StupidWolf
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-04T11:33:15.943Z
Comments.Text: What exactly is the goal of your analysis? If it is to predict and then point out a few potential causative genes, then the PCA approach you have is ok.
  I would be cautious about using up to PC39 (which explains very little of the variance in gene expression).
Comments.UserDisplayName: StupidWolf
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-04T11:57:22.173Z
Comments.Text: Thank you @StupidWolf; Yes as you mentioned the ultimate goal is point out a few potential causative genes that predict is a patient would respond to treatment or not. I have 56 PCs (I have 56 samples in total). I have three PCs that gives a final models with the highest accuracy then I need to know more important genes underlying these PCs. Here by using prcomp I have some PCs then I used these PCs as independent variable to predict response to treatment finally three PCs showed can predict the responder patients better.
Comments.UserDisplayName: Zizogolu
Tags: <rna-seq><modelling><pca><features>
Title: Selecting genes with more contribution from PCA
ThreadText: # Selecting genes with more contribution from PCA
  
  (Asked by: username_0 on 2019-10-04)
  
  I have RNA-seq data in response to treatment vs non response; By machine learning I selected three principle components likely can predict the response based on the gene expression. Now I have something like this
  
  ```
  > head(pca$rotation[1:10,1:6])
                 PC1          PC2          PC3          PC4           PC5          PC6
  ACTB   -0.01858031 -0.005810636  0.014939832 -0.009594126 -0.0118313644 -0.011534401
  ATP5F1 -0.01822611  0.014851900 -0.016401920 -0.015616379  0.0254850111 -0.010225516
  DDX5   -0.02477827 -0.020573978  0.002199966 -0.009296852  0.0006222345  0.014506614
  EEF1G  -0.02803284  0.001126758 -0.010570521 -0.017035205  0.0007583815  0.011225639
  GAPDH  -0.02691309  0.005503228  0.006446502 -0.012686738 -0.0289737909  0.007036631
  NCL    -0.03019765 -0.003011778 -0.015534611 -0.002019556 -0.0126401245  0.013977142
  > 
  > dim(pca$rotation)
  [1] 3962   56
  > 
  
  ```
  
  Machine learning says PC 6, PC 21 and PC 39 are better; how I know from 3962 genes in each of these PCs which genes is more contribute to response to treatment?
  
  **Tags:** rna-seq, modelling, pca, features
  
  > **Comments:**
  > **username_1**: Have you looked at the loadings in those PCs?  
  > **username_2**: Hi @Fereshteh you should know this, you have enough experience in ML. PCA cannot solve this but you can use the classification for supervised learning which will tell you  
  > **username_0**: Thank you, yes; But I can not conclude which genes I should select from preferred PCs  
  > **username_3**: Like @username_1 mentioned, you can go by the loadings, which will be sort( abs(pca$rotation[,"PC6"]),decreasing=T) for example in your case. But it kind of defeats the purpose of PCA right? You use PCA to get linear combinations of the genes..  
  > **username_0**: Thank you @username_3; So you think genes with higher loading scores in each PCs don't necessarily can predict the response to treatment as here I am supposing a linear relationships between genes?  
  > **username_3**: Yes the genes with the higher loadings in the better PCs should contribute more towards response / non-response. My point is, it should be a combination of the genes. For example, if PC6 has strong +ve loadings for gene 1,2,3 and strong -ve loadings for gene 4,5,6, I would interpret it as, a strong expression of genes 1-3 and low expression of genes 4-6 contribute towards a response phenotype  
  > **username_3**: What exactly is the goal of your analysis? If it is to predict and then point out a few potential causative genes, then the PCA approach you have is ok. I would be cautious about using up to PC39 (which explains very little of the variance in gene expression).  
  > **username_0**: Thank you @username_3; Yes as you mentioned the ultimate goal is point out a few potential causative genes that predict is a patient would respond to treatment or not. I have 56 PCs (I have 56 samples in total). I have three PCs that gives a final models with the highest accuracy then I need to know more important genes underlying these PCs. Here by using prcomp I have some PCs then I used these PCs as independent variable to predict response to treatment finally three PCs showed can predict the responder patients better.  
  
  ---
  
  ## 0 answers
  
  