I have two geneset (microarrays) from the same type of tumor. The platform is slightly different, I both normalized with z-score and I did the correlation matrix (ex MYC with all the other genes present in each dataset separetly) I would like to correlate 1 gene with all the others in the two dataset at the same time. To make an example:
geneset1 <- data.frame(genename = seq(1,10,1), replicate(10, rnorm(10,1,2))) geneset2 <- data.frame(genename = seq(1,12,1), replicate(5, rnorm(12,1,2)))
After normalizing them, I did a correlation gene list in both dataset with cor function R. for example:
corr_matrix <- data.frame(correlation = sapply(1:nrow(geneset1), function(x) cor(t(geneset1[1,]), t(geneset1[x,]), method = "pearson", use = 'pairwise.complete.obs') ), pValue = sapply(1:nrow(geneset1), function(x) cor.test(t(geneset1[1,]), t(geneset1[x,]), method = "pearson", use = 'pairwise.complete.obs')$p.value)
but now I want to join the datasets and to have a unique correlation gene list. what do you suggest to obtain a common list of correlation among one gene and the others ?
To do two separate lists and to do a weigth correlation for each gene? ex: (CorGeneset1 * Nsample1 + CorGeneset2* Nsample2) / (Nsample1 + Nsample2)
or you suggest to join the dataset, to do after a normalization of the joined dataset, and then to do another correlation matrix?
moreover, one dataset has some probes for genes not present in the other. What do you suggest to do?
Thank you everyone for your help