trajectory(inputrac=NULL, inputlie=NULL, inputtps=NULL, inputrsml=NULL, res=NULL, unitlength="px", unitangle="d", rotation=0, l.brangle, l.curv, l.tipangle, rsml.date=NULL)
inputlie
/inputtps
/inputrsml
.inputrac
/inputtps
/inputrsml
.inputrac
/inputlie
/inputrsml
.inputrac
/inputlie
/inputtps
.unitlength="mm"
or unitlength="cm"
.unitangle
) that must be used by the function to perform a clockwise rotation of the root system (see details).is.null(inputrsml)=FALSE
. This argument specifies the root system age (the unit of time is defined by the user) and will be used only for RSA data encoded with the Root System Markup Language.unitlength
), DApp (the date of emergence expressed in the same unit as the root system age in the tps file(s) (for rac/lie files) or in rsml.date (for rsml files)), FinalRootLength (the root length at the last observation date expressed in unitlength
), Tortuosity (the ratio of the final root length to the Euclidean distance between the branching point and the apex of the root), Orientation (the direction of the lateral root growth), Branching.Angle (the branching angle of a daughter root on its mother root expressed in unitangle
), Mean.Curv (the mean of the local angle values calculated between the direction vectors of the successive links constructed using equidistantly spaced interpolated points along each root of a vectorized root system; the calculated mean is expressed in unitangle
), SD.Curv (the standard deviation of the local angle values calculated between the direction vectors of the successive links constructed using equidistantly spaced interpolated points along each root of a vectorized root system; the calculated standard deviation is expressed in unitangle
.unitangle
).The trajectory
function will successively locate and read the rac, lie and tps files created by DART and calculate RSA traits. First, trajectory
will check if all arguments have been written in the suitable mode. If res
, rotation
, l.brangle
, l.curv
and l.tipangle
are specified, the function will check if the numeric values required by these arguments are positive. If an error occurs for one argument, the code stops and the corresponding error message will be returned by the function. Second, the function will use inputrac
, inputlie
and inputtps
to locate and read the raw rac, lie and tps files created by DART, respectively. To run trajectory
efficiently, the DART files must have been saved with their appropriate extensions (.rac, .lie or .tps). If inputtps
contains a single tps file, it will be used by trajectory
for each lie/rac file located in inputlie
/inputrac
. Moreover, the number of lie files in inputlie
must be equal to the number of rac files in inputrac
and corresponding rac and lie files must have the same name. If inputps
contains more than one tps file, the number of tps files in inputtps
must be equal to the number of rac/lie files in inputrac
/inputlie
and corresponding rac/lie and tps files must have the same name. If an error occurs at this step, a message will be returned by the function. Third, the function will compute RSA traits.
If RSA data have been encoded with the Root System Markup Language (Lobet et al, 2015), the path to the folder containing the rsml files can be specified using the inputrsml
argument. To run trajectory
efficiently, rsml files must have been saved with their appropriate extensions (.rsml). If is.null(inputrsml)=FALSE
, trajectory
will check if rsml.date
is specified and written in the suitable mode. After reading the rsml files located in inputrsml
, the RSA data associated with one root system in each rsml file will be converted into two data frames possessing the same structure as the rac and lie files created by DART, respectively. The trajectory
function will then use these data frames to compute RSA traits describing root growth directions and trajectories. The argument rsml.date
will be used to create a tps file for each root system located in inputrsml
. By default, if no connection information between daughter and mother roots exists in a rsml file, the function will connect the lateral roots with their correponding mother root. To do so, each point starting a lateral root will be connected to the nearest point located on its mother root. The distance between a branching point and the parent root base (DBase) will be approximated by the distance between the point located on the mother root that is closest to the point starting a lateral root and the parent root base. Using rsml files, only RSA data associated with roots possessing a branching order lower or equal to 5 will be used for the computation of RSA traits.
Due to technical limitations, it is sometimes easier to take a picture of a root system if it is rotated before image acquisition. In this case, the vectorized root system will depict a rotation compared with the natural plant root system. To make a correction, one can use rotation
to specify an angle value expressed in unitangle
that will be used by the function to rotate the vectorized root system clockwise before RSA parameters calculation.
Hereafter, we will consider that the normal vector that is orthogonal to a direction vector (a,b) will have the following coordinates: (b,-a).
A daughter root will be considered to grow at the left side of the mother root if the scalar product between a direction vector (=vector A) going from the branching point (X0) to the following point (Xd) on the daughter root and a vector (=vector B) normal to a direction vector (=vector C) going from the branching point (X0) to the following point on the mother root (Xm) is positive. If the scalar product between A and B is negative, the daughter root will be considered to grow at the right side of the mother root. If the scalar product between A and B is equal to zero, the calculation of the scalar product between A and B will be performed again using a vector A going from the branching point (X0) to a point located on the daughter root at Xd<-Xd+1 until the calculated scalar product is different from zero. If A is always normal to B, a random lateral root growth orientation (either left or right) will be defined.
The branching angle of a daughter root on its mother root is approximated by the angle between two direction vectors going from the branching point to an interpolated point located at a distance l.brangle
from the branching point on the mother or on the daughter root, respectively. The distance l.brangle
between a branching point and an interpolated point is measured along the mother and the daughter roots. A first-order root having no mother root, a NA
value will be returned for Branching.Angle. If a root has a final length lower than l.brangle
, no branching angle can be calculated and the function will return a NA
value for Branching.Angle.
The curvature of each root is evaluated by the mean and the standard deviation of the local angles formed by the direction vectors of the successive links constituting a vectorized root. First, the function will use l.curv
to interpolate equidistantly spaced points along each root constituting a vectorized root system. Second, the angles between the direction vectors of the successive links of each root are calculated. Then, the mean and the standard deviation of the calculated angles are determined for each root. If a root has a final length lower than 2*l.curv
, the function will return a NA
value for Mean.Curv and SD.Curv. If a root has a final length lower than 3*l.curv
, the function will return a NA
value for SD.Curv as no standard deviation can be calculated on a single angle value.
Le Bot J., Serra V., Fabre J., Draye X., Adamowicz S., Pages L. (2010) DART: a software to analyse root system architecture and development from captured images, Plant and Soil, DOI: 10.1007/s11104-009-0005-2.
Lobet G., Pound M.P., Diener J., Pradal C., Draye X., Godin C., Javaux M., Leitner D., Meunier F., Nacry P., Pridmore T.P., Schnepf A. (2015) Root System Markup Language: Toward a Unified Root Architecture Description Language, Plant Physiology, DOI: 10.1104/pp.114.253625.
## Importation of example datasets
data(ch7rac)
data(ch7lie)
data(ch7tps)
## Creation of a folder (DART_trajectory) inside a temporary directory to contain the rac and lie
## example datasets created by DART
dirDART <- paste(tempdir(), "/DART_trajectory", sep="")
dir.create(dirDART)
## Definition of the number of rac, tps and lie files that will be saved inside dirDART
n <- 1
## Creation of rac, tps and lie files inside dirDART
for (i in 1:n) {
write.table(ch7rac, file=paste(dirDART,"/ch7_",i,".rac", sep=""), row.names=FALSE)
write.table(ch7lie, file=paste(dirDART,"/ch7_",i,".lie", sep=""), row.names=FALSE)
write.table(ch7tps, file=paste(dirDART,"/ch7_",i,".tps", sep=""), row.names=FALSE)}
## Use of trajectory to compute RSA parameters from DART output files
ch7_output_7 <- trajectory(inputrac=dirDART, inputlie=dirDART, inputtps=dirDART, res=75,
unitlength="cm", l.brangle=1, l.curv=1, l.tipangle=0.5)
## Plotting the results for ch7_1
## Distribution of the calculated insertion angles
hist(ch7_output_7$root$ch7_1$Branching.Angle, breaks=seq(from=0, to=180, by=5),
main="ch7_1-Branching angle distribution", xlab="Branching angle (d)", las=1,
xaxp=c(0,150,15), xlim=c(0,150))
## Evolution of the root tip angle for the primary root (black) and the two longest lateral roots
## (green and red)
date<-c(1:31)
plot(date, ch7_output_7$tip$ch7_1[1,2:ncol(ch7_output_7$tip$ch7_1)], type="l", lwd=2, bty="l",
las=1, ylim=c(0,180), ylab="Root tip angle (d)", xlab="Time (Num)", col="black",
main="Root tip angle", yaxp=c(0,180,18))
lines(date, ch7_output_7$tip$ch7_1[206,2:ncol(ch7_output_7$tip$ch7_1)], lwd=2, col="green")
lines(date, ch7_output_7$tip$ch7_1[221,2:ncol(ch7_output_7$tip$ch7_1)], lwd=2, col="red")
abline(h=90)
unlink(dirDART, recursive=TRUE)
Run the code above in your browser using DataLab