oxford-pharmacoepi / MegaStudy

4 stars 2 forks source link

DUS error with DUS_14.R, object 'cellulitis_erysipelas_woundinfection' not found #73

Closed hejatibor closed 2 weeks ago

hejatibor commented 1 month ago

Using DUS_14.R (from #53 ) the following error came:

observation domain: Limiting to domains of interest
observation: Getting concepts to include
observation domain: Adding descendants
✔ 192 candidate concepts identified
Time taken: 3 minutes and 5 seconds
ℹ Generating 1 cohort
ℹ Generating cohort (1/1) - covid_19
✔ Generating cohort (1/1) - covid_19 [59.2s]
Error in get(ind) : 
  object 'cellulitis_erysipelas_woundinfection' not found
Calls: .rs.sourceWithProgress ... eval -> source -> withVisible -> eval -> eval -> get
In addition: Warning message:
In system("timedatectl", intern = TRUE) :
  running command 'timedatectl' had status 1
Execution halted

The log from the storage is attached SUCD_log.txt

tiozab commented 1 month ago

it looks like you have an older version of the repo, please pull and should be fine. (use the renvlock and DUS1_point4.R code) but the rest should be from the repo the object is in the individual_indications.R file image

hejatibor commented 1 month ago

Thanks, with the refreshed repo I've got this error:

→ Start summary of data, at 2024-07-14 19:42:18
✔ Summary finished, at 2024-07-14 19:42:19
! names of group will be ignored
! names of strata will be ignored
ℹ The following estimates will be computed:
• number_exposures: min, q05, q25, median, q75, q95, max, mean, sd,
  count_missing, percentage_missing
• duration: min, q05, q25, median, q75, q95, max, mean, sd, count_missing,
  percentage_missing
• cumulative_quantity: min, q05, q25, median, q75, q95, max, mean, sd,
  count_missing, percentage_missing
• number_eras: min, q05, q25, median, q75, q95, max, mean, sd, count_missing,
  percentage_missing
• initial_quantity: min, q05, q25, median, q75, q95, max, mean, sd,
  count_missing, percentage_missing
• impute_daily_dose_percentage: min, q05, q25, median, q75, q95, max, mean, sd,
  count_missing, percentage_missing
• impute_duration_percentage: min, q05, q25, median, q75, q95, max, mean, sd,
  count_missing, percentage_missing
• initial_daily_dose: min, q05, q25, median, q75, q95, max, mean, sd,
  count_missing, percentage_missing
• cumulative_dose: min, q05, q25, median, q75, q95, max, mean, sd,
  count_missing, percentage_missing
! Table is collected to memory as not all requested estimates are supported on
  the database side
→ Start summary of data, at 2024-07-14 19:42:29
✔ Summary finished, at 2024-07-14 19:42:30
Error in if (cdm[["concept"]] %>% dplyr::filter(.data$concept_id == .env$ingredientConceptId) %>%  : 
  argument is of length zero
Calls: .rs.sourceWithProgress ... lapply -> FUN -> eval -> eval -> checkIngredientConceptId
In addition: There were 50 or more warnings (use warnings() to see the first 50)
Execution halted

Could you help, please, what to do? Thanks Tibor

tiozab commented 1 month ago

thanks which version of DrugUtilisation PatientProfiles CDMConnector and omopgenerics are you using? @hejatibor

tiozab commented 1 month ago

In case you are using the correct version of DrugUtilisation (0.6.0) this check throws the error:

conceptSet <- list(
  cdm[["drug_strength"]] |>
    dplyr::filter(.data$ingredient_concept_id == .env$ingredientConceptId) |>
    dplyr::pull("drug_concept_id")
)
**names(conceptSet) <- cdm[["concept"]] |>
  dplyr::filter(.data$concept_id == .env$ingredientConceptId) |>
  dplyr::pull("concept_name")**

can you double check that you have the concept_names for all the ingredients in your cdm$concept table?

ingredients <- as.integer(c(19098548, 1347450, 1594587, 912803, 40171288, 780442, 45892599, 1741122, 45892906, 1333379, 40239665, 1536743, 1742432, 1348407, 1525746, 1734104, 1750500, 1729720, 1728416, 1713332, 1759842, 1777806, 1774470, 1709170, 1778162, 1746114, 19136187, 1307515, 1186087, 42904205, 1510627, 1361580, 1151789, 937368, 912263,36857573, 19041065, 1114375, 19080982, 1397141, 718583, 40242044, 40168938, 36878937, 35200405, 37003361, 1311078,902730,36863408, 1311799, 19078097, 903643, 19012565, 19034726, 19010482, 950637, 1503983, 40174604, 42800246, 36878851 ))

plus, I would need your log.txt from the storage folder to see at which drug it fails. we have had problems with 36857573 and 36863408, so if those are the trouble makers then you can just comment them out as follows: .... 912263, #36857573, 19041065, 1114375, 19080982, 1397141, 718583, 40242044, 40168938, 36878937, 35200405, 37003361, 1311078,902730, #36863408, ......

plus in the names:

            ......
       "certolizumab pegol",    # "CERTOLIZUMAB",
       "golimumab",
       "anakinra",
       "ranibizumab",
       "bevacizumab",
       "nicotine",
       "icatibant",
       "ecallantide",
       "Conestat alfa",
       "lanadelumab",
       "berotralstat",
       "cytarabine","Cytarabine liposomal", # "CYTARABINE 5'-PHOSPHATE",
       ......

these are quite a few steps, but hope it helps to figure out the problem. In any case, showing me the log would always be a good idea.

hejatibor commented 1 month ago

Thank you for your help, I really appreciate it. With these modifications I was able to run the DUS code succesfully.