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

62 bidirectional summary stats #126

Merged
merged 14 commits into from
Aug 30, 2023
Merged

62 bidirectional summary stats #126

merged 14 commits into from
Aug 30, 2023

Conversation

cthunes
Copy link
Contributor

@cthunes cthunes commented Aug 17, 2023

Added the following eight summary stats

  • min_mean - the minimum mean response (interpretable as the max mean response in the negative direction)
  • min_mean_conc - the concentration at which the min_mean was observed
  • min_med - the minimum median response (interpretable as the max median response in the negative direction)
  • min_med_conc - the concentration at which the min_med was observed
  • max_med_diff - the median response furthest from baseline, or zero, regardless of direction (the maximum median difference). Can be negative or positive.
  • max_med_diff_conc - the concentration at which the max_med_diff was observed
  • nmed_gtbl_pos - the number of median responses greater than baseline (3 * bmad) in the positive direction. Same implementation as nmed_gtbl. nmed_gtbl values have been copied to nmed_gtbl_pos.
    • nmed_gtbl will need to be dropped at a later date while refactoring any code that uses it, may need another ticket.
  • nmed_gtbl_neg - the number of median responses greater than baseline (-3 * bmad) in the negative direction

Table schema for mc4 has been updated to reflect these new summary stats. Uploaded file to Clowder and tracked in schema_changes table. Closes #62.

@madison-feshuk
Copy link
Collaborator

Saw following error writing Level 4:

Writing level 4 data for 4 ids...
Completed delete cascade for 4 ids (4.94 secs)
Error in h(simpleError(msg, call)) :
error in evaluating the argument 'value' in selecting a method for function 'dbWriteTable': Some items of .SDcols are not column names: [nmed_gtbl]

logc_max = max(logc), logc_min = min(logc), nconc = length(unique(logc)),
npts = .N, nrep = median(as.numeric(nconcs)), nmed_gtbl = sum(med_rmds) / first(nconcs),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like nmed_gtbl might be dropped in code, but column is kept in the database

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Column has been dropped in invitrodb

@cthunes
Copy link
Contributor Author

cthunes commented Aug 21, 2023

Writing and loading data now accounting for new columns. I didn't change the columns for code using old schema, is this assumption correct?

`:=`(fitparams = list(tcplfit2::tcplfit2_core(unlist(concentration_unlogged),
unlist(response),
cutoff = bmad,
bidirectional = bidirectional,
bidirectional = TRUE,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cthunes, was this changed from 'bidirectional' passed argument to TRUE since this the max_med_diff and max_med_diff_conc are only apply to the bidirectional = TRUE cases for right now?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind.... This is because we are only fitting in the bi-directional direction now within tcpl.

@cthunes
Copy link
Contributor Author

cthunes commented Aug 22, 2023

Including updated mc6 methods that formerly used nmed_gtbl in this PR. Closes #127

@madison-feshuk madison-feshuk self-requested a review August 30, 2023 15:25
Copy link
Collaborator

@madison-feshuk madison-feshuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good with padilla processing! This is a huge update. I think we should merge this branch to dev, where we can continue testing

@cthunes cthunes merged commit 6e482f8 into dev Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants