lifs-tools / rmzTab-m

The R-language bindings for mzTab-M
https://lifs-tools.github.io/rmzTab-m/
MIT License
4 stars 1 forks source link

undefined columns selected when fromDataFrame() without SME section #28

Closed sneumann closed 1 year ago

sneumann commented 1 year ago

For a file exported by MS-Dial 3.98 from TripleQ data without SME section I get for

  mzTabTable <- readMzTab(mzTabfile)
  ## To turn these tables into objects, use the R6 class constructor method `new()`:
  mzTabObject <- MzTab$new()$fromDataFrame(mzTabTable)

The traceback

7: stop("undefined columns selected")
6: `[.data.frame`(df, , colnames(df) != "") at read_mz_tab.R#159
5: df[, colnames(df) != ""] at read_mz_tab.R#159
4: extractTable(mztab.table, "SEH", "SME") at read_mz_tab.R#187
3: extractSmallMoleculeEvidence(MzTabDataFrame) at mz_tab.R#210
2: MzTab$new()$fromDataFrame(mzTabTable) at #6

So https://github.com/lifs-tools/rmzTab-m/blob/660ca4799adacda98d49bccfd5d78eeae172d879/R/read_mz_tab.R#L159 should check that there is an actual df to speak of :-) PR coming. Yours, Steffen