A subscription to JoVE is required to view this content. Sign in or start your free trial.

Method Article

A User-friendly and Powerful R Analysis of Large-scale Datasets

645 views

DOI:

10.3791/68868

November 4th, 2025

In This Article

Summary

This report describes a method involving an R script in the open-source software RStudio to analyze large-scale datasets obtained from time series experiments.

Abstract

Large datasets are increasingly common in the scientific field. It is important to develop user-friendly tools to allow researchers to analyze these large datasets with ease. Here, we introduce a method involving an R script in the open-source software RStudio to analyze large-scale datasets obtained from time series experiments. This method requires minimal input from a user, allowing a beginner who does not have prior R knowledge or programming experience to use it. The detailed instructions described here and in the R script shall further guide users on how to use the method. The input data and the output results are stored in the same folder of a local computer, making it possible to do the analysis anywhere and anytime. The output results are organized into folders for easy interpretation, and they can be conveniently processed to generate figures for publications. This method has been successfully used to analyze circadian clock data and reactive oxygen species burst data, both containing large-scale datasets from time series experiments in a 96-well-plate format. We believe that this method provides a facile and powerful solution for researchers in analyzing similar large datasets obtained through time series experiments.

Introduction

With the increased availability of large datasets in the scientific field, it is important to develop user-friendly tools to allow researchers to quickly analyze these large datasets with accuracy and ease. One type of the common large dataset comes from the use of the luciferase gene as a reporter, which has allowed an easy, continuous, and noninvasive examination of gene expression in live cells and organisms. Automation in luminescence recording has transformed the measurement of luciferase luminescence and led to an expansion of data collection, in particular, in the circadian clock field1,2. Using 96-well microplates and an automatic plate reader with a stacker, thousands of samples expressing the luciferase gene can be individually assayed in time series, sometimes at one-hour intervals for days, in one experiment. Such high-throughput experiments have resulted in the production of large datasets that traditional gene expression experiments using hand sample collection, followed by RNA processing, could not possibly achieve. Analyzing such large datasets in a timely manner is important but can be challenging.

Although there exists a plethora of tools to analyze data for rhythmicity, many of the tools analyze animal behavior-based assays rather than luminescence reporter expression3,4,5,6,7 (Supplemental Table S1). Some tools require researchers to have prior computer programming skills, such as Python skills or access to MATLAB. Other tools require the purchase of software, which can be costly. Some free workable solutions are available online. One such tool is BioDare28, which offers a variety of different methods to analyze rhythmicity data. BioDare2 is a user-friendly online tool and requires minimal computational expertise. Users need to upload data input online and download data output from the online interface for further processing.

Here, we present user-friendly R scripts with multiple capabilities for analyzing large-scale datasets with ease. We use the free, open-source software RStudio9, an interface for R and Python, to run the scripts. RStudio can be used on various computer systems, including Windows, Mac, and Linux. In this report, detailed stepwise instructions are provided to guide users on how to use the R scripts, specifically in protocol sections 1 and 2. This method requires minimal input from the user. A beginner who does not have prior R knowledge and who has no programming experience shall be able to use the method to analyze large datasets from luciferase assays or other types of datasets with time series data. All input and output data are stored on a local computer, and thus, an analysis can be done anywhere without the restriction of internet access, once all the relevant R packages are downloaded for the first time. The output data are sorted into well-organized folders with results ready to be processed for publications. Statistical analyses are also included as part of the output to provide a quick assessment of the differences among the samples. Thus, the R method could provide a facile and powerful solution for researchers in analyzing large datasets.

Access restricted. Please log in or start a trial to view this content.

Protocol

1. Luciferase-based circadian clock analysis

  1. Experimental setup for the luciferase assay
    NOTE: The luciferase assay is a common method used to gauge circadian clock activity in real time. Luminescence, emitted from the luciferase reporter carried by live transgenic organisms and/or cells, can be recorded automatically, leading to the production of large-scale time series datasets. Our laboratory primarily uses Arabidopsis thaliana seedlings expressing the luciferase gene as a reporter. Figure 1 and Figure 2 show a flow chart of the typical experimental setup for the luciferase assay with seedlings in a 96-well format in our laboratory, modified based on a previous description2.
    1. Sterilize seeds with bleach vapor generated by adding 3 mL of 36% (w/w) HCl to 100 mL house bleach in a beaker for 3 h. Place the beaker in a bell jar with a sealed lid, placed in a chemical fume hood. After the sterilization, plate the seeds on 1/2MS plates containing 0.5% sucrose and 0.8% agar (pH 5.7), using a sterile glass Pasteur pipette, in a laminar flow cabinet. Collect the chemical waste in a jar with a lid and dispose of it by working with institutional environmental health service department.
    2. Put plates in 4 °C for 2 days before moving them to a tissue culture chamber with 12 h light and 12 h dark light cycle (LD).
    3. Let seedlings grow for 4 d in LD.
    4. Transfer seedlings to a 96-well plate; each well containing 180 µL of assay media (1/2MS, 0.5% sucrose, 0.4% agar, 0.25 mM luciferin). Place the plates for 1 day in LD followed by 1 day in 24 h of constant light (LL).
    5. Add treatments or mock solution to the wells and record luminescence at 1 h intervals for 5-7 days in LL. Set the emission filter lens at 3,600 for gain and the measurement interval time at 1 s.
      NOTE: The starting time for recording can be at any time. However, because the R script only takes integers (whole numbers), the recording intervals must be a whole number. For example, a 1 h interval is permitted, but a 15 min interval is not permitted for the R script.
    6. At the end of the recording, take a photo of the plate to record seedling growth.
    7. Save raw data as a CSV file for R analysis, using the save as function with the data analysis software for the plate reader.
  2. Stepwise explanation of R analysis of luciferase-based circadian data
    ​NOTE: This R analysis uses the R script Supplemental File 1 (LUC_2025.R), developed for circadian data analysis, and the input file Supplemental File 2 (NO7.csv). The R script along with the input file is publicly available via the online repository platform Github (https://github.com/elvenfire29/Circadian-Luciferase-Analysis).
    1. Download RStudio software that is compatible with the computer system9,10.
    2. Download the RStudio algorithmic packages required by Supplemental File 1 (LUC_2025.R): MetaCycle11: ARSER algorithm12 of the MetaCycle package, ggplot213, dplyr14, magrittr15, stringr16, filesstrings17, circular18, AICcmodavg19, and broom20.
      NOTE: See also the top of the R script for the list of packages.
    3. Change User Input I (according to a specific dataset on a local computer, including the working directory, the name of the input file, labels for the treatments, and the relative start time of the assay.
      NOTE: Steps 1.2.1 and 1.2.2 only need to be completed once; after which the RStudio interface console is ready to take user input, with modifications for each new analysis. There are two parts in the User Input section (Supplemental Figure S1).
      1. Select the working directory. Indicate where the input file resides. The same folder will be the location for the output files.
      2. Select the input file, a CSV file correctly formatted for the R script (Figure 2B). Specifically, the top row has the time series, and the first column contains individual sample positions on a 96-well plate.
        NOTE: An example of such an input CSV file can be found in Supplemental File 2 (NO7.csv).
      3. Name the samples and/or treatments. As this analysis is used for data obtained from 96-well settings with a time course, design the experiments as 8 replicates per treatment for a total of up to 12 treatments per plate, or as 12 replicates per treatment for a total of up to 8 treatments per plate. Be sure to enter the correct number of samples, either 8 or 12, because the sample number counts; if the sample count is not 8 or 12, the code will not run. However, if there are rows of empty wells, just list them as such in the space for treatment names, for example, naming as empty 1, empty 2...
        NOTE: For sample names, one should avoid using backslashes or similar symbols as they may cause file name issues. Additionally, one should also avoid using "NA" as a label when selecting to use ANOVA in User Input II. Any treatments with the exact same name will be combined into one large treatment group.
      4. Indicate the relative start time for the assay. For a given day of 24 h, subjective dawn is when the chamber light is turned on during a normal light/dark cycle. For example, if light is on at 7 am, consider this time the circadian time 0. If a luciferase assay begins at 9 am, the assay time is at circadian time 2; input 2 as the relative start time.
        NOTE: The relative start time must be a whole number and cannot be negative. This will affect the phase reading of the samples.
    4. Change User Input II options per specific needs.
      NOTE: The instructions below provide a more detailed explanation of the User Input sections and a step-by-step guide for making the changes.
      1. Include graphs: luminescence curves, plots for the period, phase, and amplitude per genotype and treatment.
      2. Use the ANOVA test with the Tukey HSD to compare treatments on their period, phase, and amplitude. Choose a control for the ANOVA test output; specify the control for the ANOVA test or leave the option empty to use each treatment as a control in the pairwise comparison. Alternatively, choose whether to number the ANOVA output files for quicker reference and organization.
      3. Use a t-test to compare treatments on their period, phase, and amplitude. Choose whether the t-test should be a pairwise comparison; if a pairwise t-test is selected, select whether the data are paired. Choose a control for the t-test; specify the control for the t-test or leave the option empty to use each treatment as a control. Choose whether to number the t-test output files for quicker reference and organization.
        NOTE: This should only be used to compare two treatments at once, such as two lines of the same genotype with either SA or Mock added. The p-values shown are not adjusted to account for multiple comparisons with the same line.
      4. Choose whether to round the time points. If the time points are off by only a minute or two, round to the nearest hour and use this analysis.
        NOTE: This code calculates the period, phase, and amplitude using the ARS method12. This method requires a consistent time series in hours to run.
      5. Depending on how the plate reader records wells, change the way the input is read. Choose either the standard data listing of wells by A1, A2, A3... or the one for wells listed by A1, B1, C1...
    5. Run the analysis by simply clicking the Source button on the top right corner of the console.
      NOTE: The analysis takes less than 1 min to complete. The output of the R analysis will automatically appear in the same file folder as the input dataset.
    6. View output: The output folder has several documents and sub-folders to provide a comprehensive analysis, including statistical information of the averaged period, phase, and amplitude for replicates of each genotype and/or treatment.
      ​NOTE: For the input file Supplemental File 2 (NO7.csv), a list of the output documents generated by the Supplemental File 1 (LUC_2025.R) script in protocol section 1 is described in Table 1 and can be conveniently viewed with the tree structure in Supplemental Figure S2.

2. Luminol-based ROS Assay

  1. Experimental setup for ROS assay
    1. Cut 4 mm-diameter leaf discs from the fourth to seventh leaves of 25-day-old plants with a biopsy puncher.
    2. Float the leaf discs with the hairy side up atop 100 µL of sterile water in a 96-well plate.
    3. Cover the plate with clean tin foil and place it in an LD growth chamber overnight.
    4. Replace water with 100 µL of luminol solution (300 µM in 10 mM MOPS buffer with pH 7.4, and 1 µM flg22 or another elicitor). Use mock solution in place of flg22 as a control.
    5. Immediately start recording luminescence readings every minute for 40-60 min.
  2. Stepwise explanation of R analysis of ROS data
    NOTE: This R analysis uses Rstudio, the R script, Supplemental File 3 (ROS_2025.R), and the input files Supplemental File 4 (ROS_flg22.csv) or Supplemental File 5 (ROS_elf26.csv). The R script along with the input file Supplemental File 4 (ROS_flg22.csv) is publicly available via the online repository platform Github (https://github.com/elvenfire29/ROS-Luminol-Analysis)
    1. Download RStudio packages: gplot213, dplyr14, magrittr15, stringr16, and filesstrings17.
      NOTE: Steps 2.2.1 only need to be completed once. To help users to tailor each analysis to a specific set of data on the computer, a section called "User Input" was created to allow users to indicate specific parameters for their experiments (Supplemental Figure S3).
    2. Change User Input I according to a specific dataset on a local computer, including the working directory, the name of the input file, labels for the treatments, and the relative start time of the assay.
      1. Select the working directory. Indicate where the input file resides. The same folder will be the location for the output files.
      2. Select the input file, a CSV file correctly formatted for the R script (Figure 2B). Specifically, the top row has the time series, and the first column contains individual sample positions on a 96-well plate.
        NOTE: An example of such an input CSV file can be found in the supplemental material, Supplemental File 4 (ROS_flg22.csv) or Supplemental File 5 (ROS_elf26.csv).
      3. Name the samples and/or treatments. As this analysis is used for data obtained from 96-well settings with a time course, design the experiments as 8 replicates per treatment for a total of up to 12 treatments per plate, or as 12 replicates per treatment for a total of up to 8 treatments per plate. If there are rows of empty wells, just list them as such in the space for treatment names, for example, naming as empty 1, empty 2...
        NOTE: It is important to enter the correct number of samples, either 8 or 12, because the sample number counts. If the sample count is not 8 or 12, the code will not run. For sample names, avoid using backslashes or similar symbols as they may cause file name issues. Also avoid using "NA" as a label when selecting to use ANOVA in User Input II. Unlike the Supplemental File 1 (LUC_2025.R) script, treatments with the same name do not combine into a single group in this Supplemental File 3 (ROS_2025.R) script.
    3. Change User Input II options per user's specific needs.
      NOTE: Example User Input can be seen in Supplemental Figure S3.
      1. Use the ANOVA test with the Tukey HSD to compare treatment luminescence sums.
      2. Use a two-sided t-test to compare the data from only two treatments at once.
        NOTE: The p-values shown are not adjusted to account for multiple comparisons with the same line.
      3. Graph the fluorescence curves and a bar plot comparing the total sum of fluorescence. Add standard deviation or standard error of mean to the graphs.
      4. Depending on how the plate reader records wells, change the way the input is read. Either use the standard data listing of wells by A1, A2, A3... or the one for wells listed by A1, B1, C1...
  3. Run analysis by simply clicking the Source button on the top right corner of the console.
    NOTE: The analysis takes less than 1 min to complete. The output of the R analysis will automatically appear in the same file folder as the input dataset.
  4. View output: The output folder has several documents and sub-folders to provide a comprehensive analysis.
    NOTE: For the input file Supplemental File 4 (ROS_flg22.csv), a tree structure of the output documents generated by the Supplemental File 3 (ROS_2025.R) script described in protocol section 2 is shown in Supplemental Figure S4.

Access restricted. Please log in or start a trial to view this content.

Results

Case study 1. The luminescence assay for circadian clock activity with Arabidopsis seedlings

We previously showed that the GLYCINE-RICH RNA-BINDING PROTEIN 7 (GRP7) gene was controlled by the master clock protein CIRCADIAN CLOCK-ASSOCIATED 1 (CCA1) and circadian expression of GRP7 is important for its role in plant defense, using transgenic Col-0 plants expressing the luciferase reporter under the control of the wildtype GRP7 promoter (p...

Access restricted. Please log in or start a trial to view this content.

Discussion

We present here using R scripts in RStudio to provide a user-friendly method for analyzing large-scale data obtained from 96-well format time series experiments. This method has allowed us to quickly and easily analyze luminescence recording data obtained from thousands of samples in time series experiments to gauge the circadian clock activity from plant seedlings to mammalian cell cultures, in addition to data from ROS assays.

BioDare2 is a free repository that has been quite commonly used f...

Access restricted. Please log in or start a trial to view this content.

Disclosures

The authors have no conflicts of interest to disclose.

Acknowledgements

We thank the members of the Lu laboratory for their assistance in this work. We thank Min Gao and Matthew Fabian for the use of their unprocessed data and Benjamin Harris for assistance and/or guidance in making this R script. We thank John B. Hogenesch at Cincinnati Children's Hospital Medical Center for providing luminescence data from mammalian cells for Case study 2. We further thank John B. Hogenesch, Andrew Millar at The University of Edinburgh, and Mary Harrington at Smith College for helpful discussions during the development of this method. This work was partially supported by grants from the National Science Foundation, NSF 1456140 and NSF 2223886, to Hua Lu.

Access restricted. Please log in or start a trial to view this content.

Materials

List of materials used in this article
NameCompanyCatalog NumberComments
RThe R Projecthttps://www.r-project.org/ A free, open-source platform that can be downloaded from online and used to code, especially for statistics.
RstudioPosit Softwarehttps://posit.co/download/rstudio-desktop/ A free software that can be downloaded from online for more user-friendly access to R.
MetaCycleGang Wu, Xavier Li, Matthew Carlucci, Ron Anafi, Michael Hughes, Karl Kornacker, and John Hogeneschhttps://cran.r-project.org/web/packages/MetaCycle/vignettes/implementation.html The ARSER algorithm of the MetaCycle package is used to evaluate clock parameters, period, phase and amplitude. 
ggplot2Posit Softwarehttps://cran.r-project.org/web/packages/ggplot2/index.html Creates data visualizations, particularly for statistical graphics.
dplyrPosit Softwarehttps://cran.r-project.org/web/packages/dplyr/index.html A fundamental R library for efficient data manipulation.
magrittrPosit Softwarehttps://cran.r-project.org/web/packages/magrittr/index.html Provides a set of operators to enhance code readability and facilitate a more natural flow of data operations.
stringrPosit Softwarehttps://cran.r-project.org/web/packages/stringr/index.html Provides a consistent, simple, and easy-to-use set of functions for working with character strings.
filesstringsRory Nolan, and Sergi Padilla-Parrahttps://cran.r-project.org/web/packages/filesstrings/index.html Provides convenient functions for manipulating files and strings, particularly those related to file names and paths.
circularUlric Lund, Claudio Agostinelli, Hiroyoshi Arai, Alessando Gagliardi, Eduardo García-Portugués, Dimitri Giunchi, Jean-Olivier Irisson, Matthew Pocernich, and Federico Rotolohttps://cran.r-project.org/web/packages/circular/index.html Provides the statistical analysis and graphics representation of circular data.
AICcmodavgMarc J. Mazerollehttps://cran.r-project.org/web/packages/AICcmodavg/index.html Creates model selection tables based on Akaike's information criterion (AIC) and related information. 
broomPosit Softwarehttps://cran.r-project.org/web/packages/broom/index.html Converts the output of various statistical models and objects into "tidy" tibbles (a modern data frame format), making it easier to work with, analyze, and visualize model results.
Autoclave machineSteris Amsco Eagle Century SG120 Scientific, Inc.8901400012Autoclave media
Chemical fume hoodLab Design & Supply sterilize seeds
Omega Luminescence Reader BMG LABTECH, Inc.plate reader
Laminar flow cabinetNuAire Nu-408FM-400Class II/TypeA transfer seedlings to 96-well plate
96-well microplatesPerkin-ElmerOptiPlate-96 grow seedlings for luciferase assay
Flg22GenScript Inc.RP19986An elicitor from bacterial flagellin. 
Elf26Alpha Diagnostic Intl. Inc.2427An elicitor from bacterial translation Elongation Factor-Tu.
D-Luciferin Firefly, potassium saltBiosynth Chemistry & BiologyL-8220luciferase substrate
L-012 (Luminol)Fisher ScientificNC0733364ROS assay reagent

References

  1. Yamazaki, S., Takahashi, J. S. Real-time luminescence reporting of circadian gene expression in mammals. Methods Enzymol. 393 (10), 288-301 (2005).
  2. McClung, C. R., Xie, Q. Measurement of luciferase rhythms in plant circadian networks. Circadian Networks. Staiger, D. , Springer. New York. 1-11 (2014).
  3. El Temps. , Barcelona. (2020).
  4. Abhilash, L., Sheeba, V. RhythmicAlly: Your R and Shiny-based open-source ally for the analysis of biological rhythms. J Biol Rhythms. 34 (5), 551-561 (2019).
  5. CAT: Chronomics Analysis Toolkit. , University of Minnesota. (2013).
  6. Geissmann, Q., Garcia Rodriguez, L., Beckwith, E. J., Gilestro, G. F. Rethomics: An R framework to analyse high-throughput behavioural data. PLoS One. 14 (1), e0209331(2019).
  7. ShinyR-DAM. v.3. GNU General Public License. , (2007).
  8. Zielinski, T., Moore, A. M., Troup, E., Halliday, K. J., Millar, A. J. Strengths and limitations of period estimation methods for circadian data. PLoS One. 9 (5), e96462(2014).
  9. RStudio: Integrated Development for R. , Boston, MA. (2020).
  10. R: A Language and Environment for Statistical Computing. v.4.0.2. , Vienna, Austria. (2020).
  11. Wu, G., Anafi, R. C., Hughes, M. E., Kornacker, K., Hogenesch, J. B. MetaCycle: An integrated R package to evaluate periodicity in large scale data. Bioinformatics. 32 (21), 3351-3353 (2016).
  12. Yang, R., Su, Z. Analyzing circadian expression data by harmonic regression based on autoregressive spectral estimation. Bioinformatics. 26 (12), i168-i174 (2010).
  13. ggplot2: Elegant Graphics for Data Analysis. , Springer-Verlag. New York. (2016).
  14. dplyr: A Grammar of Data Manipulation. v.1.0.2, (2020).
  15. magrittr: A Forward-Pipe Operator for R. v.2.0.3, (2022).
  16. stringr: Simple, Consistent Wrappers for Common String Operations. v.1.4.0, (2019).
  17. filesstrings: An R Package for File and String Manipulation. J Open Source Softw. , (2017).
  18. R package 'circular': Circular Statistics. v.0.4-95, (2022).
  19. Mazerolle, M. J. AICcmodavg: Model Selection and Multimodel Inference Based on (Q)AIC(c). , (2023).
  20. broom: Convert Statistical Objects into Tidy Tibbles. , https://CRAN.R-project.org/package=broom (2023).
  21. Gao, M., et al. Circadian regulation of the GLYCINE-RICH RNA-BINDING PROTEIN gene by the master clock protein CIRCADIAN CLOCK-ASSOCIATED 1 is important for plant innate immunity. J Exp Bot. 74 (3), 991-1003 (2023).
  22. Gao, M., Zhang, C., Lu, H. Coronatine is more potent than jasmonates in regulating clock. Sci Rep. 10 (1), 12862(2020).
  23. Zhang, C., et al. LUX ARRHYTHMO mediates crosstalk between the circadian clock and defense in Commun. Nat Commun. 10 (1), 2543(2019).
  24. Straume, M., Frasier-Cadoret, S. G., Johnson, M. L. Least squares analysis of fluorescence data. Topics in Fluorescence Spectroscopy. 2, Plenum. 117-240 (1991).
  25. Cal-Kayitmazbatir, S., Francey, L. J., Lee, Y., Liu, A. C., Hogenesch, J. B. PSMD11 modulates circadian clock function through PER and CRY nuclear translocation. PLoS One. 18 (3), e0283463(2023).
  26. Zhang, E. E., et al. A genome-wide RNAi screen for modifiers of the circadian clock in human cells. Cell. 139 (1), 199-210 (2009).
  27. Baggs, J. E., et al. Network features of the mammalian circadian clock. PLoS Biol. 7 (3), e52(2009).
  28. Zipfel, C., et al. Bacterial disease resistance in Arabidopsis through flagellin perception. Nature. 428 (6984), 764-767 (2004).
  29. Kunze, G., et al. The N terminus of bacterial elongation factor Tu elicits innate immunity in Arabidopsis plants. Plant Cell. 16 (12), 3496-3507 (2004).
  30. Fabian, M., et al. The flowering time regulator FLK controls pathogen defense in Arabidopsis thaliana. Plant Physiol. 191 (4), 2461-2474 (2023).

Access restricted. Please log in or start a trial to view this content.

Reprints and Permissions

Tags

Time Series DataRStudio SoftwareUser Friendly ToolsCircadian Clock DataLuminescence Assay96 Well PlateANOVA TestLuciferase Reporter