EMSL-Computing / CoreMS

CoreMS is a comprehensive mass spectrometry software framework
BSD 2-Clause "Simplified" License
51 stars 25 forks source link

Added mass constraints to molecular search parameters #8

Closed Kzra closed 3 years ago

Kzra commented 3 years ago

This pull request allows users to specify minimum and maximum mass values as constraints in molecular formula assignment.

For example to assign formula based on the following constraint: 150 < m/z < 1000

You can specify : MSParameters.molecular_search.min_mz = 150 MSParameters.molecular_search.max_mz = 1000

corilo commented 3 years ago

The query uses the nominal masses from the mass spectrum to limit the search, so there is no need to manually input min and max m/z search, see method run_search (line 55 corems/molecular_id/search/molecularFormulaSearch.py)

Em ter., 6 de jul. de 2021 às 08:53, Ezra Kitson @.***> escreveu:

This pull request allows users to specify minimum and maximum mass values as constraints in molecular formula assignment.

For example to assign formula based on the following constraint: 150 < m/z < 1000

You can specify : MSParameters.molecular_search.min_mz = 150 MSParameters.molecular_search.max_mz = 1000

You can view, comment on, or merge this pull request online at:

https://github.com/EMSL-Computing/CoreMS/pull/8 Commit Summary

  • Added mass constraints to molecular search parameters

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/EMSL-Computing/CoreMS/pull/8, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEFQWIWG44R2EOJH63DCFI3TWMRGHANCNFSM4743NU5A .

Kzra commented 3 years ago

Okay, but what happens if you aren't interested in performing formula assignment on the full range of masses in your spectrum?

For example, if my mass spectrum has nominal masses in the range 150 to 1200 Da, but I am only interested in formula assignments in the range 300 to 800 Da.

corilo commented 3 years ago

Yes, that is a fair point, and the reason behind using the nominal mass as the filter was to decrease potential induced user bias. With that in mind, can you add a flag that will then enable the manual m/z limit filter and default it to false?

Kzra commented 3 years ago

Yes, I will work on that this week.

Kzra commented 3 years ago

On second thoughts, I’m going to close the pull request.

It occurred to me that if users want to filter their assignments based on mass, it’s easy enough to do after formula assignment. The only reason to include a mass constraint in formula assignment would be if it made the assignment faster. It makes sense that this should be the case, as if the formula database is smaller it should be quicker to iterate through. In practice I’m not sure it matters.

Also, the way I’ve implemented the changes doesn’t seem stable. I’ve noticed that certain user defined mz ranges causes HeteroatomsClassification to crash.

As an aside, a feature that might be worth including is the ability to constrain formula assignment based on kendrick mass and kendrick mass defect.