Combining two MSnSet
4
0
Entering edit mode
@kamalfartiyal84-7976
Last seen 5.9 years ago
Cancer Research UK Cambridge Institute

Hi,

Is it possible to combine two MSnSet to create a single one by combining based on common protein or otherwise?

Kamal

 

 

msnbase • 2.3k views
ADD COMMENT
0
Entering edit mode
@laurent-gatto-5645
Last seen 6 weeks ago
Belgium

Yes, it is possible using the combine method.

This is described in Combining MSnSet instances section of the MSnbase: MS data processing, visualisation and quantification vignette. You can access it from R by typing vignette("MSnbase-demo", package = "MSnbase").

You can access it online here. Note that the online vignette matches the development version (but that section/functionality hasn't changed), while the one accessed directly from R matches you installed version.

ADD COMMENT
0
Entering edit mode
@kamalfartiyal84-7976
Last seen 5.9 years ago
Cancer Research UK Cambridge Institute

Hi,

The combine function for combining two different MSnSets with completely different sample names is producing erroneous results.

So instead of returning as mentioned in the vignette unique (n1)+unique (n2)+ shared (n1,n2) rows, it is returning an MSnSet with nrow of max(n1,n2). I tried various test cases but couldn't pin-point the exact reason of this error. I have already used updateFvarLabels and updateSampleNames before combining.

However, it gives this warning messages.

> test12 <- combine(test1,test2)

Warning messages:

1: In alleq(levels(x[[nm]]), levels(y[[nm]])) : 11 string mismatches

2: data frame column 'Experiment' levels not all.equal

3: In alleq(levels(x[[nm]]), levels(y[[nm]])) : 3 string mismatches

4: data frame column 'Label' levels not all.equal

I think this warning message is because these MSnSets consists of different samples.

Thanks.

Kamal

ADD COMMENT
0
Entering edit mode

It's not clear what you are reporting here, an error or a warning?

The warnings you see there could be related to different levels in the feature variables. Could you try to set the Experiment variable to a character to check. It is difficult to say more with additional details about the MSnSets. Could you share them for testing?

ADD REPLY
0
Entering edit mode
@kamalfartiyal84-7976
Last seen 5.9 years ago
Cancer Research UK Cambridge Institute

Hi Laurent,

I got it now. When combining different samples featureNames has to defined as protein accession (or the combining variable). In my dataset it had no featureNames but just numbers so thats why it was giving wrong results. It does not give any error message but just wrong results.

Thanks.

Kamal

 

 

ADD COMMENT
0
Entering edit mode
@kamalfartiyal84-7976
Last seen 5.9 years ago
Cancer Research UK Cambridge Institute

Hi,

One small confusing thing is the following message in the processing information where it should mention the dimensions of the combined MSnSets. Have a look into the text marked in bold. 

> exp12 <- MSnbase::combine(MSnset_P1, MSnset_P2)

> exp12

MSnSet (storageMode: lockedEnvironment)

assayData: 9197 features, 22 samples

  element names: exprs

protocolData: none

phenoData

  sampleNames: CMK.Rep1.MSnset_P1 CMK.Rep2.MSnset_P1 ...

    RefPool.4.MSnset_P2 (22 total)

  varLabels: Experiment Label ... Analyt.Rep (5 total)

  varMetadata: labelDescription

featureData

  featureNames: A0A0B4J2F0 A0AV96 ... Q9Y6V0 (9197 total)

  fvarLabels: Protein.MSnset_P1 Gene.MSnset_P1 ... Count.MSnset_P2 (10

    total)

  fvarMetadata: labelDescription

experimentData: use 'experimentData(object)'

Annotation:

- - - Processing information - - -

Combined [9197,22] and [8303,11] MSnSets Wed Jan 24 08:15:26 2018

> dim(MSnset_P1)

[1] 8607   11

> dim(MSnset_P2)

[1] 8303   11

ADD COMMENT
0
Entering edit mode

Thank you for the report - fixed on github and (soon) in devel.

ADD REPLY

Login before adding your answer.

Traffic: 620 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6