Spectral Library Explorer filter: wildcard?

support
Spectral Library Explorer filter: wildcard? meowcat  2023-10-11 05:51
 

Hi,

when searching e.g. for molecule names in the Spectral Library Explorer, the search currently looks for text only at the start of the string. I.e. the filter "benzo" finds "benzophenone" and "benzothiazole" but not "1H-benzotriazole". I tried using * or such, but this doesn't seem to be working. Especially for molecule names with some prefixes (e.g D-Glucose vs Glucose, or prefixes like 1,1',2-alpha....- etc) this makes it complicated to find the molecule if the user doesn't know the precise database name.

  1. is there already a way how to use wildcards in the filter string? (So I could type "*benzo" and find "1h-benzotriazole")
  2. would you consider adding wildcards and/or always searching in the entire string?

Thanks!

 
 
Brian Pratt responded:  2023-10-17 12:57

That's a very useful suggestion. I'll add it to our development list.

Thanks for using the Skyline support board,

Brian Pratt

 
meowcat responded:  2023-10-17 13:27

Hi Brian,

I already pushed a PR to the repo with a first naive implementation.
https://github.com/ProteoWizard/pwiz/issues/2748

Let's discuss there what's the best way to do this? The current implementation always does the "Contains" search; maybe it would be better to only do the "Contains" search when the user requests it (e.g with a "?" or "*" prefix, like "?benzotriazole")

 
Brian Pratt responded:  2023-10-17 14:29
Strong start!

A few thoughts:
1) A string extension is overkill, it's OK to just use IndexOf directly
2) There would be a performance hit on large libraries if we changed to always use IndexOf instead of StartsWith. We'd definitely want to look for a cue like "*" or "?" at the start of the search term. "*" makes more sense to me since "?" means "match a single character" in many contexts.
3) We'd want to add a tooltip to that control to advertise this new ability.

I'll make these same notes on your PR (if I have rights there)