# OpenMS nodes for LC-MS/MS data in combination with MetaboliteSpectralMatcher

**URL:** <https://forum.knime.com/t/openms-nodes-for-lc-ms-ms-data-in-combination-with-metabolitespectralmatcher/37090>\
**Category:** Community Extensions\
**Tags:** openms\
**Created:** [November 2, 2021, 7:32pm UTC](https://forum.knime.com/t/openms-nodes-for-lc-ms-ms-data-in-combination-with-metabolitespectralmatcher/37090 "2021-11-02T19:32:39Z")\
**Posts on this page:** 15\
**Page:** 2

<div class="post-metadata">

**Author:** ![jpfeuffer](https://forum-cdn.knime.com/user_avatar/forum.knime.com/jpfeuffer/32/171_2.png) [@jpfeuffer](https://forum.knime.com/u/jpfeuffer)\
**Post date:** [November 5, 2021, 11:09am UTC](https://forum.knime.com/t/openms-nodes-for-lc-ms-ms-data-in-combination-with-metabolitespectralmatcher/37090/21 "2021-11-05T11:09:52Z")

</div>

I would do the mapping from MSM to Features _per-file_, i.e. in two branches of the same loop.  
Because after MapAlignment, RT values might be shifted slightly.

But yes, we need to find something to map the IDs of the features from the single runs to the consensus run. I have to think about that a bit.  
Internally there should be a unique ID for each feature, maybe we can access them in the consensus somehow.

---

<div class="post-metadata">

**Author:** ![ktzanakis](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/e95f7d/32.png) [@ktzanakis](https://forum.knime.com/u/ktzanakis)\
**Post date:** [November 5, 2021, 12:25pm UTC](https://forum.knime.com/t/openms-nodes-for-lc-ms-ms-data-in-combination-with-metabolitespectralmatcher/37090/22 "2021-11-05T12:25:19Z")

</div>

Yes I think I have done something similar here

 ![msm](https://forum-cdn.knime.com/uploads/default/original/3X/d/7/d753846189c59b31953643915bf582c28c02b9f5.png).

In the java snippet in this example, I am using the rt\_cf, mz\_cf (from MAPC and FeatureLinker) and retention\_time, exp\_mass\_to\_charge values for the tolerances.

> if(c\_exp\_mass\_to\_charge-c\_exp\_mass\_to\_charge_25_1/1000000\<=c\_mz\_cf && c\_mz\_cf\<=c\_exp\_mass\_to\_charge+c\_exp\_mass\_to\_charge_25_1/1000000){  
> if(c\_retention\_time\>=c\_rt\_cf-30 && c\_retention\_time\<=c\_rt\_cf+30){  
> out\_newrt = c\_rt\_cf;  
> out\_newmz = c\_mz\_cf;  
> }  
> }

However, wouldn’t it be more accurate to use the rt, mz of every file separately for the tolerances in the javasnippet (i.e. rt\_0,mz\_0 with retention\_time,exp\_mass\_to\_charge and then rt\_1,mz\_1 with retention\_time,exp\_mass\_to\_charge again)?

---

<div class="post-metadata">

**Author:** ![jpfeuffer](https://forum-cdn.knime.com/user_avatar/forum.knime.com/jpfeuffer/32/171_2.png) [@jpfeuffer](https://forum.knime.com/u/jpfeuffer)\
**Post date:** [November 5, 2021, 12:55pm UTC](https://forum.knime.com/t/openms-nodes-for-lc-ms-ms-data-in-combination-with-metabolitespectralmatcher/37090/23 "2021-11-05T12:55:50Z")

</div>

Yes I think it would be more accurate if you compare against the values of the file where the MSM matches came from.

Preferably even before MapAligner, as mentioned, because alignment will introduce RT shifts.

---

<div class="post-metadata">

**Author:** ![ktzanakis](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/e95f7d/32.png) [@ktzanakis](https://forum.knime.com/u/ktzanakis)\
**Post date:** [November 5, 2021, 1:24pm UTC](https://forum.knime.com/t/openms-nodes-for-lc-ms-ms-data-in-combination-with-metabolitespectralmatcher/37090/24 "2021-11-05T13:24:00Z")

</div>

So basically, put MAPC after the cross Joiner and java snippet where I check for tolerances. But, that means to use the MAPC after the join/comparison has taken place which means implement MAPC on the ~66 metabolites(in this case) that were joined. Is that right?

---

<div class="post-metadata">

**Author:** ![jpfeuffer](https://forum-cdn.knime.com/user_avatar/forum.knime.com/jpfeuffer/32/171_2.png) [@jpfeuffer](https://forum.knime.com/u/jpfeuffer)\
**Post date:** [November 5, 2021, 1:29pm UTC](https://forum.knime.com/t/openms-nodes-for-lc-ms-ms-data-in-combination-with-metabolitespectralmatcher/37090/25 "2021-11-05T13:29:36Z")

</div>

No, I mean, associating/cross-joining features with identifications in the same loop. Then align and link. Then re-associate all identifications from the single runs to the consensus.

---

<div class="post-metadata">

**Author:** ![ktzanakis](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/e95f7d/32.png) [@ktzanakis](https://forum.knime.com/u/ktzanakis)\
**Post date:** [November 5, 2021, 5:02pm UTC](https://forum.knime.com/t/openms-nodes-for-lc-ms-ms-data-in-combination-with-metabolitespectralmatcher/37090/26 "2021-11-05T17:02:35Z")

</div>

Ok, I think I am missing something again. How could I use the MAPC after the loop if I already do the cross-join first in the loop. There are no featureXMLs from MSM(it exports only in mzTab). There is only the cross-joined table. How could I align? Do you also mean checking for tolerances between cross-Joiner and loop end?

 ![msm2](https://forum-cdn.knime.com/uploads/default/original/3X/1/d/1d885f36d24f9b96f3d496c15d3ab1a031d7f777.png)

[Metabolite\_SpectralID.knwf](https://forum.knime.com/uploads/short-url/lrQqjfeieBmkQ8PGHndZl7QXk8Z.knwf) (72.8 KB)

---

<div class="post-metadata">

**Author:** ![ktzanakis](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/e95f7d/32.png) [@ktzanakis](https://forum.knime.com/u/ktzanakis)\
**Post date:** [November 6, 2021, 10:44am UTC](https://forum.knime.com/t/openms-nodes-for-lc-ms-ms-data-in-combination-with-metabolitespectralmatcher/37090/27 "2021-11-06T10:44:08Z")

</div>

I think you may mean something like the picture below.

 ![msm3](https://forum-cdn.knime.com/uploads/default/original/3X/b/9/b9fd69eb9d29f53abecdfba4d38352e1727fd0bb.png)

However, it is impossible to perform the 2nd cross-Join(after branch1 and branch2) because the branch1 creates a table with ~43.000 rows and the branch2 creates a table with ~14.000.000. So the cross-Join will take forever because the tolerances(Java Snippet) are placed later. But I guess, theoretically, that would be a way to include correction of retention time distortions.

---

<div class="post-metadata">

**Author:** ![jpfeuffer](https://forum-cdn.knime.com/user_avatar/forum.knime.com/jpfeuffer/32/171_2.png) [@jpfeuffer](https://forum.knime.com/u/jpfeuffer)\
**Post date:** [November 6, 2021, 12:21pm UTC](https://forum.knime.com/t/openms-nodes-for-lc-ms-ms-data-in-combination-with-metabolitespectralmatcher/37090/28 "2021-11-06T12:21:18Z")

</div>

Why does branch 2 have 14000000 rows? You only need to keep the associations where the ID was in tolerance.

---

<div class="post-metadata">

**Author:** ![jpfeuffer](https://forum-cdn.knime.com/user_avatar/forum.knime.com/jpfeuffer/32/171_2.png) [@jpfeuffer](https://forum.knime.com/u/jpfeuffer)\
**Post date:** [November 6, 2021, 12:25pm UTC](https://forum.knime.com/t/openms-nodes-for-lc-ms-ms-data-in-combination-with-metabolitespectralmatcher/37090/29 "2021-11-06T12:25:30Z")

</div>

In branch 2 you have to check for tolerances.

When merging the branches, you should be able to join exactly based on rt, mz, iteration of branch2 and rt\_n , mz\_n of the consensus branch1 where n is the iteration/file number.

---

<div class="post-metadata">

**Author:** ![ktzanakis](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/e95f7d/32.png) [@ktzanakis](https://forum.knime.com/u/ktzanakis)\
**Post date:** [November 6, 2021, 2:58pm UTC](https://forum.knime.com/t/openms-nodes-for-lc-ms-ms-data-in-combination-with-metabolitespectralmatcher/37090/30 "2021-11-06T14:58:42Z")

</div>

Thank you very much! I believe it is as accurate as it can get if I want MAPC. It is a bit expensive because of a cross-Join but it is feasible! Now I get around 450 metabolites in total (from 2 replicates) with corrected RTs which is more reasonable!

---

<div class="post-metadata">

**Author:** ![ktzanakis](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/e95f7d/32.png) [@ktzanakis](https://forum.knime.com/u/ktzanakis)\
**Post date:** [November 6, 2021, 4:00pm UTC](https://forum.knime.com/t/openms-nodes-for-lc-ms-ms-data-in-combination-with-metabolitespectralmatcher/37090/31 "2021-11-06T16:00:13Z")

</div>

So, after trying with negative and positive ionization mode with corresponding files, it possible that in the last join(join exactly based on rt, mz, iteration of branch2 and rt\_n , mz\_n of the consensus branch1) I get an empty table. In positive mode I do get 225 metabolites but in negative mode nothing.

PS: The weird thing is that from 2 negative ionization files, I get 160 identified metabolites from the MSM branch (branch2) which I join exactly on the rt\_n, mz\_n and iteration. Joining the rt\_0,mz\_0 and iteration I get an empty table and joining on rt\_1,mz\_1 and iteration I get 83 rows. The other 77 rows(from the 160) belong to the 1st file with rt\_0,mz\_0 which is kind of weird. But I imagine it has to do with the fact that the rts of the 1st file are actually shifted?

---

<div class="post-metadata">

**Author:** ![ktzanakis](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/e95f7d/32.png) [@ktzanakis](https://forum.knime.com/u/ktzanakis)\
**Post date:** [November 7, 2021, 8:26am UTC](https://forum.knime.com/t/openms-nodes-for-lc-ms-ms-data-in-combination-with-metabolitespectralmatcher/37090/32 "2021-11-07T08:26:58Z")

</div>

So, with the two files in negative ionization mode, if in the last join(branch1 against branch2) I use mz, iteration and intensity instead of rt of branch1 with the mz\_n, iteration, intensity\_n of branch2 where n is the iteration/file number, I get the expected results: 77 rows from the 1st replicate and 83 from the 2nd replicate = total of 160 metabolites. However, even if it is correct now, I am afraid it is not reliable or if it makes sense…

---

<div class="post-metadata">

**Author:** ![jpfeuffer](https://forum-cdn.knime.com/user_avatar/forum.knime.com/jpfeuffer/32/171_2.png) [@jpfeuffer](https://forum.knime.com/u/jpfeuffer)\
**Post date:** [November 8, 2021, 10:00am UTC](https://forum.knime.com/t/openms-nodes-for-lc-ms-ms-data-in-combination-with-metabolitespectralmatcher/37090/33 "2021-11-08T10:00:36Z")

</div>

Hmm I think you are right. rt\_0, rt\_1 etc are already the shifted times. Only the reference map will have the original values. I have to think about it more.

---

<div class="post-metadata">

**Author:** ![jpfeuffer](https://forum-cdn.knime.com/user_avatar/forum.knime.com/jpfeuffer/32/171_2.png) [@jpfeuffer](https://forum.knime.com/u/jpfeuffer)\
**Post date:** [November 12, 2021, 3:51pm UTC](https://forum.knime.com/t/openms-nodes-for-lc-ms-ms-data-in-combination-with-metabolitespectralmatcher/37090/34 "2021-11-12T15:51:15Z")

</div>

So I thought about something but I currently don’t have access to a computer and cannot construct a workflow for you.

Create a ZipLoopStart and ZipLoopEnd.  
Inside, do FFM.  
After the loop, there are two branches:  
One that Zip loops over the featureXMLs from the ZipLoopEnd and the input mzMLs at the same time and another branch that does MapAlignment.

In the loop do MSM and the matching to features.

After MapAlignment, start two branches.

In one branch, use a ziploop to loop over the aligned featureXMLs, export them, take the table of identified features from the MSM loop. Join by feature ID and keep the new rt and mz plus potential molecule IDs and the iteration/file number.

In the other branch, do Linking.

Then join as suggested the exported result from Linker by rt\_x, mz\_x with the result of the loop for unique ID matching.

Maybe that gets you started .

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [April 21, 2023, 9:44pm UTC](https://forum.knime.com/t/openms-nodes-for-lc-ms-ms-data-in-combination-with-metabolitespectralmatcher/37090/35 "2023-04-21T21:44:06Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

[Previous page](https://forum.knime.com/t/openms-nodes-for-lc-ms-ms-data-in-combination-with-metabolitespectralmatcher/37090.md?page=1)
