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
10 stars 0 forks source link

VizVolcano: potnetial issue with duplicated names? #56

Closed ChristinaSchmidt1 closed 1 year ago

ChristinaSchmidt1 commented 1 year ago

Check for duplicated column names between input file and extra file. If there are duplicated names, we need to ensure that if we merge the files later, that we maintain the column names of the input data as they are required to create the plot.

e.g. Plot_SettingsFile= Input_data

ChristinaSchmidt1 commented 1 year ago

Its fixed now:

#3. Select Input_data columns and Plot_SettingsFile columns
  if(is.null(Plot_SettingsFile)==FALSE){
    common_columns <- intersect(colnames(Input_data), colnames(Plot_SettingsFile))#check for overlapping names
    common_columns <- setdiff(common_columns, "Metabolite")#remove metabolites
    Plot_SettingsFile <- Plot_SettingsFile%>%#rename those column since they otherwise will cause issues when we merge the DFs later
      dplyr::rename_at(vars(common_columns), ~ paste0(., "_PlotSettingsFile"))
  }