-
Notifications
You must be signed in to change notification settings - Fork 19
Refactored tcplPlot and auxiliary functions to support any number of curves on a comparison plot #325
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
Conversation
also halved the 'number of curves' in the error comparison test cases that had too many plots for console plotting
- passed down to ggplot2 and plotly functions - added param to test cases - added docs
essentially rebase dev onto plotting branch
Had some install warnings related to these packages: |
This actually was user error related to not using tcplPlotLoadData. Thanks @cthunes ! New error:
|
This is due to the addition of the "gt" package in our DESCRIPTION: https://cran.r-project.org/web/packages/gt/index.html . See the Imports version requirements |
Resolved with latest commit! Logic didn't cover the case that all table components within a comparison besides m4id are in common, like when comparing across versions. |
- unnest flag, mc6Mthd_id, resp, and logc (conc was already unnested)
The resultant PDF file is now much larger when plotting on this test branch compared to using dev. File is too large to share over email. In my example, I'm only plotting two endpoints:
|
@madison-feshuk I ran this example alongside several other combinations: single/multi plots, compare/not compare, verbose/not verbose. I never had any difference remotely that big (max 30KB). 311_DEVTOX and dev_DEVTOX are my two I produced just like your example -- not seeing this issue. Can we find a way to reproduce this? |
Had the following error when trying to output a plot to console:
|
Resolved by making plotly plot compatible with loec plots! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving! After much testing, plotting updates seem to be working great
- there was a bug in the output with a warning for a conversion error for U+200B (ZWSP)
Removed
compare.val
param from tcplPlot and replaced it withcompare
. Usecompare
to choose a field from plot loaded data to compare on. For example,compare = "dsstox_substance_id"
will match all of the same chemical across the loaded data (say,fld= "aeid", val = c(<list of 4 endpoints>)
. If all 4 endpoints test the same chemicals, then the output (for 'pdf') would be a list of plots which contain 4 curves/point sets, each for a different chemical. By defaultcompare = "m4id"
, which means all samples will be plotted individually, since everym4id/s2id
is always unique.Use
dat
with preloaded -- and potentially manipulated data -- for more flexibility. For example one could load plot data usingtcplPlotLoadData
the same way we would intcplPlot
, then add a custom column, say for user decided compare grouping rather than just using the default available fields incompare
. Ifdat
is instead a list of data.tables, nocompare
field is needed and each list item will be interpreted bytcplPlot
as a separate comparison plot.If you have an especially large number of curves to plot on each comparison plot, the new type of compare plot could be useful. There are two new parameters to
tcplPlot
called and with defaults:group.fld = NULL
andgroup.threshold = 9
. This means at the specified (or default of 9)group.threshold
value, curves on comparison plots will be grouped differently by color and in the legend, and a verbose table will no longer be printed as it becomes excessively large. The defaultgroup.fld
if the number of curves on a plot exceedsgroup.threshold
ismodl
formc
andhitc
forsc
(up for suggestions on better defaults). Both are fully customizable, so you can use any field available in the data forgroup.fld
, including a custom field ifdat
is supplied, and any size small or large as a minimumgroup.threshold
to switch over to the other style. Setgroup.threshold
to a large number to effectively disable this functionality. The most common use case currently for this functionality is when plotting an entire endpoint on one comparison plot. Extensive tress testing has not been done for this to find the limits, but so far using a Tox21 endpoint, I have been successful up to about 3000 curves before I run into "node stack overflow" errors. I think ggplot may have some limits on the number of layers.Note -
verbose = TRUE
is the new default fortcplPlot
!248 new unit tests passing. devtools::check() successful. Closes #293. Closes #215. Closes #280. Closes #249. Closes #228. Closes #175. Closes #311. Closes #117. Closes #241. Closes #296. Closes #50. Closes #336.
Loec plotting is also included within this pull request.
tcplPlot PR.pptx