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

Rings are over-counted #57

Closed
Aariq opened this issue Jul 27, 2023 · 3 comments · Fixed by #58
Closed

Rings are over-counted #57

Aariq opened this issue Jul 27, 2023 · 3 comments · Fixed by #58
Labels
bug Something isn't working

Comments

@Aariq
Copy link
Collaborator

Aariq commented Jul 27, 2023

The ChemmineR::rings() function counts all possible rings by default. E.g, for caffeine (pictured below), it counts 3 rings. The 5-membered ring, the 6-membered ring, and the ring you'd get if you traced an outline around both! volcalc should use the inner = TRUE option to only count the smallest possible rings—it currently uses the default inner = FALSE in get_fx_groups() so calc_vol() is overestimating the number of rings for any compound with joined rings.

library(ChemmineR)
#caffeine SMILES
caf <- ChemmineR::smiles2sdf("CN1C=NC2=C1C(=O)N(C(=O)N2C)C")
rings(caf)
#> $ring1
#> [1] "C_5" "N_4" "C_3" "N_2" "C_6"
#> 
#> $ring2
#> [1] "C_7"  "N_9"  "C_10" "N_12" "C_5"  "C_6" 
#> 
#> $ring3
#> [1] "C_7"  "N_9"  "C_10" "N_12" "C_5"  "N_4"  "C_3"  "N_2"  "C_6"
rings(caf, inner = TRUE)
#> $ring1
#> [1] "C_5" "N_4" "C_3" "N_2" "C_6"
#> 
#> $ring2
#> [1] "C_7"  "N_9"  "C_10" "N_12" "C_5"  "C_6"

Created on 2023-07-27 with reprex v2.0.2

@Aariq Aariq added the bug Something isn't working label Jul 27, 2023
@Aariq
Copy link
Collaborator Author

Aariq commented Jul 27, 2023

This could make a really big difference for RVI with compounds like triterpenoids that have multiple rings. Solanine, for example, has 24 rings with inner = TRUE and 9 with inner = FALSE

@KristinaRiemer
Copy link
Collaborator

Oh wow, good catch! The ring count always seemed like a mess, hopefully this improves it.

@Aariq
Copy link
Collaborator Author

Aariq commented Jul 27, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants