Plans for upcoming versions of the suite

I just want to share what is in my “to do” list and what I wish someone else could contribute to the R for photobiology suite of packages either as part of the suite or as independent extensions. In addition to the enhancements listed below, I hope at some point to be able to submit the packages in the suite to R Open Science to be peer reviewed.

What is at the top of what I intend to implement in package ‘photobiology’ is one additional class derived from generic_spct to be used to store spectral molar attenuation coefficient data or “spectral absorption cross section” data. This is an intensive property of a solute expressed per mole of substance. Of course, implementing a new class, will require also implementing the corresponding methods when those in the parent class are not suitable. The next step will be adding to package ‘ggspectra’ the necessary method specializations,  and the last step will be rebuilding/replacing several data objects in package ‘photobiologyPlants’ to use the new class to store spectral data for pigments. This enhancement will allow re-computation of spectra for dilute solutions of different concentrations. In addition it will make the suite more useful to chemists and those working with spectra of chemical species in solution. Hopefully, I will find time to implement and release this major enhancement within the next 12 to 18 months.

summary() methods for collections of spectra could be improved by adding a details parameter to force a more detailed returned value.

Another, more general aim, will be to decrease dependency on the tidyverse packages, except for ‘tibble’ which is central to the design of packages ‘photobiology’ and ‘ggplot2’. The reason for this change is that base R functions are much more stable than those in the tidyverse. In the last two to three years, most of the maintenance of exisitng code in the suite has been forced by updates to tidyverse packages. These changes to the tidyverse also make keeping the suite backwards compatible when releasing new versions more difficult. For objects of the size of those generally handled with the suite, there is no clear advantage in performance gained from the use of the tidyverse. In several cases, base R functions are faster, surprisingly, even sometimes by an order of magnitud or more.  One recent case I came across was reading spectral data stored one spectrum per row in .CSV files (a file with less than 10 rows but more than 2000 columns), a case where using ‘readr’ was prohibitibely slow even when preloading the file into RAM before reading it and where base R functions performed much faster.

Further down the “to do” list are enhancements to package ‘ggspectra’ allowing frequency and wavenumber as the quantity on the x-axis and new  autolayer() methods or statistics making it possible to easily add inset tables of summaries to plots. autoplot() methods still have English language axis labels hard coded, while scales use text from tables which allows support for multiple natural and markup languages. The plan is to update autoplot() methods to use the same tables and translations as the scales.

In package ‘photobiologyInOut’ support for additional data sources will be implemented when made possible by the availability of files and or instruments. Most likely this will be the case with Avantes spectrometers.

Other packages in the suite will be most likely receive only bug fixes or updates to the data they contain.

With respect to documentation, I plan to add one or two examples of how a collection of spectra can be included in a tibble as a column. This is convenient in some situations while that this is possible is far from obvious. This could break with future updates to package ‘tibble’, so it is important to have some examples in package ‘photobiology’ so that this use is tested by CRAN’s regular check mechanism and developers of package ‘tibble’ would be warned if their updates breaks this use.

The manuscript of the book R for Photobiology: Theory and recipes for common calculations available at LeanPub needs to be updated (the currently available version has not been revised in more than four years). The code chunks in the book still work with few exceptions requiring minor changes [10 April 2022]. These tests could be automated using GitHub actions and now the manuscript is available at GitHub. A much larger effort will be to update the code to reflect how much simpler it can be with current versions of the packages and to describe the new functionality added in recent years.

In my wish list is getting help or contributions or independent extension packages related to the photobiology of microorganisms including fungi, humans, mammals, birds, insects, reptiles and amphibians. In the case of package ‘photobiologyPlants’ it would very nice to get some code and/or data contributions related to algae, mosses, lichens and ferns, as well as aquatic angiosperms.

These and other updates to my R packages are always announced at this web site.

Share with

Leave a Reply