1
$\begingroup$

I have run a PCA on my microarray data and found the clustering pattern for my samples. Now I need to find out the genes which are associated with first principal component and likewise till 4th PC.

How would I go about finding that?

$\endgroup$
  • 1
    $\begingroup$ You might want to take a look at the gene shaving method. $\endgroup$ – chl Jan 26 '13 at 11:50
1
$\begingroup$

Use the predict function, for example:

GenesOnPCs = predict(prcomp(yourMAdata)))
| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ This answer is quite specific of R (and its implementation of SVD PCA). Could give more details? What if, for example, a gene were to be found on more than one PC? What if the 2nd eigenvalue is very low compared to the first? etc. $\endgroup$ – chl Mar 27 '13 at 10:11
0
$\begingroup$

Principle components constitute a new space for your data. You need to multiply your data points with each eigenvector representing the selected components to project them onto the new space. Then you can run a clustering algorithm to decide which points belong to which cluster, e.g. k-means if classes are well separated and globular.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks for the reply. Could you please share some tutorials or code for doing the same as I am new to this. I have used prcomp to do PCA and used x.prcomp$rotation to see the data points. $\endgroup$ – user18117 Dec 27 '12 at 17:10
  • $\begingroup$ Anythning is useful to start with. I know how to run PCA and its basic interpretation but finding genes which are associated with first principal component is getting diffucilt in terms of code in R. $\endgroup$ – user18117 Dec 27 '12 at 17:13
  • $\begingroup$ I am not sure what you mean by "genes which are associated with first principal component". PCA finds a set of new axes where spread of data is high and hopefully using a bunch of them (e.g. first k) you can project your data and then cluster more accurately. You can find new projections z1 = Data * PC1, z2 = Data * PC2, ... Plot 2 or 3 z' s together to visualize the results or run e.g. a new clustering algorithm in the new space z1, z2, ..., zk $\endgroup$ – Zoran Dec 27 '12 at 18:13
0
$\begingroup$

I would recommend either plotting the features into the PCA space like in Fig. 1 of this tutorial (note that FactoMineR in R does this nicely) or, as others have recommended, run a clustering algorithm, then perform tests for differential expression on the results of the clusters.

| cite | improve this answer | |
$\endgroup$
0
$\begingroup$

In Python I would do this the following way:

from sklearn import decomposition
from pandas import DataFrame

# assuming training data is a pandas dataframe named 'train'
# training the PCA
pca = decomposition.PCA()
pca.fit(train)

# getting the weights for original parameters
for i in range(0,4):
    featureWeights = list(pca.components_[i])
    weights = DataFrame(data = featureWeights)
    filename = 'principal_component_' + str(i) + '.txt'
    weights.to_csv(filename, sep = '\t')

Then you get the weights how much each original component contributes into the new component in four .txt files. You can take the genes that have an absolute value above an arbitrary threshold.

| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.