Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid class “MIAPE” object: invalid object for slot "instrumentModel" in class "MIAPE": got class "list", should be or extend class "character" from Autotuner #603

Open
v-v1150n opened this issue Jun 13, 2024 · 6 comments

Comments

@v-v1150n
Copy link

Hi, I have seen issues here about cdf files and "MIAPE" object: errors. This is my situation currently:
I'm using the Autotuner suite to find out the best parameters,
https://github.com/KujawinskiLaboratory/Autotuner

My source file is a cdf file
The error message I get is as follows:

Error in validObject(.Object) :
invalid class "MIAPE" object: invalid object for slot "instrumentModel" in class "MIAPE": got class "list", should be or extend class "character"

Since there has been no response from the author of Autotuner, and my own programming skills are not very good, I am not sure how to modify their code.
After I checked their source code, I saw that they use the read function readMSData of MSnbase.
So I was wondering if there is a connection that can solve this problem.
https://github.com/KujawinskiLaboratory/Autotuner/blob/b3642602f208461973d6a98b58c2220d44f84d0c/R/Autotuner-class.R#L29

@lgatto
Copy link
Owner

lgatto commented Jun 13, 2024

Indeed, they use MSnbase for several operations, including reading data in. Could you share a cdf file to see what happens.

@v-v1150n
Copy link
Author

Of course, no problem, here is the link to the file:
https://drive.google.com/file/d/1W-1QM39ngptvN0LtHjiszydztTdE6dug/view?usp=share_link

The following are the results of the current file reading:

image

@lgatto
Copy link
Owner

lgatto commented Jun 15, 2024

The function you use if from the MsExperiment package - that's not what Autotune uses.

Autotune uses MSnbase::readMSData(), as shown below:

> MSnbase::readMSData("~/Downloads/20140327_B-169_S043_1.cdf", msLevel. = 1, mode = "onDisk")
Polarity can not be extracted from netCDF files, please set manually the polarity with the 'polarity' method.
MSn experiment data ("OnDiskMSnExp")
Object size in memory: 6.35 Mb
- - - Spectra data - - -
 MS level(s): 1 
 Number of spectra: 18005 
 MSn retention times: 0:00 - 29:57 minutes
- - - Processing information - - -
Data loaded [Sat Jun 15 05:53:01 2024] 
Filter: select MS level(s) 1. [Sat Jun 15 05:53:01 2024] 
 MSnbase version: 2.30.1 
- - - Meta data  - - -
phenoData
  rowNames: 20140327_B-169_S043_1.cdf
  varLabels: sampleNames
  varMetadata: labelDescription
Loaded from:
  20140327_B-169_S043_1.cdf 
protocolData: none
featureData
  featureNames: F1.S00001 F1.S00002 ... F1.S18005 (18005 total)
  fvarLabels: fileIdx spIdx ... spectrum (35 total)
  fvarMetadata: labelDescription
experimentData: use 'experimentData(object)'

which works.

The error that you show is related to the experiment data and/or instrument models encoded in the resulting object, which are fine:

> experimentData(x)
Instrument : 
  Model:  (1) 
  Manufacturer: U (1) 
  Customisations:  
  Use 'msInfo(object)' for more MIAPE-MS information.
Experiment data
  Experimenter name:  
  Laboratory:  
  Contact information:  
  Contact email:  
  Title:  
  URL:  
  PMIDs:  
  No abstract available.
> instrumentModel(x)
[1] ""

Have you run Autotuner with multiple files, and (probably) with more parameters, then only that file? Please give me the exact code that lead to the error, or I won't be able to help.

@v-v1150n
Copy link
Author

This is the result of me reading the archive using readMSData:

image

This is my result using Autotuner:
image

image image

Currently I only use these three files as my experimental data.
Do I need to provide any other information for your reference? thanks for your help

@lgatto
Copy link
Owner

lgatto commented Jun 15, 2024

You have the error when reading the the 2 first files in. The 3rd one, that you shared with me, works.

Could you share one of the first two.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants