You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用msmsTest包处理蛋白质组数据时ExpressionSet对象报错求助

Fixing the processingData Slot Error with msmsTests

Hey there! I see you've been stuck on this for weeks—let's get this sorted out right away. The root of your error is pretty straightforward:

Error in MSnbase:::logging(msnset, "Applied pp.msms.data preprocessing") : no slot of name "processingData" for this object of class "ExpressionSet"

This happens because the pp.msms.data() function from the msmsTests package is designed to work with MSnSet objects (from the MSnbase package), not the base ExpressionSet class you created. MSnSet is a specialized subclass of ExpressionSet that includes extra slots for mass spectrometry-specific metadata—like the processingData slot the error is complaining about.

Here's how to fix it:

Option 1: Convert your existing ExpressionSet to MSnSet

If you want to keep your current code for building the ExpressionSet, just add one line to convert it to an MSnSet:

# After building myStackoverflowexample as ExpressionSet
myMSnSet <- as(myStackoverflowexample, "MSnSet")

Option 2: Build an MSnSet directly (cleaner approach)

Instead of creating an ExpressionSet first, use the MSnSet constructor directly from MSnbase—this will automatically set up the required processingData slot for you:

library(limma)
library(MSnbase)
library(msmsEDA)
library(msmsTests)
library(edgeR)

dataDirectory <- setwd(".../msmsTest-essai - stkvflw")
exprsFile <- file.path(dataDirectory, "rawdata.txt")
exprs <- as.matrix(read.table(exprsFile, header=TRUE, sep="\t", row.names=1))

pDataFile <- file.path(dataDirectory, "pdata.txt")
pData <- read.table(pDataFile, row.names=1, header=TRUE, sep="\t")

# Verify row/column match (good practice!)
all(rownames(pData) == colnames(exprs))

metadata <- data.frame(
  labelDescription= c(
    "molecule treatment", 
    "number of years", 
    "tissues from Velpeau Hospital patients", 
    "in cm", 
    "in kg"
  ), 
  row.names=c("treat", "age", "tissue", "height", "weight")
)
phenoData <- new("AnnotatedDataFrame", data=pData, varMetadata=metadata)

experimentData <- new("MIAME", 
                      name="Mickael Jordan", 
                      lab="Chicago Bulls", 
                      contact="mjordan@lab.not.exist", 
                      title="Basket-ball Research Institute", 
                      abstract="An example ExpressionSet", 
                      url="www.lab.not.exist", 
                      other=list( notes="Created from text files" ))

# Use MSnSet constructor instead of ExpressionSet
myStackoverflowexample <- MSnSet(
  exprs=exprs, 
  pData=phenoData, 
  experimentData=experimentData, 
  annotation="blablabla"
)

Now run your preprocessing function

Once you have an MSnSet object, the pp.msms.data() function should work without errors:

e <- pp.msms.data(myStackoverflowexample)

Quick verification

You can check that the processingData slot exists by running:

# Check object class
class(myStackoverflowexample)  # Should return "MSnSet"
# View processing data
processingData(myStackoverflowexample)

This will show you the default processing metadata that MSnbase initializes, which the msmsTests functions rely on to log preprocessing steps.

内容的提问来源于stack exchange,提问作者SkyR

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 09:19:23