Skip to content

Interactive Graphics for ChemoSpec

Tejasvi Gupta edited this page Feb 24, 2021 · 5 revisions

ChemoSpec is an R package for analyzing spectroscopic data using exploratory data analysis, a branch of chemometrics. Spectroscopic data arises mostly in chemical but also physical contexts. Chemometrics is the application of statistical methods to analyze chemical data. For this project you don't really need to know anything about spectroscopy or chemometrics. You can learn more about ChemoSpec here.

The Project

ChemoSpec uses base graphics with one exception in which lattice graphics are used, and another instance in which the D3.js JavaScript library is used. The base graphics system of R produces very nice, publication quality graphics (at least under the right conditions), though customizing base graphics requires a lot lines of code. When ChemoSpec was originally written, none of the interactive graphics systems developed in the past 10 years either existed or was mature. Most of these newer graphic systems provide higher level interfaces that "just work" meaning fewer lines of code are needed, compared to base graphics.

The goal of this project is to create an additional interactive graphics system for ChemoSpec. Users will be able to choose the type of graphics output. The current plan is to create ggplot2 graphics which will then be then fed into plotly.

Expected Impact

ChemoSpec has a large international user base. Interactive graphics will modernize this aspect of the package and improve the user experience. Students participating in this project will have an opportunity to learn more about R graphics and improve their coding skills.

Mentors

  • MENTOR (EVALUATING): Bryan Hanson hanson@depauw.edu is the author of ChemoSpec as well as a number of other R packages (Link). Bryan has been working with R for more than 10 years, primarily in the area of spectroscopy and chemometrics. He has participated in GSOC in 2020, 2016 and 2013, each time with the R project.
  • MENTOR: Erick Oduniyi eeoduniyi@gmail.com was a student participant in GSOC in 2020, working on the hyperSpec package. In addition to his knowledge base developed in GSOC, Erick brings a broad interdisciplinary background to the project.

Tests

Students, please e-mail both mentors after completing at least one of the tests below, which are designed to showcase your R coding skills and knowledge of the R ecosystem. Complete each task in order please.

  • Easy: Download and install ChemoSpec, and take a look at the vignette to get an idea of what it does. Run the example for plotSpectra, except use the SrE.IR data set and plot only the pure Serenoa repens extract samples. Offset the spectra so that they display without overlapping.
  • Medium: Take a look at the code for function plotSpectra. Write a modified version that only plots a single spectrum using the same base graphics approach, for simplicity. Call your function plotSpectra2. Be sure to update the documentation for the function. Demonstrate your new function using the SrE.IR data set.
  • Medium-Hard (hard if you need to learn ggplot2 basics): Write another version of your function that creates the plot using ggplot2. Call it plotSpectra3. Try to get all the features present in the base graphics version but using typical ggplot2 approaches. Don't get stuck if you are unclear about certain features, just omit them (and feel free to ask).
  • Medium: Modify your ggplot2 version to pass the object to plotly. Call it plotSpectra4.
  • Medium: Dig into the code for function plotScores. Write out, in order, the other ChemoSpec functions that plotScores calls in order to create a plot. Describe each call's purpose with a short phrase. This list (sequence) would be the steps that need to be re-created with a different graphics system. Which ggplot2 geoms will be needed at each step? Put your results in a table.

Test Solutions

Students, please post links your test solutions here. Be sure to e-mail both mentors when you post or update your solutions.

S No. STUDENT NAME GITHUB PROFILE TEST RESULTS LINK
1 Tejasvi Gupta GitHub Profile Test Results