saezlab / MetaProViz

R-package to perform metabolomics pre-processing, differential metabolite analysis, metabolite clustering and custom visualisations.
https://saezlab.github.io/MetaProViz/
GNU General Public License v3.0
8 stars 0 forks source link

VizHeatmap: Object 'col_annot' not found #43

Closed LiaoQianWu closed 1 year ago

LiaoQianWu commented 1 year ago

Hello, VizHeatmap gives error when 'Plot_SettingsInfo' parameter is specified. The error is: Object 'col_annot' not found. It seems indexing of col_annot is conducted before col_annot is defined.

ChristinaSchmidt1 commented 1 year ago

Yeah, I updated this today from col_annot to color_Sample and row_annot to color_Metab. Just pull the changes and reinstall. Then it should work. The vignette is already updated.

Let me know if it still doesnt work for you :)

LiaoQianWu commented 1 year ago

It still doesn't work. I think the issue comes up in the chunk of 'Column annotation',

col_annot_vars <- Plot_SettingsInfo[grepl("color_Sample", names(Plot_SettingsInfo))]
if(length(col_annot_vars)>0){
  for (i in 1:length(col_annot_vars)){
    annot_sel <- col_annot_vars[[i]]
    col_annot[i] <- Plot_SettingsFile_Sample %>% select(annot_sel) %>% as.data.frame()
    names(col_annot)[i] <- annot_sel
  }
  col_annot <- as.data.frame(col_annot)
  rownames(col_annot) <- rownames(data)
} else {
    col_annot<- NULL
}

, where indexing of col_annot is conducted before col_annot is defined. This error could occur in 'Row annotation' chunk as well.

ChristinaSchmidt1 commented 1 year ago

Yes you are right, thanks! I messed this up whilst making some other changes this morning. Should be running now.

ChristinaSchmidt1 commented 1 year ago

I assume this is working now, so I will close the issue. If you still have trouble, please reopen and let me know.