# growthPheno-pkg

0th

Percentile

##### growthPheno

growthPheno

Version: NA

Date: NA

Keywords
package, hplot, manip
##### Index

For an overview of the use of these functions and an example see below.

 (i) Data exampleData A small data set to use in function examples. RiceRaw.dat Data for an experiment to investigate a rice germplasm panel. tomato.dat Longitudinal data for an experiment to investigate tomato response to mycorrhizal fungi and zinc. (ii) Data frame manipulation designFactors Adds the factors and covariates for a blocked, split-plot design. getTimesSubset Forms a subset of 'responses' in 'data' that contains their values for the nominated times. importExcel Imports an Excel imaging file and allows some renaming of variables. longitudinalPrime Selects a set variables to be retained in a data frame of longitudinal data. twoLevelOpcreate Creates a data.frame formed by applying, for each response, abinary operation to the values of two different treatments. (iii) Plots plotAnom Identifies anomalous individuals and produces longitudinal plots without them and with just them. plotCorrmatrix Calculates and plots correlation matrices for a set of responses. plotDeviationsBoxes Produces boxplots of the deviations of the observed values from the smoothed values over values of x. plotImagetimes Plots the time within an interval versus the interval. For example, the hour of the day carts are imaged against the days after planting (or some other number of days after an event). plotLongitudinal Plots longitudinal data for a set of indiividuals plotMedianDeviations Calculates and plots the median of the deviations of the smoothed values from the observed values. probeSmoothing Compares, for a set of specified values of df and different smoothing methods, a response and the smooths of it, possibly along with growth rates calculated from the smooths. (iii) Smoothing fitSpline Produce the fits from a natural cubic smoothing spline applied to a response in a 'data.frame', and growth rates can be computed using derivatives. splitSplines Adds the fits, and optionally growth rates computed from derivatives, after fitting natural cubic smoothing splines to subsets of a response to a 'data.frame'. (iv) Growth rate and WUI calculation fitSpline Produce the fits from a natural cubic smoothing spline applied to a response in a 'data.frame', and growth rates can be computed using derivatives. GrowthRates Calculates growth rates (AGR, PGR, RGRdiff) between pairs of values in a vector. intervalGRaverage Calculates the growth rates for a specified time interval by taking weighted averages of growth rates for times within the interval. intervalGRdiff Calculates the growth rates for a specified time interval. splitContGRdiff Adds the growth rates calculated continuously over time for subsets of a response to a 'data.frame'. splitSplines Adds the fits, and optionally growth rates computed from derivatives, after fitting natural cubic smoothing splines to subsets of a response to a 'data.frame'. WUI Calculates the Water Use Index (WUI). intervalWUI Calculates water use indices (WUI) over a specified time interval to a data.frame. (v) General calculations anom Tests if any values in a vector are anomalous in being outside specified limits. calcLagged Replaces the values in a vector with the result of applying an operation to it and a lagged value. calcTimes Calculates for a set of times, the time intervals after an origin time and the position of each within a time interval cumulate Calculates the cumulative sum, ignoring the first element if exclude.1st is TRUE. intervalValueCalculate Calculates a single value that is a function of an individual's values for a response over a specified time interval. splitValueCalculate Calculates a single value that is a function of an individual's values for a response. (vi) Principal variates analysis (PV A) intervalPVA Selects a subset of variables observed within a specified time interval using PVA. PVA Selects a subset of variables using PVA. rcontrib Computes a measure of how correlated each variable in a set is with the other variable, conditional on a nominated subset of them.

##### Overview

This package can be used to analyse growth data using splines to follow the time trend and then to extract traits for further analysis. There are tools that aid in choosing the degree of smoothing and the selection of traits. There are also functions for importing and orgainizing the data that are generally applicable, although they do have defaults that make them particularly adapted to data from a high-throughput phenotyping facility based on a Lemna-Tec Scananalyzer 3D system.

Data suitable for use with this package consists of columns of data obtained from a set of units (pots, carts or plots) over time. There should be a unique identifier for each unit, which by default is Snapshot.ID.Tag, and variable giving the Days after Planting for each measurement, by default Time.after.Planting..d.. In some cases, it is expected that there will be a column labelled Snapshot.Time.Stamp, which reflects the imaging time from which a particular data value was obtained. For imaging data, the carts/pots may be arranged in a grid of Lanes $\times$ Positions.

Al-Tamimi et al. (2016) describe a seven-step process to produce phenotypic traits from imaging measurements, a subset of which may be applicable to any longitudinal data set. Some minor modifications of this process has resulted in the following eight-step process:

1. Import the data: Use importExcel to import the raw data from the Excel file (xlsx or csv). This step should also involve any editing of the data needed to take account of mishaps during the data collection and the need to remove faulty data (produces raw.dat). Generally, data can be removed by replacing only values for responses with missing values (NA) for carts whose data is to be removed, leaving the identifying information intact.

2. Organize the data: Use longitudinalPrime to select a subset of the imaging variables produced by the Lemna Tec Scanalyzer and, if the design is a blocked, split-plot design, use designFactors to add covariates and factors that might be used in the analysis (produces the data frame longi.prime.dat).

3. Form derived longitudinal traits Add derived responses that result in a value for each observation: use splitContGRdiff to obtain continuous growth rates i.e. a growth rate for each time of observation, except the first; WUI to produce continuous Water Use Indices (WUI) and cumulate to produce cumulative responses. (Produces the data frame longi.dat.)

4. Exploratory analysis: Use splitSplines to fit splines, using say direct smoothing and an arbitrary value of 5 for the df, to smooth the longitudinal trends in the primary traits and calculate continuous growth rates from the smoothed response (added to the data frame longi.dat). There are two options for calculating continuous smoothed growth rates: (i) by differencing --- use splitContGRdiff; (ii) from the first derivatives of the splines --- in splitSplines include 1 in the deriv argument, include "AGR" in suffices.deriv and set the RGR to say "RGR".Produce plots of the unsmoothed and smoothed longitudinal data using plotLongitudinal.

5. Choose the smoothing.method and df: Use probeSmoothing to compare the smooths for a number of values of df and for different smoothing.methods. If necessary, re-run splitSplines with a revised value of df, replacing replace the initial smoothed primary traits and derived tratis in longi.dat; replot using plotLongitudinal.

6. Clean the data: Check for anomalies in the data, perhaps employing plotAnom. Decide if excluding data is justified. To exclude data, consider whether it is better, especially for the analysis stage, if only the values of the responses are removed by setting them to missing (NA), rather than removing complete rows of the data.

7. Extract per-cart traits: These are traits for which there is a single value for each cart, pot or plot (by default, identified by the Snapshot.ID.Tag). (produces the data frame cart.dat)

1. Initialize a cart data.frame with the factors and covariates for a single observation from all carts. This can be done by subsetting longi.dat so that there is one entry for each cart.

2. Use getTimesSubset to add traits at specific times to the cart data.frame, often the first and last day of imaging for each Snapshot.ID.Tag. The times need to be selected so that there is one and only one observation for each cart. Also form traits, such as growth rates over the whole imaging period, based on these values

3. Based on the longitudinal plots, decide on the intervals for which growth rates and WUIs are to be calculated. The growth rates for intervals are calculated from the continuous growth rates, using intervalGRdiff, if the continuous growth rates were calculated by differencing, or intervalGRaverage, if they were calculated from first derivatives. To calculate WUIs for intervals, use intervalWUI, The interval growth rates and WUIs are added to the cart data.frame.

8. (Optional) There is also the possibility that, for experiments investigating salinity, the Shoot Ion Independent Tolerance (SIIT) index can be calculated using twoLevelOpcreate.

The vignette Rice illustrates this process. Use vignette("Rice", package = "growthPheno") to access the vignette.

##### References

Al-Tamimi, N, Brien, C.J., Oakey, H., Berger, B., Saade, S., Ho, Y. S., Schmockel, S. M., Tester, M. and Negrao, S. (2016) New salinity tolerance loci revealed in rice using high-throughput non-invasive phenotyping. Nature Communications, 7, 13342.

dae`