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
Error in if (is.unsorted(ms[, 1L])) ms <- ms[order(ms[, 1L]), ]: missing value where TRUE/FALSE needed #13
Comments
Sorry, somehow I overlooked this issue. Could you eventually provide a (minimal) example msp where this is not working? I've observed similar things for msp that provide, in addition to m/z and intensity values also annotations for peaks. |
Hi, also came across this error reading .MSP files I had created. The cause of the error was one of the fields I added not having a colon separator, e.g. my file had the field "INSTRUMENT Thermo Exploris240". Once I updated the field to "INSTRUMENT: Thermo Exploris240" I was able to read the file with no issues. |
Hi @CLUES-Emory and @kozo2, thanks for reporting ! Could you send a (minified) broken example MSP ? |
I'm sorry, I forgot that I created this issue and ended up losing the msp 🙇 |
Hi @sneumann and @kozo2, The MSP file itself was made using code I created, copying and pasting below for reference.
|
Thanks! I'll have a look into this |
Note: I've added additional checks and more meaningful error messages in the PR #15 . That pull request also correctly imports the MS level (if provided in the MSP file). |
@sneumann , would be nice if you could give a quick look (+review) on the PR :) |
Feedback also on your test files @CLUES-Emory : With the new version we can read the good MSP (also importing the MS level correctly): > a <- readMsp("Good_MSP.txt")
> a
DataFrame with 2 rows and 15 columns
name msLevel rtime RETENTIONINDEX INSTRUMENTTYPE
<character> <integer> <numeric> <character> <character>
1 C00001 1 3574.79 3574.79 GC-HRMS
2 C00002 1 3397.41 3397.41 GC-HRMS
instrument polarity IONIZATION Spectrum_type Notes
<character> <integer> <character> <character> <character>
1 Thermo Exploris240 1 EI in-source Date processed 2024-..
2 Thermo Exploris240 1 EI in-source Date processed 2024-..
COMMENT Num.Peaks mz
<character> <character> <NumericList>
1 Study ID: HRE0041; N.. 59 59.5896, 65.8189,107.0492,...
2 Study ID: HRE0041; N.. 12 189.164,191.143,219.094,...
intensity dataOrigin
<NumericList> <character>
1 1.09,1.12,8.48,... Good_MSP.txt
2 2.54,3.48,1.03,... Good_MSP.txt While with the bad one you get now a eventually better error message: > a <- readMsp("Bad_MSP.txt")
Error: MSP format error. Make sure that data for multiple spectra are separated by an empty new line and that general spectrum metadata/information is provided in 'name: value' format (i.e. name and value of the metadata field separated by a ":"). |
I tried to read my own msp file as follows and got the following error.
Let me know if there is anything I should check.
The text was updated successfully, but these errors were encountered: