datascience-mobi-2023 / topic05_team02

1 stars 0 forks source link

for @Ana https://github.com/datascience-mobi-2023/topic05_team02/blob/main/BioInfo_t05_team02_aktualisiert.Rmd#L386 #1

Closed aluisascosta closed 1 year ago

aluisascosta commented 1 year ago

@francaklaeren I took a look at this and I would suggest that rather than running cor() between the 2 matrixes, which takes reaaaaally long and (I think) makes some unnecessary calculations, it will be better if you replace the cor(prism.exp_corr_cleaned, prism.cnv_corr_cleaned, method= c("spearman")) with a loop using gene names.

z.B (using the list as you had used somewhere in your code before):


for (g in colnames(prism.exp_corr_cleaned)) {  
  valse_g = prism.exp_corr_cleaned[,colnames(prism.exp_corr_cleaned) == g]  
  valsc_g = prism.cnv_corr_cleaned[,colnames(prism.cnv_corr_cleaned) == g]  
  cor_g[[g]]=cor(valse_g, valsc_g, method= c("spearman"))  
}  
final_cor = t(data.frame(cor_g))```
francaklaeren commented 1 year ago

Thank you very much, I'll try it that way!