Skip to content

Commit

Permalink
Update example and metal_list
Browse files Browse the repository at this point in the history
  • Loading branch information
jpquast committed Aug 21, 2024
1 parent 8aeec99 commit 1f79110
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
6 changes: 5 additions & 1 deletion R/extract_metal_binders.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@
#' columns = c(
#' "ft_binding",
#' "cc_cofactor",
#' "cc_catalytic_activity"
#' "cc_catalytic_activity",
#' "keyword"
#' )
#' )
#'
Expand Down Expand Up @@ -690,11 +691,14 @@ extract_metal_binders <- function(data_uniprot,
)) %>%
dplyr::mutate(chebi_id = str_split(.data$chebi_id, pattern = ";")) %>%
tidyr::unnest("chebi_id") %>%
# Use the atom id if chebi ion ID is not present
dplyr::mutate(chebi_id = ifelse(is.na(.data$chebi_id),
stats::setNames(metal_list$chebi_id, metal_list$name)[.data$keyword],
.data$chebi_id
)) %>%
# first use uniprot data to directly annotate IDs that don't have a formula with the correct metal
dplyr::mutate(metal_id_part = stats::setNames(metal_chebi_uniprot$metal_atom_id, as.character(metal_chebi_uniprot$id))[.data$chebi_id]) %>%
# then use the metal_list to annotate the rest
dplyr::mutate(metal_id_part = ifelse(is.na(.data$metal_id_part),
stats::setNames(unlisted_metal_list$chebi_id, as.character(unlisted_metal_list$chebi_ion_id))[.data$chebi_id],
.data$metal_id_part
Expand Down
24 changes: 12 additions & 12 deletions data-raw/metal_list.R
Original file line number Diff line number Diff line change
Expand Up @@ -513,25 +513,25 @@ metal_list <- data.frame(
"33610",
"29101",
"39127",
"60272",
"63062",
"37763", # elemental
"29103",
"39124",
"39123",
"155869", # elemental
"190496",
"35172",
"61310",
"33516",
"25155",
"24875",
"23336",
"60248",
"25516",
"23378",
"27365",
"63056",
"84043",
"30549;30550",
"35826", # elemental
"49847",
"39130",
"39129",
"49978;49962",
NA, # no zirconium ion
"155922", # elemental
Expand All @@ -540,22 +540,22 @@ metal_list <- data.frame(
"30686;49862",
NA, # no Rhodium ion
NA, # no Palladium ion
"60247",
"60253",
"63063",
"49664",
"30475;30476",
"49867",
"36660", # elemental
"60270",
"39126",
"39125",
"37317;49701",
"37265", # elemental
"37265", # elemental submitted: CHEBI:231845
"229784",
"229785",
NA, # no Promethium ion
"49890",
"49588;49591",
"37285", # elemental
"37285", # elemental submitted: CHEBI:231846
"49902",
NA, # no Dysprosium ion
"49650",
Expand All @@ -573,8 +573,8 @@ metal_list <- data.frame(
"33970", # elemental
"25197",
"49920;30439",
"60249",
"85543",
"60252",
"85544",
NA, # no Polonium ion
NA, # no Astatine ion
"33502",
Expand Down
Binary file modified data/metal_list.rda
Binary file not shown.

0 comments on commit 1f79110

Please sign in to comment.