class: center, middle, inverse, title-slide # 使用 R 分析 LI-6800 的数据之四 ## FvCB 模型的拟合 ### 祝介东 ### 北京力高泰科技有限公司 技术部 ### 2020-04-02 修改 --- background-image: url("https://s1.ax1x.com/2020/03/30/GmT0oT.png") class: inverse, left, middle, animated, fadeIn # 主要内容 # 1. package 介绍 # 2. fitaci 参数介绍 # 3. 数据的拟合 # 4. 结果的查看与导出 --- class: inverse center middle, animated, fadeIn # .large.bold[ plantecophys 介绍] --- class: animated, fadeIn # `plantecophys` 作者介绍 .center.medium[[https://remkoduursma.github.io/plantecophys/](https://remkoduursma.github.io/plantecophys/) ] <img src="./img/remko.png" width="1205" /> --- class: animated, fadeIn # 软件包的科学背景 <img src="./img/plos-one.png" width="969" /> --- class: animated, fadeIn # 软件包的科学背景 为避免拟合的不连续性,采用了一个非直角双曲线形式的模型进行拟合: `$$A_m = \frac{A_c+A_j- \sqrt{(A_c+A_j)^2-4 \theta A_c A_j}}{2 \theta}-R_d$$` - `\(\theta\)` 和其他非直角双曲线模型一样,是形状的参数,默认设置为 0.9999, - `\(A_m\)` 为双曲线性质的 `\(A_c\)` 和 `\(A_j\)` 软件包使用了 nls 来进行非线性拟合并进行参数的标准差计算。 --- class: inverse, center, middle, animated, fadeIn # .large.bold[ fitaci 函数介绍] --- class: animated, fadeIn # 函数的参数 `fitaci` 的参数比较多: ```r fitaci(data, varnames = list(ALEAF = "Photo", Tleaf = "Tleaf", Ci = "Ci", PPFD = "PARi", Rd = "Rd"), Tcorrect = TRUE, Patm = 100, citransition = NULL, quiet = FALSE, startValgrid = TRUE, fitmethod = c("default", "bilinear", "onepoint"), algorithm = "default", fitTPU = FALSE, alphag = 0, useRd = FALSE, PPFD = NULL, Tleaf = NULL, alpha = 0.24, theta = 0.85, gmeso = NULL, EaV = 82620.87, EdVC = 0, delsC = 645.1013, EaJ = 39676.89, EdVJ = 2e+05, delsJ = 641.3615, GammaStar = NULL, Km = NULL, id = NULL, ...) ``` `plantecophys` 发表于 2015 年,当时还是 LI-6400,作者后来不再搞科研,也没有在将软件包专门做 LI-6800 的适配,因此 LI-6800 使用的前提是将 `varnames` 改为 LI-6800 的变量名(或者数据文件里的变量名改为 LI-6400 的变量名也可以),但改函数的变量名比较容易后面进行粘贴和复制: ```r varnames =list( ALEAF = "A", Tleaf = "Tleaf", Ci = "Ci", PPFD = "Qin", Rd = "Rd" ) ``` --- class: animated, fadeIn # 重要的参数 ## 拟合方法 `fitmethod = c("default", "bilinear", "onepoint")` 对于标准的 ACi 曲线和 RACiR 曲线,能够使用的方法只有 default 和 bilinear,二者结果有微小的差别,并且 bilinear 能用永远返回结果(因为他使用两次线性拟合来计算 `\(V_{cmax}\)`, `\(J_{max}\)`, `\(R_d\)`),线性拟合避免了非线性拟合的不收敛的问题。适合非线性拟合不能报错的情况,当然可以不管非线性拟合是否出结果,所有的测量均使用 bilinear。 --- class: animated, fadeIn # 重要的参数 ## 温度校正 `fitaci` 在默认计算 `\(V_{cmax}\)` 和 `\(J_{max}\)` 时会将其标准化为常温下进行 (25C),我们在某些情况下,例如想要测量在实际温度下的速率,那么我们需要将其修改为下面的形式: ```r fit2 <- fitaci(acidata1, Tcorrect=FALSE) ``` -- ## 使用测量的 Rd Rd 默认可以进行拟合后得到,但这样的结果并不准确,如果我们测量了 Rd,那么我们可以在数据文件里增加 Rd 列,例如导入的数据后名为 aci,那么我们可以: ```r aci$Rd <- 1.5 fitrd <- fitaci(aci, useRd=TRUE) ``` --- class: animated, fadeIn ## Tleaf 和 Qin 不可用 仪器使用难免遇到意外状况,如果发生意外的热电偶损坏,也可以进行数据的分析,对于温度传感器,Tair 和 Tleaf 的温度非常接近,可以作为替代,尽管函数提供了 Qin 的输入,但内置光量子传感器出问题的概率很低,当然,如果使用了其他人工光源,也可以直接输入其值: ```r fit <- fitaci(aci, Tleaf=30, PPFD=2000) ``` -- class: animated, fadeIn ## 使用叶肉导度 叶肉导度是非常重要的参数,准确的输入该值: ```r fit <- fitaci(aci, gmeso=0.2) ``` 此时 `\(V_{cmax}\)` 和 `\(J_{max}\)` 的计算会使用 [Ethier and Livingston (2004)](https://onlinelibrary.wiley.com/doi/full/10.1111/j.1365-3040.2004.01140.x) 的方法。 --- class: animated, fadeIn ## TPU 计算 .pull-left[ <br /> <br /> <br /> 在 Duursma, 2015 年的文献中,还没有添加的 TPU 限制阶段 ```r fit <- fitaci(aci, fitTPU=TRUE) ``` **注:未必一定出现 TPU** ] .pull-right[ <!-- --> ] --- class: animated, fadeIn ## Ci transition Ci 浓度由 `\(A_c\)` 向 `\(A_j\)` (point1),以及 `\(A_j\)` 向 `\(A_p\)`(point2)转变时的浓度。 ```r findCiTransition(object) ``` --- class: inverse, center, middle, animated, fadeIn # .large.bold[拟合及结果的查看] --- class: animated, fadeIn # 数据的拟合 ```r fitaci(data, varnames = list(ALEAF = "Photo", Tleaf = "Tleaf", Ci = "Ci", PPFD = "PARi", Rd = "Rd"), Tcorrect = TRUE, Patm = 100, citransition = NULL, quiet = FALSE, startValgrid = TRUE, fitmethod = c("default", "bilinear", "onepoint"), algorithm = "default", fitTPU = FALSE, alphag = 0, useRd = FALSE, PPFD = NULL, Tleaf = NULL, alpha = 0.24, theta = 0.85, gmeso = NULL, EaV = 82620.87, EdVC = 0, delsC = 645.1013, EaJ = 39676.89, EdVJ = 2e+05, delsJ = 641.3615, GammaStar = NULL, Km = NULL, id = NULL, ...) fitacis(data, group, fitmethod = c("default", "bilinear"), progressbar = TRUE, quiet = FALSE, id = NULL, ...) ``` 本质上来讲,拟合的函数只有一个, `fitacis` 本质上是调用了 `fitaci`,使用一个 group 参数来区分多条曲线的数据。 --- class: animated, fadeIn # 结果的查看 查看计算结果: <br /> ```r ?summary ``` <br /> 图形查看,`acifit` S3 类,可以直接对拟合结果作图: <br /> ```r plot(x, what = c("data", "model", "none"), xlim = NULL, ylim = NULL, whichA = c("Ac", "Aj", "Amin", "Ap"), add = FALSE, pch = 19, addzeroline = TRUE, addlegend = !add, legendbty = "o", transitionpoint = TRUE, linecols = c("black", "blue", "red"), lwd = c(1, 2), lty = 1, ...) ``` --- class: animated, fadeIn background-image: url("https://s1.ax1x.com/2020/04/02/GJimlV.png") background-size: contain