fixed alphanumeric character mismatches in parse_observation_longcode with latest fragalysis uploads#18
Open
BenEmeryCMD wants to merge 1 commit into
Open
Conversation
… with latest fragalysis uploads
Collaborator
|
Hi @BenEmeryCMD, I've tested your changes locally. When running UnsupportedFragalysisLongcodeError: NXT1A-x5155_B_303_0_1_NXT1A-x5194+B+303+C+1__LIGThen, when running │ 155 │ if mol: │
│ 156 │ │ smiles = MolToSmiles(mol, True) │
│ 157 │ elif sanitisation_failed == "error": │
│ ❱ 158 │ │ raise SanitisationError │
│ 159 │ elif sanitisation_failed == "warning": │
│ 160 │ │ mrich.warning(f"sanitisation failed for {smiles=}") │
│ 161 │
│ │
│ ╭──────────────────────────── locals ─────────────────────────────╮ │
│ │ key = '[STB]' │ │
│ │ mol = None │ │
│ │ orig_smiles = 'O=C([O-])C1CCN([S@TB2](=O)(=O)C2CC2)CC1' │ │
│ │ radical = 'error' │ │
│ │ s = 'O=C([O-])C1CCN([S@TB2](=O)(=O)C2CC2)CC1' │ │
│ │ sanitisation_failed = 'error' │ │
│ │ smiles = 'O=C([O-])C1CCN([STB2](=O)(=O)C2CC2)CC1' │ │
│ │ stereo_smiles = 'O=C([O-])C1CCN([S@TB2](=O)(=O)C2CC2)CC1' │ │
│ │ verbosity = False │ │
│ ╰─────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
SanitisationErrorThe issue seems to come from |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes parsing of newer Fragalysis observation longcodes in
Fragalysis.py.Some newer fragalysis uploads can contain alphanumeric characters where the existing parser expects only numeric characters.
Example new upload format in target lb36049-14 (NXT1-NXF1) :
observation = x5064b
longcode = NXT1A-x5064_B_204_B_v1
vs. old format
observation = x5064c
longcode = NXT1A-x5064_B_205_0_v1