Skip to content

Remove usage of deprecated and removed MSnbase::NAnnotatedDataFrame class #18

@livisupajares

Description

@livisupajares

I downloaded OptiLCMS from devtools. It compiles fine on a MacOS Sillicon, but when I'm trying to use this fuction in my pipeline to import my raw data I get this:

> mSet <- ImportRawMSData(path = "mzml", metadata = "mzml/Metadata.txt", plotSettings = SetPlotParam(Plot = T))
No initialized mSet found, will initialize one automatically !

Step 1/6: Start to import the spectrum! 
This step will take a short time...
Raw file import begin...
<font color="red">
ERROR:NAnnotatedDataFrameis not a defined class</font>
Error in ImportRawMSData(path = "mzml", metadata = "mzml/Metadata.txt",  : 
  EXCEPTION POINT CODE: RMS2
2.
stop("EXCEPTION POINT CODE: RMS2")
1.
ImportRawMSData(path = "mzml", metadata = "mzml/Metadata.txt",
plotSettings = SetPlotParam(Plot = T))

Which basically means this: ERROR:“NAnnotatedDataFrame” is not a defined class. Investigating it further, I found this resolved issue from xcms, where basically means that this class is deprecated and no longer in use with the MSnbase package.

I found in this repo the outdated code in R/ROI_extraction.R:

raw_data <-
        tryCatch(read.MSdata(
          dda_file1,
          pdata = new("NAnnotatedDataFrame", pd),
          msLevel. = 1L,
          mode = "inMemory"
        ), error = function(e) {e})

In R/Spectra_Utils.R :

processingData = new("MSnProcess",
                             files = specdata@processingData@files[i]),
        featureData = new("AnnotatedDataFrame", fd),
        phenoData = new("NAnnotatedDataFrame",
                        data.frame(sampleNames = "1")),
        experimentData = new("MIAPE",
                             instrumentManufacturer = "a",

And in R/Spectra_import.R:

      raw_data <-
        tryCatch(read.MSdata(
          files = files,
          pdata = new("NAnnotatedDataFrame", pd),
          mode = mode,
          msLevel. = 1
        ), error = function(e) {e})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions