We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This works....
> formula <- get.formula('C6H19KN2O10', charge = 1) > isvalid.formula(formula,rule=c("nitrogen","RDBE")) [1] FALSE
But when I try....
> formula <- get.formula('C5H13KN9O5', charge = 1) > isvalid.formula(formula,rule=c("nitrogen","RDBE")) Error in .jcall(rdbeRule, "D", "validate", molecularFormula) : java.lang.NullPointerException
I'm trying to validate formulae generated with generate.formula
library(rcdk) molFormula <- function(mz){ ppm = (2/1000000)*mz temp <- generate.formula(mz, window=(2/1000000)*mz, elements=list(c("C",0,120), c("H",0,180), c("N",0,20), c("O",0,20), c("S",0,20), c("Na",0,1), c("K",0,1) ), validation=FALSE, charge =1) df <- data.frame(matrix(ncol = 4, nrow = 0)) x <- c("formula", "mass", "charge", "ppmError") colnames(df) <- x for (i in temp) { print(i@string) formula <- get.formula(i@string, charge = 1) print(isvalid.formula(formula,rule=c("nitrogen","RDBE"))) } return (df) } mz <-318.06768 formulae <- molFormula(mz)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This works....
But when I try....
I'm trying to validate formulae generated with generate.formula
The text was updated successfully, but these errors were encountered: