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

OpenSwathWorkflow - swath_windows_file type not restricted! #7299

Open
bruadi opened this issue Jan 14, 2024 · 16 comments
Open

OpenSwathWorkflow - swath_windows_file type not restricted! #7299

bruadi opened this issue Jan 14, 2024 · 16 comments
Assignees

Comments

@bruadi
Copy link

bruadi commented Jan 14, 2024

Hi,
I have a problem with OpenSwath when I load the swath_windows_file into OpenSwath:

/Applications/OpenMS-3.1.0/bin/OpenSwathWorkflow \ -in /Volumes/.../All_pos/18625_PS-B1-7.mzML \ -tr /Users/Documents/test/assaylibrary.tsv \ -tr_type tsv \ -sort_swath_maps \ -swath_windows_file /Users/Desktop/SWATHwindows_analysis.tsv \ -batchSize 1000 \ -readOptions cacheWorkingInMemory \ -tempDirectory /tmp \ -out_tsv osw_output.tsv \

I always get this error message:

Since neither rt_norm nor tr_irt is set, OpenSWATH will not use RT-transformation (rather a null transformation will be applied)
Validate provided Swath windows file:
Read Swath window header: 'start end
Read Swath window file with 20 SWATH windows.
Progress of 'Load TSV file':
-- done [took 0.03 s (CPU), 0.03 s (Wall)] -- 
Loaded 0 proteins, 870 compounds with 4292 transitions.
Loading mzML file /Volumes/.../18625_PS-B1-7.mzML using readoptions cache
Progress of 'Loading metadata file /Volumes/.../All_pos/18625_PS-B1-7.mzML':
Will analyze the metadata first to determine the number of SWATH windows and the window sizes.
Determined there to be 20 SWATH windows and in total 1180 MS1 spectra
Determined there to be 20 SWATH windows and in total 1180 MS1 spectra
-- done [took 4.68 s (CPU), 4.70 s (Wall)] -- 
Progress of 'Loading data file /Volumes/.../18625_PS-B1-7.mzML':
Read chromatogram while reading SWATH files, did not expect that!
Read chromatogram while reading SWATH files, did not expect that!
Read chromatogram while reading SWATH files, did not expect that!
-- done [took 11.43 s (CPU), 12.43 s (Wall)] -- 
1180 spectra and 0 chromatograms stored.
Read Swath window header: 'start end
<1180 spectra and 0 chromatograms stored.> occurred 21 times
Read Swath window file with 20 SWATH windows.
Re-annotate from file: SWATH 50 / 217.6 (raw data) is annotated via swath_windows_file with 50 / 217.1
Re-annotate from file: SWATH 216.6 / 340.3 (raw data) is annotated via swath_windows_file with 217.1 / 339.8
Re-annotate from file: SWATH 339.3 / 441.4 (raw data) is annotated via swath_windows_file with 339.8 / 440.9
Re-annotate from file: SWATH 440.4 / 524.9 (raw data) is annotated via swath_windows_file with 440.9 / 524.4
Re-annotate from file: SWATH 523.9 / 571.6 (raw data) is annotated via swath_windows_file with 524.4 / 571.1
Re-annotate from file: SWATH 570.6 / 643.4 (raw data) is annotated via swath_windows_file with 571.1 / 642.9
Re-annotate from file: SWATH 642.4 / 687.3 (raw data) is annotated via swath_windows_file with 642.9 / 686.8
Re-annotate from file: SWATH 686.3 / 720.1 (raw data) is annotated via swath_windows_file with 686.8 / 719.6
Re-annotate from file: SWATH 719.1 / 740.1 (raw data) is annotated via swath_windows_file with 719.6 / 739.6
Re-annotate from file: SWATH 739.1 / 755 (raw data) is annotated via swath_windows_file with 739.6 / 754.5
Re-annotate from file: SWATH 754 / 764.1 (raw data) is annotated via swath_windows_file with 754.5 / 763.6
Re-annotate from file: SWATH 763.1 / 775.1 (raw data) is annotated via swath_windows_file with 763.6 / 774.6
Re-annotate from file: SWATH 774.1 / 786.1 (raw data) is annotated via swath_windows_file with 774.6 / 785.6
Re-annotate from file: SWATH 785.1 / 793.1 (raw data) is annotated via swath_windows_file with 785.6 / 792.6
Re-annotate from file: SWATH 792.1 / 806.1 (raw data) is annotated via swath_windows_file with 792.6 / 805.6
Re-annotate from file: SWATH 805.1 / 814.2 (raw data) is annotated via swath_windows_file with 805.6 / 813.7
Re-annotate from file: SWATH 813.2 / 829.6 (raw data) is annotated via swath_windows_file with 813.7 / 829.1
Re-annotate from file: SWATH 828.6 / 842.7 (raw data) is annotated via swath_windows_file with 829.1 / 842.2
Re-annotate from file: SWATH 841.7 / 903.3 (raw data) is annotated via swath_windows_file with 842.2 / 902.8
Re-annotate from file: SWATH 902.3 / 1250 (raw data) is annotated via swath_windows_file with 902.8 / 1250
Will analyze 4292 transitions in total.`

`Progress of 'Extracting and scoring transitions':
Use non-nested loop with 1 threads.
Thread 0_0 will analyze 6 compounds and 26 transitions from SWATH 2 (batch 0 out of 1)
Thread 0_0 will analyze 6 compounds and 26 transitions from SWATH 2 (batch 1 out of 1)
Thread 0_0 will analyze 36 compounds and 172 transitions from SWATH 3 (batch 0 out of 1)
Thread 0_0 will analyze 36 compounds and 172 transitions from SWATH 3 (batch 1 out of 1)
  19.05 %               Thread 0_0 will analyze 66 compounds and 314 transitions from SWATH 4 (batch 0 out of 1)
Thread 0_0 will analyze 66 compounds and 314 transitions from SWATH 4 (batch 1 out of 1)
  23.81 %               Thread 0_0 will analyze 83 compounds and 393 transitions from SWATH 5 (batch 0 out of 1)
Thread 0_0 will analyze 83 compounds and 393 transitions from SWATH 5 (batch 1 out of 1)
  28.57 %               Thread 0_0 will analyze 160 compounds and 792 transitions from SWATH 6 (batch 0 out of 1)
Thread 0_0 will analyze 160 compounds and 792 transitions from SWATH 6 (batch 1 out of 1)
  33.33 %               Thread 0_0 will analyze 94 compounds and 470 transitions from SWATH 7 (batch 0 out of 1)
Thread 0_0 will analyze 94 compounds and 470 transitions from SWATH 7 (batch 1 out of 1)
  38.10 %               Thread 0_0 will analyze 83 compounds and 415 transitions from SWATH 8 (batch 0 out of 1)
Thread 0_0 will analyze 83 compounds and 415 transitions from SWATH 8 (batch 1 out of 1)
  42.86 %               Thread 0_0 will analyze 48 compounds and 240 transitions from SWATH 9 (batch 0 out of 1)
Thread 0_0 will analyze 48 compounds and 240 transitions from SWATH 9 (batch 1 out of 1)
Thread 0_0 will analyze 41 compounds and 205 transitions from SWATH 10 (batch 0 out of 1)
Thread 0_0 will analyze 41 compounds and 205 transitions from SWATH 10 (batch 1 out of 1)
  52.38 %               Thread 0_0 will analyze 31 compounds and 155 transitions from SWATH 11 (batch 0 out of 1)
Thread 0_0 will analyze 31 compounds and 155 transitions from SWATH 11 (batch 1 out of 1)
Thread 0_0 will analyze 34 compounds and 170 transitions from SWATH 12 (batch 0 out of 1)
Thread 0_0 will analyze 34 compounds and 170 transitions from SWATH 12 (batch 1 out of 1)
  61.90 %               Thread 0_0 will analyze 32 compounds and 160 transitions from SWATH 13 (batch 0 out of 1)
Thread 0_0 will analyze 32 compounds and 160 transitions from SWATH 13 (batch 1 out of 1)
Thread 0_0 will analyze 21 compounds and 105 transitions from SWATH 14 (batch 0 out of 1)
Thread 0_0 will analyze 21 compounds and 105 transitions from SWATH 14 (batch 1 out of 1)
Thread 0_0 will analyze 35 compounds and 175 transitions from SWATH 15 (batch 0 out of 1)
Thread 0_0 will analyze 35 compounds and 175 transitions from SWATH 15 (batch 1 out of 1)
  76.19 %               Thread 0_0 will analyze 17 compounds and 85 transitions from SWATH 16 (batch 0 out of 1)
Thread 0_0 will analyze 17 compounds and 85 transitions from SWATH 16 (batch 1 out of 1)
Thread 0_0 will analyze 36 compounds and 180 transitions from SWATH 17 (batch 0 out of 1)
Thread 0_0 will analyze 36 compounds and 180 transitions from SWATH 17 (batch 1 out of 1)
  85.71 %               Thread 0_0 will analyze 15 compounds and 75 transitions from SWATH 18 (batch 0 out of 1)
Thread 0_0 will analyze 15 compounds and 75 transitions from SWATH 18 (batch 1 out of 1)
Thread 0_0 will analyze 32 compounds and 160 transitions from SWATH 19 (batch 0 out of 1)
Thread 0_0 will analyze 32 compounds and 160 transitions from SWATH 19 (batch 1 out of 1)
-- done [took 16.76 s (CPU), 17.02 s (Wall)] -- 
OpenSwathWorkflow took 34.23 s (wall), 32.94 s (CPU), 2.56 s (system), 30.38 s (user); Peak Memory Usage: 944 MB.

SWATH window #1 from swath_windows_file extends beyond the Swath window of the data. Did you forget to apply the sort_swath_maps flag? (override with -force) Overridden with -force.

I have set up my swath windows file exactly as described here: "Automated SWATH Data Analysis Using Targeted Extraction of Ion Chromatograms; doi: 10.1007/978-1-4939-6747-6_20

What am I doing wrong?

Best regards

@jcharkow
Copy link
Collaborator

Everything looks ok from the output so I am not sure off the top of my head. Perhaps it is a bug in the program? For now I would just continue using the -force flag

@hroest do you have any ideas?

@jpfeuffer
Copy link
Contributor

Swath window header parsing looks incomplete. Which separators were used?
What do you think @jcharkow?

@cbielow
Copy link
Contributor

cbielow commented Jan 16, 2024

The errors seems to come from https://github.com/OpenMS/OpenMS/blob/develop/src/openms/source/ANALYSIS/OPENSWATH/SwathWindowLoader.cpp#L64.

The only way it gets there is, if:

 50 <= 50    and  217.1 <= 217.6 

fails.
Both these comparisons look very TRUE to me, so I'd guess its not really 50<=50 but rather 50.00001 <= 50 internally.

@bruadi Can you try to use 50.1 in your /Users/Desktop/SWATHwindows_analysis.tsv file and see if this helps?
If yes, the mzML file does not actually store a plain 50, but something slightly larger. Hence the error/warning.

@bruadi
Copy link
Author

bruadi commented Jan 16, 2024

@cbielow you are right, it works. Thank you! :)
Now I have one more thing. When I load the same file into the OpenSwathWorkflow in Knime, the swath windows file is not recognized:
image

What could be the reason?

@jpfeuffer
Copy link
Contributor

This is just a warning. Does it not proceed?

I though I fixed allowing arbitrary filetypes for unspecified ports in recent OpenMS plugin versions. Which version are you using?

@cbielow @jcharkow this is a minor bug since OpenSwathWorkflow does not specify any formats for this parameter.

Also Read Swath window header: 'start end This looks fishy to me. What is this log message? Probably a logging bug since it does not look right.

@bruadi
Copy link
Author

bruadi commented Jan 16, 2024

@jpfeuffer It's just a warning, but it's not being processed. I have the latest version 3.0.0 .

Everything works without port 5:
image

But as soon as I connect the swath windows file to port 5, OpenSwath immediately turns "red" ... .
image

Port 5 has been described: 5 Optional tab-delimited file with the SWATH windows for extraction: lower_offset upper_offset. Note that the first line is a header line and is skipped. [,opt.]

Even if I rename the headers to lower_offset upper_offset, I get the same message... . But the headers are not read at all ...

@jpfeuffer
Copy link
Contributor

Hmmm I see. And there is no other output for the node?

@bruadi
Copy link
Author

bruadi commented Jan 16, 2024

What do you mean by "no other output for the node"? Regarding the OpenSwathWorkflow node (only allowed the output of OSW)?
As soon as I connect the Input Files Node with the Swath Windows file to the OpenSwathworkflow Node, it looks exactly like in the 2nd screenshot...

@jpfeuffer
Copy link
Contributor

I mean "right-click -> View std output" or output on the log window.

@bruadi
Copy link
Author

bruadi commented Jan 16, 2024

ahh, sry.
image

I think that since the node does not start processing at all, but switches directly to red, there is no log message...

@jpfeuffer
Copy link
Contributor

But in this case there probably should be an error in the console or the KNIME logs. Can you increase the KNIME log level to DEBUG in the settings?

@bruadi
Copy link
Author

bruadi commented Jan 16, 2024

I have increased Knime Log level to DEBUG.
Unfortunately, nothing changes in the console:
image

But I can find this in the knime.log file:
2024-01-16 14:58:06,801 : DEBUG : main : : WorkflowEditPartFactory : : : Activate org.knime.workbench.editor.context
2024-01-16 14:58:06,802 : DEBUG : main : : WorkflowEditPartFactory : : : Activate org.knime.workbench.editor.context
2024-01-16 14:58:08,309 : DEBUG : main : : WorkflowEditPartFactory : : : Deactivate org.knime.workbench.editor.context
2024-01-16 14:58:08,310 : DEBUG : main : : WorkflowEditPartFactory : : : Deactivate org.knime.workbench.editor.context
2024-01-16 14:58:08,312 : DEBUG : main : : WorkflowEditPartFactory : : : Activate org.knime.workbench.editor.context
2024-01-16 14:58:08,312 : DEBUG : main : : WorkflowEditPartFactory : : : Activate org.knime.workbench.editor.context
2024-01-16 14:58:10,799 : WARN : main : : Node : OpenSwathWorkflow : 4:842 : Invalid MIMEtype at port number 5 : has extension: 'tsv'; expected one of: []
2024-01-16 14:58:10,800 : DEBUG : KNIME-Workflow-Notifier : : WorkflowEditor : : : Workflow event triggered: WorkflowEvent [type=NODE_SETTINGS_CHANGED;node=4:842;old=null;new=null;timestamp=16 Jan 2024, 14:58:10]
2024-01-16 14:58:11,942 : DEBUG : main : : WorkflowEditPartFactory : : : Deactivate org.knime.workbench.editor.context
2024-01-16 14:58:11,944 : DEBUG : main : : WorkflowEditPartFactory : : : Deactivate org.knime.workbench.editor.context

@jpfeuffer
Copy link
Contributor

Sorry, but then I am out of ideas. Nothing looks wrong here. You tried to run it, right?

@bruadi
Copy link
Author

bruadi commented Jan 16, 2024

I can't run the OpenSwathWorkflow node at all, because it switches directly to red as soon as I connect the node with port 5...
hmm, bad. I'll have to live with it then? 😅

@jpfeuffer
Copy link
Contributor

Unfortunately, maybe. You can ask in the KNIME forum if they can help with getting advanced logs or how to debug this.
Some ideas: View -> KNIME.log. Hover over the exclamation mark. Play with log levels and logging settings. Reset workflow, do the same. Rebuild workflow, do the same. Restart KNIME, do the same.

But without any error text, it is hard to suggest anything.

As a last resort you can set up an Eclipse debug environment and debug the full KNIME software with the OpenMS plugin but this would be very advanced.

Or you wait until someone adds a restriction to the parameter in the tool and then wait for a next OpenMS release in KNIME.

@bruadi
Copy link
Author

bruadi commented Jan 16, 2024

@jpfeuffer thanks for your help!

I think I will wait until the next OpenMS release in Knime and control the OpenSwathWorkflow via CLI until then.

Would this be fixed until the next release in Knime?

@jpfeuffer jpfeuffer changed the title OpenSwath - swath_windows_file OpenSwathWorkflow - swath_windows_file type not restricted! Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants