-
Notifications
You must be signed in to change notification settings - Fork 14
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
How to produce dose-response curves using db 4.1? #215
Comments
Hi Laura, the several tcpl functions used in the past to produce the different plotting outputs have now been consolidated into tcplPlot(). Check out some plotting examples and documentation in the data retrieval vignette: https://cran.r-project.org/web/packages/tcpl/vignettes/Data_retrieval.html#plotting. Once you have the desired mc5, you can use tcplPlot to plot by spid/aeid or m4id. Hope this helps! ep <- "NVS_ENZ_hPDE4A1" |
This makes me think that we need to deprecate these old plotting functions with a explanation to switch to the new |
Perfect, thanks for the tcplPlot code! |
Revisiting this issue. I thought I had this working, but now I can't remember what I did. Is there a way to get just the ggplot2 object out of the ep <- "NVS_ENZ_hPDE4A1"
cas <- "1912-24-9"
chem_info <- tcplLoadChem(field = 'casn', val = cas)
assay_info <- tcplLoadAeid(fld = "acnm", val = ep)
mc5 <- tcplLoadData(lvl = 5, type = "mc",
fld = c("aeid","spid"),
val = list(assay_info$aeid,
chem_info$spid))
plot_out <- tcplPlot(lvl = 5,
fld = c("spid","aeid"), # fields to query on
val = list(mc5$spid, # sample id's
mc5$aeid # assay endpoint id's
),
by = "aeid", # parameter to divide files
multi = FALSE,
verbose = TRUE, # output all details if TRUE
output = "console")
plot_out So, is there a way to set it up that plot_out is a ggplot2 object? Right now it looks like a plotly object, but it's not rendering in my viewer. packageVersion("tcpl")
[1] ‘3.1.0’ |
@ldecicco-USGS we're investigating this issue. I think it's 2 parts
I think your use case warrants creating an option in the output so you can get the ggplot2 object |
I did just update to 4.4, so that tracks. I would definitely vote having a ggplot output option. Plotly's nice for some things, but being able to take the ggplot output and customize it is something I would do (maybe just change a theme or add an annotation or who knows what) |
Agreed, we will use this ticket to add ggplot output as an option. FYI for the 4.4 issues. |
Any updates to getting ggplot2 outputs? I'd really like to include the ACC value on the plots or make other customizations. |
Hi @ldecicco-USGS, thank you for the suggestion! The requested changes are now in a pull request (#275) and available for testing out on this branch "215-add-ggplot-output-option-to-tcplPlot". To work with the ggplot output, simply set |
@ldecicco-USGS have you been able to successfully use this branch? |
Yup, looks good! plot_out <- tcplPlot(#lvl = 5,
fld = c("spid", "aeid"),#c("spid","aeid"), # fields to query on
val = list( # value for each field, must be same order as 'fld'
mc5$spid, # sample id's
mc5$aeid # assay endpoint id's
),
by = "aeid", # parameter to divide files
multi = TRUE, # multiple plots per page - output 6 per page if TRUE
verbose = FALSE, # output all details if TRUE
output = "ggplot")
plot_out + ggtitle("My new title") |
I updated my ToxCast database to prod_internal_invitrodb_v4_1. I'm using version 3.1.0 of tcpl.
When I was using ToxCast 3.5, the following script would produce a plot:
Is there a new way to do this with the new database structure?
The text was updated successfully, but these errors were encountered: