IngallsLabUW / Ingalls_Standards

A repository containing the Ingalls Lab standards list, available for download.
0 stars 3 forks source link

Creating new standards mixes switch wishlist #40

Closed wkumler closed 1 year ago

wkumler commented 1 year ago

We've been throwing around the idea of remaking our HILIC standard mixes for a while now and I'm putting together a wishlist of which compounds would be great to have in the other mix to make assignment easier. If a peak is in one standard mix and not the other, you can be pretty sure it's the compound belonging to that mix instead of an isomer. To do this, we need to have the isomers in different standard mixes and ideally alternating in retention time. I've put together a list of isomers and a wishlist for which the compounds to switch into the different mix. If there's two compounds listed either one could be switched.

  1. Leucine -> Mix2
  2. Dimethylglycine/4-aminobutyric acid -> Mix 2
  3. Allopurinol -> Mix 1
  4. Valine/glycine betaine -> Mix 2
  5. Threonine/homoserine -> Mix 2
  6. D-glucose-6-phosphate -> Mix 2
  7. Succinyl CoA/D-methylmalonyl CoA -> Mix 2
  8. Lactose -> Mix 1
  9. Cysteinolic acid/Amino hydroxypropanesulfonate -> Mix 1 (do we even see either of these?)
wkumler commented 1 year ago

Code for determining the above:

mz_group <- function(mz_vals, ppm){
  group_vec <- numeric(length(mz_vals))
  group_num <- 1L
  init_vec <- mz_vals
  names(init_vec) <- seq_along(init_vec)
  while(length(init_vec)>0){
    mz_i <- init_vec[1]
    err <- mz_i*ppm/1000000
    mz_idxs <- init_vec>mz_i-err & init_vec<mz_i+err
    group_vec[as.numeric(names(mz_idxs)[mz_idxs])] <- group_num
    init_vec <- init_vec[!mz_idxs]
    group_num <- group_num+1L
  }
  group_vec
}

library(dplyr)

"https://raw.githubusercontent.com/IngallsLabUW/Ingalls_" %>%
  paste0("Standards/master/Ingalls_Lab_Standards.csv") %>%
  read.csv() %>%
  filter(Compound_Type!="Internal Standard") %>%
  filter(Column=="HILIC") %>%
  filter(z<0) %>%
  mutate(mz_group=mz_group(mz, 10)) %>%
  group_by(mz_group) %>%
  mutate(n=n()) %>%
  arrange(desc(n), mz_group, RT_minute) %>%
  select(1:6, mz_group, n) %>%
  filter(n>1) %>% split(.$mz_group)