Skip to content
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

Capture OpenBabel errors and add to output of calc_vol() #56

Closed
Aariq opened this issue Jul 25, 2023 · 3 comments · Fixed by #104
Closed

Capture OpenBabel errors and add to output of calc_vol() #56

Aariq opened this issue Jul 25, 2023 · 3 comments · Fixed by #104
Labels
enhancement New feature or request priority: high High priority

Comments

@Aariq
Copy link
Collaborator

Aariq commented Jul 25, 2023

Warnings and errors from OpenBabel are unfortunately difficult to capture, but it would be nice if there was some indication of parsing problems in the output of calc_vol(). Either that or just turning the OpenBabel errors into R errors and OpenBabel warnings into R warnings.

An example:

> path <- tempdir()
> kegg <- get_mol_kegg("C01209", dir = path)
> calc_vol(kegg$mol_path)
==============================
*** Open Babel Warning  in InChI code
  Malonyl-[acyl-carrier protein] :Unknown element(s): *
==============================
*** Open Babel Error  in InChI code
  InChI generation failed
==============================
*** Open Babel Warning  in InChI code
  Malonyl-[acyl-carrier protein] :Unknown element(s): *
==============================
*** Open Babel Error  in InChI code
  InChI generation failed
==============================
*** Open Babel Warning  in InChI code
  Malonyl-[acyl-carrier protein] :Unknown element(s): *
==============================
*** Open Babel Error  in InChI code
  InChI generation failed
# A tibble: 1 × 5
  mol_path                         formula name                           volatility category
  <chr>                            <chr>   <chr>                               <dbl> <chr>   
1 /var/...C01209.mol               C3H3O3S Malonyl-[acyl-carrier protein]       6.59 high    
@Aariq
Copy link
Collaborator Author

Aariq commented Jul 25, 2023

These messages seem to come primarily from ChemmineR::propOB()

@Aariq
Copy link
Collaborator Author

Aariq commented Jul 25, 2023

Conversation on how to capture OpenBabel errors: girke-lab/ChemmineR#14

@Aariq Aariq added the enhancement New feature or request label Jul 26, 2023
@Aariq
Copy link
Collaborator Author

Aariq commented Dec 1, 2023

A good example of where this gives misleading results is with phosphatidylcholine. The structure on KEGG has "R" groups for the fatty acid chain that OpenBabel can't parse. So it gets read in as only having 10 carbons and the volatility is way overestimated putting it in the "high" category. This really should result in NAs across the board for functional groups and calculations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority: high High priority
Projects
None yet
1 participant