Skip to content

Refinement step cannot recover Cl/S when missing from initial formula #5

Description

@josiehong

While benchmarking, I observed consistent failures on compounds containing Cl and S (e.g., 4-chlorobenzoic acid, methionine). In these cases, the initial formula prediction drops the heteroatom (Cl/S), and the refinement step cannot recover it, leading to incorrect final predictions.

This appears to be due to refine_atom_type being limited to ['C', 'O', 'N', 'H']. Since refinement only edits within this set, any atom type missing from the initial formula (e.g., Cl or S) is unrecoverable, even if supported by MS/MS evidence. This effectively restricts refinement to CHNO space and limits performance on halogenated and sulfur-containing compounds.

A possible fix is to extend the refinement atom types with tight bounds, e.g.:

refine_atom_type: ['C', 'O', 'N', 'H', 'Cl', 'S']
refine_atom_num:  [3,    3,    3,    -1,   1,    1]

This should allow recovery of Cl/S while keeping the search space controlled.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions