Hi,
I am trying to do a pca plot for some gene expression data in R using edgeR. I have done a MDS plot but was hoping to do a pca. I have transformed my data into TPM to do this analysis. I have three wild type samples, three with one phenotype and and one from a second phenotype. The a bit of the data is below. Matrix is 7 samples x ~27000 genes. Here is how I did the MDS plot:
group2 <- r("WT","WT","WT","M1","M1","M1","other")
y_gene <- DGEList(X200909_ genes_TPM [c(2:8)], group=group2, lib.size = colSums(X200909_ genes_TPM [c(2:8)]))
y_gene <- calcNormFactors(y_gene)
plotMDS(y_gene)
Any help appreciated.
Adam
WT2-P1 WT3-P1 WT4-P1 M4-P1 M5-P1 M6-P1 F5-P1
gene
A1BG 51.27004445 65.36898684 59.90938705 31.66942191 29.18648916 46.55213548 58.65045307
A1CF 0 0 0 0 0 0 0
A2ML1 0 0 0 0 1.389832817 0 0
A3GALT2 0 0 0 0 0 0 0
A4GALT 0 0 0 0 0 0 0
A4GNT 0 0 0 0 0 0 0
AAAS 0 2.108676995 0 0 1.389832817 3.879344624 1.629179252
AACS 1.709001482 0 0 0 0 0 0
AADACL2 0 0 0 0 0 0 0
AADACL3 0 0 0 0 0 0 0
AADACL4 0 0 0 0 0 0 0
AADAT 0 0 1.872168345 2.111294794 0 1.939672312 0
AAED1 0 0 0 0 0 0 0
AAGAB 3.418002963 2.108676995 7.488673382 2.111294794 2.779665634 9.698361559 4.887537756
AAK1 1.709001482 0 3.744336691 2.111294794 0 1.939672312 1.629179252
AAMDC 1.709001482 0 5.616505036 0 0 1.939672312 0
Thanks Kevin,
I did as you suggested and went back to the counts and created the MDS plot:
I had previously tried to use your software but couldn't figure out how to set up the metadata object.
based on your comment above I can transform my counts data with cpm:
But how do I set up the metadata object?
Thanks again,
Adam
I see - thanks! Regarding the metadata, for all intents and purposes, the metadata object for PCAtools can be x$samples; however, the rownames of this object have to be equal to the colnames of the expression data.
Hope that this helps.