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

containsElements #51

Closed
meowcat opened this issue Feb 11, 2022 · 1 comment
Closed

containsElements #51

meowcat opened this issue Feb 11, 2022 · 1 comment

Comments

@meowcat
Copy link
Contributor

meowcat commented Feb 11, 2022

> containsElements("C9H10FNO2", "F")
[1] FALSE
> containsElements("C9H10F1NO2", "F")
[1] FALSE
> containsElements("C9H10FNO2", "F1")
[1] FALSE
> containsElements("C9H10F1NO2", "F1")
[1] FALSE
> fo <- standardizeFormula("C9H10FNO2")
> containsElements(fo, "F")
[1] FALSE
> fo <- standardizeFormula("C9H10F1N1O2")
> containsElements(fo, "F")
[1] FALSE
> containsElements(fo, "F1")
[1] FALSE

In contrast, sometimes it works:

> containsElements("C10H10F3N3", "F1")
[1] TRUE
> containsElements("C10H10F3N3", "F")
[1] TRUE

Weirdness:

> containsElements("C10H10F3N3", "F3")
[1] FALSE
> containsElements("C10H10F3N3", "F2")
[1] TRUE
@meowcat
Copy link
Contributor Author

meowcat commented Feb 11, 2022

FUN = function(xx, yy)all(.sum_elements(c(xx, -yy)) > 0),

should be >=0

meowcat added a commit to meowcat/MetaboCoreUtils that referenced this issue Feb 11, 2022
meowcat added a commit to meowcat/MetaboCoreUtils that referenced this issue Feb 11, 2022
Added test covering the original problem rformassspectrometry#51
jorainer added a commit that referenced this issue Feb 11, 2022
Update chemFormula.R, fixing #51
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