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

Isotope labels for get.isotope.pattern #151

Open
gjgfml opened this issue Mar 5, 2024 · 1 comment
Open

Isotope labels for get.isotope.pattern #151

gjgfml opened this issue Mar 5, 2024 · 1 comment

Comments

@gjgfml
Copy link

gjgfml commented Mar 5, 2024

Hi,
I'm using the rCDK package and I'm getting the isotope pattern for a given molecular formula, but they have no labels as to what combination of isotopes each line belongs to.
Is there a way to get labels generated along side each isotopologue, their mass and respective abundance.

Hope you can help
G

@zachcp
Copy link
Contributor

zachcp commented Mar 8, 2024


library(rcdk)

formula <- get.formula("CCCCl")
get.isotopes.pattern(formula = formula, minAbund = 0.001)

#         mass      abund
# [1,] 70.96885 1.00000000
# [2,] 71.97221 0.03244718
# [3,] 72.96590 0.31995776
# [4,] 73.96926 0.01038173


get.isotopes.pattern(formula = formula, minAbund = 0.1)

#          mass     abund
# [1,] 70.96885 1.0000000
# [2,] 72.96590 0.3199578

Okay. I see what you mean. It will need some experimentation. Here's a version of the get.isotope.patterns internal code the might help you get started.Note; if you can do it in CDK you can do it in rCDK.

library(rcdk)

formula  <- get.formula("CCCCl")
minAbund <- 0.1

isoGen <- .jnew("org/openscience/cdk/formula/IsotopePatternGenerator",
                as.double(minAbund));

isoPattern <- isoGen$getIsotopes(formula@objectJ)

numIP <- isoPattern$getNumberOfIsotopes()

for (i in numIP) {
  isoContainer <- isoPattern$getIsotope(as.integer(i-1))
  print(isoContainer$getMass())
  print(isoContainer$getIntensity())
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants