-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
define SMARTS patterns in internal dataset rather than in get_fx_grou…
…ps() code
- Loading branch information
Showing
9 changed files
with
51 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
#' Search patterns used for SIMPOL.1 functional groups | ||
#' | ||
#' | ||
#' This dataframe documents how functional groups for the SIMPOL.1 and Meredith | ||
#' et al. method are defined using SMARTS strings or `ChemmineR` functions. | ||
#' | ||
#' | ||
#' @format | ||
#' \describe{ | ||
#' \item{method}{Either "simpol1" for functional groups only used with the SIMPOL.1 method, or "meredith" for additional groups used in the Meredith et al. method.} | ||
#' \item{functional_groups}{These correspond to matching column names in the results of [get_fx_groups()].} | ||
#' \item{smarts}{SMARTS strings used to capture groups, when applicable} | ||
#' \item{fun}{The function used to capture the functional group. When `smarts` is not `NA`, this is always "ChemmineR::smartsSearchOB". Other groups are captured with other `ChemmineR` functions or as calculations using other functional groups.} | ||
#' \item{fun}{The function used to capture the functional group. When `smarts` is not `NA`, this is always "[ChemmineR::smartsSearchOB]". Other groups are captured with other `ChemmineR` functions or as calculations using other functional groups.} | ||
#' \item{notes}{Notes including how any functional group counts are corrected when there is overlap. E.g. when one SMARTS pattern is a subset of another pattern, but the two groups are counted separately without overlap in the SIMPOL.1 method.} | ||
#' } | ||
"smarts_simpol1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
In the future, if new methods are added, create a separate .csv file named smarts_<method>.csv. | ||
To turn this into a user-facing dataset, edit `make_data.R` to add another `usethis::use_data()` and document it by adding a new entry to `R/data.R`. To also use this in internal data, it needs to be added as an argument to `usethis::use_data(..., internal = TRUE)` since only one sysdata.rda can exist for holding internal data. E.g. `usethis::use_data(smarts_patterns_simpol1, smarts_patterns_newmethod, internal = TRUE, overwrite = TRUE)` | ||
|
||
Be sure to run the code in `make_data.R` and to run `devtools::document()` to update data and documentation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
## code to prepare `smarts` dataset goes here | ||
smarts_simpol1 <- readr::read_csv("data-raw/smarts_simpol1.csv") | ||
|
||
#create user-facing data.frame | ||
usethis::use_data(smarts_simpol1, overwrite = TRUE) | ||
|
||
#create internal named list with just SMARTS strings | ||
just_smarts_simpol1 <- | ||
smarts_simpol1 %>% | ||
dplyr::filter(!is.na(smarts)) | ||
smarts_patterns_simpol1 <- as.list(just_smarts_simpol1$smarts) | ||
names(smarts_patterns_simpol1) <- just_smarts_simpol1$functional_group | ||
|
||
usethis::use_data(smarts_patterns_simpol1, internal = TRUE, overwrite = TRUE) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.