Title: | Analysis of Pressure Volume Curves |
---|---|
Description: | Enables the manufacturing, analysis and display of pressure volume curves. From the progression of the curves, turgor loss point, osmotic potential and apoplastic fraction can be derived. Methods adapted from Bartlett, Scoffoni and Sack (2012) <doi:10.1111/j.1461-0248.2012.01751.x>. |
Authors: | Anna Raesch [aut, cre, cph] |
Maintainer: | Anna Raesch <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.0 |
Built: | 2024-11-12 03:25:04 UTC |
Source: | https://github.com/cran/pvcurveanalysis |
a non linear model combining an exponential and a linear fit is applied to the data using the Gauss-Newton algorithm of nls. starting values are calculated based on the data. Weights are applied to the model based on the estimated insecurity of the data quality.
ApplyCombMod(data, y = "y", x = "x")
ApplyCombMod(data, y = "y", x = "x")
data |
data frame containg x and y data to which the model is ought to be applied to |
y |
name of column in data containing y data |
x |
name of column in data containing x data |
model parameters
Extracts the coefficients and confidence intervals from the fitting results of the functions analysing the pressure volume curve (TurgorLossPoint, OsmoticPot and ModElasticity)
ExtractFitParam(result_list)
ExtractFitParam(result_list)
result_list |
output list from the functions TurgorLossPoint, OsmoticPot or ModElasticity |
data frame containing the coefficients and the 0.95 confidence interval of the coefficients from the fit
Extracts the curve parameters from the result lists of the functions analysing the pressure volume curve (TurgorLossPoint, OsmoticPot and ModElasticity
ExtractParam(result_list)
ExtractParam(result_list)
result_list |
output list from the functions TurgorLossPoint, OsmoticPot or ModElasticity |
data frame containing the results from the curve analysis only, depending on the function used, relative water deficit at turgor loss point (rwd.tlp), water potential at turgor loss point (water.pot.tlp), apoplastic fraction (apo.fract), osmotic potential at full saturation (osmotic.pot.full.sat), modulus of elasticity (modulus.elasticity)
# use pressure volume data provided by package pv_data <- pressure_volume_data # do pressure volume curve analysis pv_data <- RelativeWaterDeficit(pv_data) results <- OsmoticPot(pv_data, graph = FALSE) # extract curve values ExtractParam(results)
# use pressure volume data provided by package pv_data <- pressure_volume_data # do pressure volume curve analysis pv_data <- RelativeWaterDeficit(pv_data) results <- OsmoticPot(pv_data, graph = FALSE) # extract curve values ExtractParam(results)
Calculates saturated fresh mass by fitting fresh mass values above the turgor loss point linearly to water potential values.
FMSaturated( data, sample = "sample", water.potential = "water.potential", fresh.mass = "fresh.mass", dry.mass = "dry.mass" )
FMSaturated( data, sample = "sample", water.potential = "water.potential", fresh.mass = "fresh.mass", dry.mass = "dry.mass" )
data |
data frame, at least with a column containing numeric water potential (MPa), fresh.mass (g) and dry.mass (g) values, ordered by sample by descending water potential. A column containing the sample IDs is optionally required if several samples were measured. |
sample |
optional name of the column in data containing the sample IDs, default: "sample" |
water.potential |
optional name of the column in data containing the water potential values (MPa), default = "water.potential" |
fresh.mass |
optional name of the column in data containing the fresh mass values (g), default: "fresh mass" |
dry.mass |
optional name of the column containing the dry mass values (g), default: "dry.mass" |
Above the turgor loss point, a linear relationship between water content and water potential exists. Based on this premise,
saturated water content is found where water potential is zero. First, turgor loss point is calculated based on the relative leaf water
loss (fresh mass minus dry mass relativized by the maximum
leaf water content value). Then, data above the turgor loss point is extracted and fresh mass is fitted linearly to water potential.
The point where water potential of the linear regression line is zero is the saturated water content.
Before using this function,
check the data for an initial plateau. Data points in the initial part of the water potential
versus RWD plot with a stronger then expected decline need to be omitted.
the original data frame (data) extended by a numeric column containing the saturated fresh mass values ("fresh.mass.saturated")
# get example data df <- pressure_volume_data # extend the data frame by saturated fresh mass df <- FMSaturated(df)
# get example data df <- pressure_volume_data # extend the data frame by saturated fresh mass df <- FMSaturated(df)
merges data frames containing all neccessary informations for plotting with PlotOutput()
MergeDf( x, y, y2 = FALSE, y3 = FALSE, legend, legend.y2 = FALSE, legend.y3 = FALSE )
MergeDf( x, y, y2 = FALSE, y3 = FALSE, legend, legend.y2 = FALSE, legend.y3 = FALSE )
x |
vector containing the x values |
y |
vector containing the y values |
y2 |
optional vector containing the values for the second y coordinates |
y3 |
optional vector containing the values for the third y coordinates |
legend |
name of the y values in the legend |
legend.y2 |
optional name of the second y values in the legend |
legend.y3 |
optional name of the third y values in the legend |
data frame with columns containing all above information in equalized length as requested by gglot
Determines pressure potential and the modulus of elasticity
ModElasticity( data, sample = "sample", water.potential = "water.potential", RWD = "RWD", graph = TRUE, show.legend = TRUE )
ModElasticity( data, sample = "sample", water.potential = "water.potential", RWD = "RWD", graph = TRUE, show.legend = TRUE )
data |
data frame containing columns of equal lengths giving the numerical coordinates of the curve: water potential (MPa) and RWD (%), ordered by sample by descending water potential. A column containing the sample IDs is optionally required if several samples were measured |
sample |
optional column name in data containing the sample ID, default: "sample" |
water.potential |
optional column name in data containing the water potential values of the leaf (MPa), default: "water.potential" |
RWD |
optional column name in data containing the relative water deficit values (%), default: "RWD" |
graph |
set FALSE if no plots are to be returned |
show.legend |
set FALSE if no legend is to be shown in the plots |
Relative water deficit at turgor loss point is determined via the function TurgorLossPoint() and
osmotic potential is calculated via the function OsmoticPot().
Pressure potential is derived by
subtracting osmotic potential from water potential. The part of the pressure potential prior the turgor loss
point is then fitted linearly and after transformation of RWD (
slope of the fitted line.
Before using this function, check the data for an initial plateau. Data points in the initial part of the water potential
versus RWD plot with a stronger then expected decline need to be omitted.
List splitted by sample consisting of
modulus.elasticity |
modulus of elasticity (MPa) |
formula |
formula of the transformed linear osmotic potential fit (1/-MPa) and the pressure potential (MPa) fit |
coef |
coefficients of the osmotic (1/-MPa) and pressure potential (MPa) fit |
conf_int |
upper (97.5 %) and lower (2.5 %) border of 95 % confidence interval of model parameters |
If graph = TRUE, the original data is displayed with the x- and y-axis intercepts of the turgor loss point, the osmotic potential fit and the linear regression line of the pressure potential.
#get example data, calculate Relative Water Deficit data <- RelativeWaterDeficit(pressure_volume_data)[pressure_volume_data$sample == 10, ] # determine modulus of elasticity and the fitting parameters. Do not plot results. m_elasticity <- ModElasticity(data, graph = FALSE)
#get example data, calculate Relative Water Deficit data <- RelativeWaterDeficit(pressure_volume_data)[pressure_volume_data$sample == 10, ] # determine modulus of elasticity and the fitting parameters. Do not plot results. m_elasticity <- ModElasticity(data, graph = FALSE)
Checks for the correct ordering of the data: increasing for date.and.time and time.since start, decreasing for fresh.mass and water.potential. Done separatly for each sample. An individualized warning is printed if not ordered correctly.
OrderCheck(data, sample = FALSE, fresh.mass = FALSE, water.potential = FALSE)
OrderCheck(data, sample = FALSE, fresh.mass = FALSE, water.potential = FALSE)
data |
data frame containing the data to be checked |
sample |
name of the column containing the sample IDs, if present in data |
fresh.mass |
name of the column containing the numeric fresh mass values, if present in data |
water.potential |
name of the column containing the numeric water potential values, if present in data |
no return value
Determines the coordinates of the turgor loss point, osmotic potential at full hydration and apoplastic fraction
OsmoticPot( data, sample = "sample", water.potential = "water.potential", RWD = "RWD", graph = TRUE, show.legend = TRUE )
OsmoticPot( data, sample = "sample", water.potential = "water.potential", RWD = "RWD", graph = TRUE, show.legend = TRUE )
data |
data frame containing columns of equal lengths giving the numerical coordinates of the curve: water potential (MPa) and RWD (%), ordered by sample by descending water potential. A column containing the sample IDs is optionally required if several samples were measured. |
sample |
optional column name in data containing the sample ID, default: "sample" |
water.potential |
optional column name in data containing the numeric water potential values (MPa), default: "water.potential" |
RWD |
optional column name in data containing the relative water deficit values (%), default: "RWD" |
graph |
set FALSE if no plots are to be returned |
show.legend |
set FALSE if no legend is to be shown in the plots |
RWD at turgor loss point is derived by the function TurgorLossPoint().
The pressure-volume curve data is converted to -1/MPa. The osmotic potential is then derived by fitting a linear
regression line with the Gauss-Newton algorithm of nls() to the water potential data following the turgor loss point. The y- and
x-axis intercept of the regression line gives the osmotic potential at full hydration (op.full.sat) and the RWD at zero 1/-Psi,
respectively. RWD at zero1/-Psi is then transferred to RWC at zero 1/-Psi to derive apoplastic fraction
(apo.fract). The turgor loss point equals the value of the osmotic potential fit at the relative
water deficit at turgor loss point.
Before using this function, check the data for an initial plateau. Data points in the initial part of the water potential
versus RWD plot with a stronger then expected decline need to be omitted.
List splitted by sample consisting of
turgor.loss.point |
x and y coordinates of the turgor loss point (RWD (%) and water.potential (MPa), respectively) |
osmotic.potential |
x and y intercepts of the osmotic potential fit (apoplasic fraction (apo.fract) (%) and op.full.sat (MPa), respectively) |
formula |
formula of the linear osmotic potential fit |
coef |
coefficients of the linear model |
conf_int |
upper (97.5 %) and lower (2.5 %) border of 95 % confidence interval of model parameters |
If graph = TRUE, the plotted tranformed data is displayed with the x- and y-axis
intercepts of the turgor loss point and the
linear regression line of the osmotic potential showing the point of y-intercept (op.full.sat) and x-intercept (apo.fract).
Before using this function, check the raw data for an initial plateau. If the exponential decline does not onset directly,
fitting might not succeed.
# get example data, calculate Relative Water Deficit data <- RelativeWaterDeficit(pressure_volume_data)[pressure_volume_data$sample == 10, ] # calculate pressure volume curve characteristics and plot graphs pv_analysis <- OsmoticPot(data)
# get example data, calculate Relative Water Deficit data <- RelativeWaterDeficit(pressure_volume_data)[pressure_volume_data$sample == 10, ] # calculate pressure volume curve characteristics and plot graphs pv_analysis <- OsmoticPot(data)
plots the data as specified
PlotOutput( sub.sample, x, y, y2 = FALSE, y3 = FALSE, legend.y, legend.y2 = FALSE, legend.y3 = FALSE, x.axis, y.axis, x.intercept = FALSE, y.intercept = FALSE, legend.x.intercept = FALSE, line.x, line.y, line.y2 = FALSE, line.y3 = FALSE, legend.line.y, legend.line.y2 = FALSE, legend.line.y3 = FALSE, show.legend = show.legend )
PlotOutput( sub.sample, x, y, y2 = FALSE, y3 = FALSE, legend.y, legend.y2 = FALSE, legend.y3 = FALSE, x.axis, y.axis, x.intercept = FALSE, y.intercept = FALSE, legend.x.intercept = FALSE, line.x, line.y, line.y2 = FALSE, line.y3 = FALSE, legend.line.y, legend.line.y2 = FALSE, legend.line.y3 = FALSE, show.legend = show.legend )
sub.sample |
sample ID |
x |
vector containing the x coordinates of the data to be plotted as points |
y |
vector containing the y coodinates of the data to be plotted as points |
y2 |
optional vector containing the second y coordinates of the data to be plotted as points |
y3 |
optional vector containing the third y coordinates of the data to be plotted as points |
legend.y |
string, name of data points to be printed in the legend |
legend.y2 |
string, optional name of second set of data points to be printed in the legend |
legend.y3 |
string, optional name of third set of data points to be printed in the legend |
x.axis |
string, label of x axis |
y.axis |
sring, label of y axis |
x.intercept |
vector containg the x coordinate of the intercept |
y.intercept |
optional vector containg the y coordinate of the intercept |
legend.x.intercept |
string, name of x.intercept to be printed in the legend |
line.x |
vector containing the x coordinate for the lines |
line.y |
vector containing the y coordinates for the line |
line.y2 |
vector containing the y coordinates for the second line |
line.y3 |
vector containing the y coordinates for the second line |
legend.line.y |
string, name of line to be printed in the legend |
legend.line.y2 |
string, name of second line to be printed in the legend |
legend.line.y3 |
string, name of third line to be printed in the legend |
show.legend |
boolean, specifies whether a legend is to be printed |
graphic
A dataset containing water potential and fresh mass measurements of repeatedly measured drying kohlrabi leaves subjected to different soil moisture conditions during their growth (n = 6) and their saturated fresh mass and dry mass.
pressure_volume_data
pressure_volume_data
A data frame with 160 rows and 8 variables
date: Date of measurement
treatment: Soil moisture conditions during the last 6 days of Kohlrabi growth (10-30
sample: Sample ID (1 - 12)
fresh.mass.harvest: Fresh mass measured at harvest (12 h prior measurement of fresh.mass.saturated) (2.9813 - 7.1557)
fresh.mass.saturated: Saturated fresh mass of the leaf in gramms (4.1276 - 7.0867)
fresh.mass: Fresh mass of the leaf in gramms (2.7215 - 6.8246)
dry.mass: Dry mass of the leaf in gramms (0.2937 - 0.7267)
water.potential: Water potential of the leaf in MPa (-1.62 - -0.24)
Calculates relative water content (RWC, %)
RelativeWaterContent( data, fresh.mass = "fresh.mass", dry.mass = "dry.mass", fresh.mass.saturated = "fresh.mass.saturated" )
RelativeWaterContent( data, fresh.mass = "fresh.mass", dry.mass = "dry.mass", fresh.mass.saturated = "fresh.mass.saturated" )
data |
data frame with columns of equal length containing at least columns with the fresh mass (g), the dry mass (g) and the saturated fresh mass (g) |
fresh.mass |
optional name of the column in data containing the numeric fresh mass values (g); default: "fresh.mass" |
dry.mass |
optional name of the column in data containing the numeric dry mass values (g); default: "dry.mass" |
fresh.mass.saturated |
optional name of the column in data containing the numeric saturated fresh mass values (g); default: "fresh.mass.saturated" |
Relative water content (%) is calculated as:
whereas FM = fresh mass, DM = dry mass and FMs = fresh mass at water saturation.
the original data frame extended by a numeric column with the relative water content (RWC) (%).
# get example data df <- pressure_volume_data # extend df by RWC df_with_RWC <- RelativeWaterContent(df)
# get example data df <- pressure_volume_data # extend df by RWC df_with_RWC <- RelativeWaterContent(df)
Calculates relative water deficit (%)
RelativeWaterDeficit( data, fresh.mass = "fresh.mass", dry.mass = "dry.mass", fresh.mass.saturated = "fresh.mass.saturated" )
RelativeWaterDeficit( data, fresh.mass = "fresh.mass", dry.mass = "dry.mass", fresh.mass.saturated = "fresh.mass.saturated" )
data |
data frame with columns of equal length containing at least columns with the fresh mass (g), the dry mass (g) and the saturated fresh mass (g) |
fresh.mass |
optional name of the column in data containing the numeric fresh mass values (g); default: fresh.mass |
dry.mass |
optional name of the column in data containing the numeric dry mass values (g); default: dry.mass |
fresh.mass.saturated |
optional name of the column in data containing the numeric saturated fresh mass values (g); default: fresh.mass.saturated |
Relative water deficit (%) is calculated as:
whereas FM = fresh mass, DM = dry mass and FMs = fresh mass at water saturation.
the original data frame extended by a numeric column with the relative water deficit (RWD) (%).
# get example data df <- pressure_volume_data # extend df by RWD df_with_RWD <- RelativeWaterDeficit(df)
# get example data df <- pressure_volume_data # extend df by RWD df_with_RWD <- RelativeWaterDeficit(df)
Determines the x coordinate (RWD) of the turgor loss point in a set of experimentally obtained pressure volume curves.
TurgorLossPoint( data, sample = "sample", water.potential = "water.potential", RWD = "RWD", graph = TRUE, show.legend = TRUE )
TurgorLossPoint( data, sample = "sample", water.potential = "water.potential", RWD = "RWD", graph = TRUE, show.legend = TRUE )
data |
data frame containing columns of equal lengths giving at least the numerical coordinates of the curve: water potential (MPa) and RWD (%), ordered by sample by descending water potential. A column containing the sample IDs is optionally required if several samples were measured. |
sample |
optional name of the column in data containing the sample ID, default: "sample" |
water.potential |
optional name of the column in data containing the numeric water potential values (MPa), default: "water.potential" |
RWD |
optional name of the column in data containing numeric relative water deficit values (%), default: "RWD" |
graph |
set FALSE if no plots are to be returned |
show.legend |
set FALSE if no legend is to be shown in the plots |
Before using this function, check the data for an initial plateau. Data points in the initial part of the water potential
versus RWD plot with a stronger then expected decline need to be omitted.
The data is fitted using the Gauss-Newton algorithm of nls() to a combined exponential and linear
model. The exponential and linear parts are extracted and RWD at turgor loss point is localized at their point of minimum distance.
List splitted by sample consisting of
turgor.loss.point |
coordinates of the turgor loss point (RWD) |
formula |
formula of the exponential and linear part of the combined fits |
coef |
coefficients of combined model |
conf_int |
upper (97.5 %) and lower (2.5 %) border of 95 % confidence interval of model parameters |
If graph = TRUE, the plotted original data is displayed with the exponential and linear fit of the combined model as well as the x-coordinate (RWD) of the turgor loss point.
# get sample data data <- RelativeWaterDeficit(pressure_volume_data)[pressure_volume_data$sample == 10, ] # identify turgor loss point in curve turgor_loss_point <- TurgorLossPoint(data)
# get sample data data <- RelativeWaterDeficit(pressure_volume_data)[pressure_volume_data$sample == 10, ] # identify turgor loss point in curve turgor_loss_point <- TurgorLossPoint(data)
Ensures the validity of the input data
ValidityCheck( data, sample = FALSE, dry.mass = FALSE, fresh.mass.saturated = FALSE, fresh.mass = FALSE, water.potential = FALSE, RWD = FALSE )
ValidityCheck( data, sample = FALSE, dry.mass = FALSE, fresh.mass.saturated = FALSE, fresh.mass = FALSE, water.potential = FALSE, RWD = FALSE )
data |
data frame containing the data to be checked |
sample |
name of column containing the sample ID (default: sample) |
dry.mass |
name of column containing the dry mass (g) (default: dry mass) |
fresh.mass.saturated |
name of column containing the saturated fresh mass (g) (default: fresh.mass.saturated) |
fresh.mass |
name of column containing the fresh mass (g) (default: fresh.mass) |
water.potential |
name of column containing the water potential (MPa) (default: water.potential) |
RWD |
name of column containing the relative water deficit (default: RWD) |
no return value
Checks if column exists in data, is numeric and has the same lenghts as the others existence
ValidityCheckDetail(data_in, value)
ValidityCheckDetail(data_in, value)
data_in |
data frame to be checked |
value |
column in data |
no return value