Updated Question:
I want to use the msmsTest package for statistics of my proteomics data (which is spectral counts type).
However, I have a message error when importing the file with the commands:
e <- pp.msms.data(myStackoverflowexample)
Error in MSnbase:::logging(msnset, "Applied pp.msms.data preprocessing") :
no slot of name "processingData" for this object of class "ExpressionSet".
I think that my problem comes from the previous step when I try to generate the file in the appropriate format which should be a ExpressionSet file. For this I have tried to follow step by step the ExpressionSetIntroduction manual, it seems OK to me, but I get the error whenever I use the command "e <- pp.msms.data(myStackoverflowexample)" with the msmsTest package.
Please help me I am stuck since weeks and it is probably a very stupid thing i am missing.
You can get the example datasets (raw data and phenodata) here: https://www.dropbox.com/s/o9ts4k5qrnyem6d/rawdata.txt?dl=0 https://www.dropbox.com/s/3oy6n6y5hfq30ee/pdata.txt?dl=0
Below is the code that allows me to build the ExpressionSet file from scratch :
library(limma)
library(MSnbase)
library(msmsEDA)
library(msmsTests)
library(edgeR)
# creation of the file "assay data" in the correct format :
dataDirectory<- setwd(".../msmsTest-essai - stkvflw")
exprsFile <- file.path(dataDirectory, "rawdata.txt")
exprs <- as.matrix(read.table(exprsFile, header=TRUE, sep="\t",row.names=1))
# creation of the phenotypic data file:
pDataFile <- file.path(dataDirectory, "pdata.txt")
pData <- read.table(pDataFile,row.names=1, header=TRUE, sep="\t")
head(pData)
all(rownames(pData)==colnames(exprs)) # verification that rows and names of both files match
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"
))
myStackoverflowexample <- ExpressionSet(assayData=exprs,
phenoData=phenoData,
experimentData=experimentData,
annotation="blablabla")
myStackoverflowexample
ExpressionSet (storageMode: lockedEnvironment)
assayData: 8 features, 208 samples
element names: exprs
protocolData: none
phenoData
sampleNames: A1 A2 ... C64 (208 total)
varLabels: treat age ... weight (5 total)
varMetadata: labelDescription
featureData: none
experimentData: use 'experimentData(object)'
Annotation: blablabla
summary(myStackoverflowexample)
Length Class Mode
1 ExpressionSet S4
So after this code, I am stuck with the msmsTest package:
e <- pp.msms.data(myStackoverflowexample)
Error in MSnbase:::logging(msnset, "Applied pp.msms.data preprocessing") :
no slot of name "processingData" for this object of class "ExpressionSet"
If we look at the manual example, we see a line with "processing information" that did not appear when typing myStackoverflowexample
data(msms.dataset) # example given in the manual
msms.dataset
MSnSet (storageMode: lockedEnvironment)
assayData: 697 features, 14 samples
element names: exprs
protocolData: none
phenoData
sampleNames: U2.2502.1 U2.2502.2 ... U6.0302.3 (14 total)
varLabels: treat batch
varMetadata: labelDescription
featureData: none
experimentData: use 'experimentData(object)'
pubMedIds: http://www.ncbi.nlm.nih.gov/pubmed/22588121
Annotation:
- - - **Processing information** - - -
MSnbase version: 1.8.0
Any clue about this issue and finally be able to process my file with statistical analyses ?
Many thanks in advance for your help.
Initial (and so previous) Question :
I want to try the msmsTest package.
However, when I try the code from the manual with my example dataset, i have the following error message :
b<-read.delim("example.data.set.txt")
head(b)
name condition tissue LogFC
1 kjhss1 control brain 7.129283
2 sdth2 control brain 7.179909
3 sgdhstjh20 control brain 9.353147
4 jdygfjgdkydg21 control brain 6.459432
5 shfjdfyjydg22 control brain 9.372865
6 jdyjkdg23 control brain 9.541097
str(b)
'data.frame': 4461 obs. of 4 variables:
$ name : Factor w/ 1131 levels "dghwg1041","dghwg1086",..: 480 761 787 360 863 385 133 888 563 738 ...
$ condition: Factor w/ 5 levels "control","treatmentA",..: 1 1 1 1 1 1 1 1 1 1 ...
$ tissue : Factor w/ 2 levels "brain","heart": 1 1 1 1 1 1 1 1 1 1 ...
$ LogFC : num 7.13 7.18 9.35 6.46 9.37 ...
e <- pp.msms.data(b)
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘exprs’ for signature ‘"data.frame"’
So I am am stuck there and I cannot go further.
I have tried to define my dataset as.data.frame() or as.matrix(), but i get the same error message.
I have read information about the exprs() function in biobase: "These generic functions access the expression and error measurements of assay data stored in an object derived from the eSet-class."
But it doesn't help me much... I have read some post related to similar exprs() issues for genomic data but it sounds like "gibberish" to me. Apparently, perhaps something 's wrong with eSet-class structure of my data.frame but I don't understand what does this means and how to solve it.
Does anyone knows how to fix this issue and how to proceed ?
So many thanks in advance,
Kind regards,
SkyR