Skip to content
Snippets Groups Projects
Commit 28f77b6c authored by Felix Zimmermann's avatar Felix Zimmermann :speech_balloon:
Browse files

initial commit

parent 27633030
No related branches found
No related tags found
No related merge requests found
Showing
with 2194 additions and 0 deletions
var,nSF,n_L_SF1,n_L_SF2,Shoot_Length_Init,Shoot_Length,Delta_Length,FW_Plant,DW_Plant,FW_Shoot,DW_Shoot,FW_Stem,DW_Stem,FW_L_SF1,DW_L_SF1,FW_L_SF2,DW_L_SF2,DW_L_Rest,FW_Bud,DW_Bud,FW_Roots_Total,DW_Roots_Total,FW_PR,DW_PR,FW_LR,DW_LR,A_L_SF1,A_L_SF2,N_Ceno,N_Pilo,Length_Tot,Area_Tot,Diameter_Avg,Root_Vol,Tips,Forks,Crossings,Length_Fine,SA_Fine,Vol_Fine
nSF,-0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
n_L_SF1,0.33486119124497316,-0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
n_L_SF2,0.2856913407523003,0.08148440308957387,-0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
Shoot_Length_Init,0.18487564831866724,0.5026783254364396,0.028216630791249506,-0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
Shoot_Length,0.7887978280460586,0.7343890279929199,0.8825377466723056,0.14053110184653045,-0,0.9908001194509485,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
Delta_Length,0.2702600365148612,0.7266941740334484,0.15100636373614656,0.5644924108111397,0.0014174536758954914,-0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
FW_Plant,0.5902000816113703,0.7787987087543642,0.3211649825618537,0.45867079393927446,0.005023237655349925,0.010194832388344982,-0,1,0.013931821747806663,0.05401906649301096,0.03273418645013951,1,1,1,1,1,1,1,1,1,1,0.003349599625241772,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
DW_Plant,0.41504862894541317,0.8238356999848321,0.6360381899950801,0.6869954200357564,0.7478683035983906,0.48143708867618074,0.7073898735142603,-0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
FW_Shoot,0.41504862894541317,0.6835313590983583,0.26180701430536013,0.5466338038018766,0.0033267413834299686,0.010626342128568072,1.9296152005272386e-5,0.5779754288392673,-0,4.65823189418638e-4,0.018793669239245074,0.3192529835422645,1,1,1,1,1,1,1,1,1,0.4384177997606057,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
DW_Shoot,0.2709589277132673,0.5064668448104526,0.3458354208064008,0.48143708867618074,0.007318569842104318,0.03123477147634297,7.544562359359073e-5,0.28858316144472024,6.363704773478661e-7,-0,0.02499338610038126,0.013931821747806663,1,1,1,1,1,1,1,1,1,0.2699477369314351,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
FW_Stem,0.5902000816113703,0.36985738831449877,0.42575033037293186,0.2878828323048208,0.002666078612137288,0.043438983331110195,4.5654374407447015e-5,0.8725444288811492,2.6138622029548085e-5,3.48097299448207e-5,-0,0.004974323999441064,1,1,1,1,1,1,1,1,1,0.05401906649301096,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
DW_Stem,0.2709589277132673,0.41495371224570554,0.8606912306764823,0.1769531402161251,0.0045477337439671335,0.12693783617174834,0.0029822333891698473,0.590478988652005,4.502862955462123e-4,1.9296152005272386e-5,6.851685949643339e-6,-0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
FW_L_SF1,0.7887978280460586,0.8389659491700819,0.4145980939605839,0.6803669766362551,0.28858316144472024,0.25401073441936617,0.45930514272500556,0.6545168402947127,0.049004495598330935,0.12752383613843682,0.12752383613843682,0.13834237788821271,-0,0.12864413708364528,1,1,1,1,1,1,1,1,1,1,1,4.65823189418638e-4,1,1,1,1,1,1,1,1,1,1,1,1,1
DW_L_SF1,0.4991280865985603,0.23418532955846227,0.18770339099851166,0.7271855626479009,0.11728306543614496,0.12175488699699025,0.26294314035936006,0.7478683035983906,0.03458605834210784,0.04634590589406464,0.03458605834210784,0.04134226737172356,1.809340887252395e-4,-0,1,1,1,1,1,1,1,1,1,1,1,8.204698336376979e-4,1,1,1,1,1,1,1,1,1,1,1,1,1
FW_L_SF2,0.08555564436774868,0.6907273713236497,0.7250103878418662,0.5836890454315045,0.2158571806493815,0.1802350057664944,0.010340409451492871,0.17435746494503276,0.026877834421252005,0.02198860240988963,0.1679783461478961,0.19441291997748622,0.9431862416608072,0.7343037452877027,-0,0.001369243105425444,1,1,1,1,1,1,1,1,1,1,0.007182013355234393,1,1,1,1,1,1,1,1,1,1,1,1
DW_L_SF2,0.11948151603226087,0.7343890279929199,0.992635831473335,0.5836890454315045,0.5532950092839336,0.5225013271325194,0.10298105029992852,0.15567475363347455,0.20855405979520888,0.13834237788821271,0.5532950092839336,0.5053147342962482,0.5655798619595345,0.45930514272500556,1.8782484299388806e-6,-0,1,1,1,1,1,1,1,1,1,1,0.3192529835422645,1,1,1,1,1,1,1,1,1,1,1,1
DW_L_Rest,1,0.8465505454458228,0.3211649825618537,0.3012234648563527,0.13286024415692965,0.4474852561081234,0.44812738231536575,0.7343037452877027,0.44812738231536575,0.45930514272500556,0.1679783461478961,0.15567475363347455,0.7889509278475181,0.6676075762175148,0.41540511972553806,0.1223318876780357,-0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
FW_Bud,0.41504862894541317,0.5923983931778198,0.9484808861768967,0.2922911964687993,0.5171309114848299,0.21888494597210814,0.3942840173973614,0.5053147342962482,0.9857869107140623,0.6940473279966857,0.4706148514721424,0.680785475070949,0.10298105029992852,0.36367498164017825,0.5532950092839336,0.45930514272500556,0.971577682777073,-0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
DW_Bud,0.7335732901573736,0.708185358854387,0.696257378250772,0.2503489226858668,0.9207278029660827,0.46010860922420654,0.30320350080638525,0.8634579539075821,0.7648481342379855,0.49269415711458797,0.29411248518456395,0.36103085326150663,0.25933776569557865,0.7787710289424246,0.8920326043551793,0.8279572356854088,0.39200622836143717,0.0020787103285920877,-0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
FW_Roots_Total,0.3388006961962018,0.6979473895858677,0.8172848794796851,0.04099979018175765,0.04134226737172356,0.3988401854392243,0.004107709360574616,0.9431862416608072,0.04634590589406464,0.03674133435865421,0.010340409451492871,0.019118113777463332,0.493621819356885,0.7478683035983906,0.028672705671406933,0.07803332731018377,0.5532950092839336,0.1223318876780357,0.21570634977234887,-0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
DW_Roots_Total,0.21182138128164318,0.7051908883544694,0.7814708635097442,0.11424883467389672,0.020516042572872414,0.2078784368558635,0.009509496050393565,0.08582353060960754,0.017792450692375672,0.0023766147979084394,0.016536698804267277,0.0033267413834299686,0.971577682777073,0.590478988652005,0.08991308230865631,0.18088916310494071,0.19441291997748622,0.5053147342962482,0.2469567754286046,0.03458605834210784,-0,1,0.013931821747806663,1,1,1,1,1,1,1,0.8950667790222654,1,1,1,1,1,1,1,1
FW_PR,0.3388006961962018,0.5257852422169538,0.3559843056682245,0.3988401854392243,0.049004495598330935,0.13226549708781862,4.607427269933661e-6,0.8725444288811492,6.209883849300364e-4,3.802080801851198e-4,7.544562359359073e-5,0.00211222959934988,0.6157988686488813,0.36367498164017825,0.04634590589406464,0.20140608996104353,0.4047740712709462,0.13286024415692965,0.10621207443210375,0.0033267413834299686,0.0033267413834299686,-0,0.01010432458362335,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
DW_PR,0.2709589277132673,0.5520323982154222,0.8244892801947213,0.20428742547452727,0.060736503065617856,0.3012234648563527,0.001652500657442944,0.44812738231536575,0.008000717411226533,0.001652500657442944,0.0014541896038438218,0.001652500657442944,0.7889509278475181,0.41540511972553806,0.19441291997748622,0.42617551959450883,0.143971434687836,0.1679783461478961,0.04890046012954402,0.020516042572872414,1.9296152005272386e-5,1.3975552674444468e-5,-0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
FW_LR,0.3388006961962018,0.5000993444908292,0.8752463440162783,0.34817162559162995,0.09849011541638991,0.26224557983406593,0.1679783461478961,0.3942840173973614,0.3249215884859752,0.22331572029248165,0.2974384220710292,0.18757411613383762,0.3156083662499546,0.33438585619752936,0.025167116551899238,0.04634590589406464,0.7615000227827015,0.8445023706449685,0.5225934646559861,0.007318569842104318,0.13834237788821271,0.2547064607541252,0.3942840173973614,-0,1,1,1,0.44904062553955026,1,1,1,1,1,1,1,1,1,1,1
DW_LR,0.41504862894541317,0.51287057975857,0.19122891901470962,0.1903113383095045,0.04379259223545474,0.1520697531476799,0.143971434687836,0.030554114172937824,0.3249215884859752,0.18088916310494071,0.41540511972553806,0.18757411613383762,0.2974384220710292,0.37373304228189164,0.026877834421252005,0.03252444027009696,0.493621819356885,0.8305423857560938,0.9927833370148137,0.04634590589406464,0.016536698804267277,0.3156083662499546,0.20855405979520888,0.0029822333891698473,-0,1,1,1,1,1,0.08503922769750505,1,1,1,1,1,1,0.37486754618133095,1
A_L_SF1,0.6871851699928555,0.4384952538051373,0.21706959899876868,0.45867079393927446,0.23092986230203408,0.14336000092471557,0.3537636356336791,0.8305423857560938,0.03674133435865421,0.08582353060960754,0.08582353060960754,0.10760914039913919,6.363704773478661e-7,1.1239312789557506e-6,0.8166280406760861,0.493621819356885,0.7751954088891221,0.12752383613843682,0.40262802308972956,0.5290679872349874,0.8166280406760861,0.4820544547023682,0.6030877531318972,0.2547064607541252,0.28858316144472024,-0,1,1,1,1,1,1,1,1,1,1,1,1,1
A_L_SF2,0.058947413125598404,0.545419380805818,0.4201556092003751,0.7543476386857775,0.493621819356885,0.37813583791530936,0.010340409451492871,0.42617551959450883,0.016536698804267277,0.019118113777463332,0.13286024415692965,0.2158571806493815,0.7073898735142603,0.971577682777073,9.90622531756468e-6,4.502862955462123e-4,0.26294314035936006,0.3249215884859752,0.682797570269059,0.06729171199351028,0.22331572029248165,0.028672705671406933,0.19441291997748622,0.2547064607541252,0.30644705251252874,0.8445023706449685,-0,1,1,1,1,1,1,1,1,1,1,1,1
N_Ceno,0.2150836085470566,0.4235991593233436,0.7112884787303586,0.3477759838265755,0.11166266937807531,0.4207544391420641,0.32332633252320986,0.5776082168293962,0.2542253737983046,0.13605238396219185,0.2135162276237262,0.053484066500237126,0.7494815011484794,0.7927318437272454,0.07593388743230843,0.07593388743230843,0.8072771403542253,0.6998699958385065,0.26170344192781647,0.05501780913868012,0.205890658657185,0.4018090436119244,0.5325404019517951,6.369370575029082e-4,0.028823591039354654,0.9030259969404082,0.3484678385130002,1.8915076137698032e-87,1,1,1,1,1,1,1,1,1,1,1
N_Pilo,0.5227462297079616,0.9582876882287085,0.9950200986260777,0.9135207377596624,0.10664947332473956,0.08832237231543218,0.14530767050110538,0.014563925594387883,0.08882767525808172,0.023649042552059442,0.21128941262528061,0.0410088506299347,0.46410961507522075,0.30529398440068173,0.1303270141901694,0.15320349799286154,0.9711701338242882,0.30529398440068173,0.8303056488609718,0.4717809628217287,0.01243875360670857,0.20157995659741668,0.10046105571591676,0.24751179067334889,0.017808306578882112,0.3239987745495571,0.3239987745495571,0.06044902896288073,-0,1,1,1,1,1,1,1,1,1,1
Length_Tot,0.5902000816113703,0.7862646364248406,0.14859176451945408,0.11424883467389672,0.060736503065617856,0.48143708867618074,0.30644705251252874,0.020516042572872414,0.26294314035936006,0.10760914039913919,0.24662526251007166,0.038992623432448255,0.7615000227827015,0.8027630076692551,0.37373304228189164,0.36367498164017825,0.23092986230203408,0.7208097995138618,0.6363165153724792,0.09849011541638991,0.005536115775787635,0.33438585619752936,0.08186423116569436,0.11728306543614496,0.004107709360574616,0.9857869107140623,0.8445023706449685,0.09486882135540273,0.01243875360670857,-0,0.8950667790222654,1,1,2.469981400841967e-4,0.001369243105425444,2.469981400841967e-4,2.8968735891366834e-9,0.08503922769750505,1
Area_Tot,0.3388006961962018,0.6692134326123103,0.14263870097728337,0.021752500035364424,0.038992623432448255,0.40940652990968396,0.04379259223545474,0.18088916310494071,0.20140608996104353,0.09413469259693931,0.11728306543614496,0.049004495598330935,0.23092986230203408,0.45930514272500556,0.0707490406749636,0.08991308230865631,0.2798818688931398,0.3942840173973614,0.1870182444859891,0.0014541896038438218,0.0012750239017411188,0.04634590589406464,0.014225578511456708,0.020516042572872414,1.1910255980042724e-4,0.2798818688931398,0.2974384220710292,0.09947796228473736,0.06611569258231678,0.0012750239017411188,-0,1,1,1,1,1,1,0.007182013355234393,1
Diameter_Avg,0.8935897294005697,0.20975105136328667,0.45427332715194224,0.7137117223981637,0.6286094178894162,0.8442906791298771,0.5171309114848299,0.10760914039913919,0.971577682777073,0.7073898735142603,0.9148564744875124,0.44812738231536575,0.7073898735142603,0.41540511972553806,0.7615000227827015,0.9290117291603508,0.9857869107140623,0.18757411613383762,0.371206166877733,0.971577682777073,0.4047740712709462,0.5655798619595345,0.9290117291603508,0.6415164215860881,0.4370835438311813,0.4370835438311813,0.42617551959450883,0.19477377430299675,0.11309107395798172,0.005536115775787635,0.5053147342962482,-0,1,1,1,1,1,1,1
Root_Vol,0.3388006961962018,0.2217620360797719,0.33584636135740775,0.0794513795001381,0.09849011541638991,0.3433070944614317,0.005536115775787635,0.9857869107140623,0.07803332731018377,0.06395489148355483,0.030554114172937824,0.060736503065617856,0.9007243023389337,0.9857869107140623,0.05177062555916262,0.09849011541638991,0.590478988652005,0.15567475363347455,0.06408251709856899,0.010340409451492871,0.05464653454086535,0.010340409451492871,0.026877834421252005,0.3839365166506742,0.06395489148355483,0.8305423857560938,0.060736503065617856,0.4299596081905518,0.26977565790983354,0.30644705251252874,0.006088305245824152,0.30644705251252874,-0,1,1,1,1,1,1
Tips,0.41504862894541317,0.4207781959814615,0.33584636135740775,0.19374727203670594,0.16175105277252633,0.7339499266784841,0.33438585619752936,0.023538167096433013,0.2798818688931398,0.09849011541638991,0.24662526251007166,0.03674133435865421,0.6286094178894162,0.9290117291603508,0.3537636356336791,0.34400021825866983,0.3249215884859752,1,0.5783294643954504,0.06729171199351028,0.006088305245824152,0.24662526251007166,0.05763443347046612,0.07432891414402139,0.017792450692375672,0.9007243023389337,0.7343037452877027,0.07400711563786341,0.023649042552059442,3.365097276351454e-7,0.004107709360574616,0.0037013137357526185,0.5290679872349874,-0,1.2009813076675027e-4,1.935539319388447e-5,1.935539319388447e-5,0.6810515764892809,1
Forks,0.4991280865985603,0.6338746323730248,0.2532969717476696,0.37813583791530936,0.37373304228189164,0.85831129497406,0.590478988652005,0.0029822333891698473,0.5655798619595345,0.23092986230203408,0.6157988686488813,0.15567475363347455,0.41540511972553806,0.8166280406760861,0.3537636356336791,0.24662526251007166,0.5779754288392673,0.9007243023389337,0.6428867110035038,0.20855405979520888,0.019118113777463332,0.5171309114848299,0.16175105277252633,0.13286024415692965,0.01122524557766861,0.680785475070949,0.7751954088891221,0.1303536751279594,0.01243875360670857,1.8782484299388806e-6,0.008000717411226533,0.002666078612137288,0.6157988686488813,1.6317680810699765e-7,-0,5.740782383230992e-6,1.2009813076675027e-4,0.5094198374845844,1
Crossings,0.4991280865985603,0.4207781959814615,0.2793269102522803,0.3289383484629009,0.20140608996104353,0.6540679569539335,0.493621819356885,0.005023237655349925,0.4047740712709462,0.143971434687836,0.4047740712709462,0.0707490406749636,0.6415164215860881,0.9148564744875124,0.36367498164017825,0.30644705251252874,0.3537636356336791,0.7889509278475181,0.8350354319244818,0.18088916310494071,0.013165575845550236,0.45930514272500556,0.13834237788821271,0.07803332731018377,0.009509496050393565,0.9148564744875124,0.8585042942308735,0.06146647638708382,0.01243875360670857,3.365097276351454e-7,0.009509496050393565,0.001652500657442944,0.6545168402947127,2.619133043827398e-8,7.757814031393232e-9,-0,5.2062519348480824e-5,1,1
Length_Fine,0.5902000816113703,0.7343890279929199,0.19479582456832015,0.15806343358109934,0.09849011541638991,0.5650364026691794,0.36367498164017825,0.015348516732105445,0.30644705251252874,0.1223318876780357,0.2974384220710292,0.049004495598330935,0.6940473279966857,0.8445023706449685,0.41540511972553806,0.3942840173973614,0.2798818688931398,0.7478683035983906,0.5910302538743014,0.11728306543614496,0.007318569842104318,0.36367498164017825,0.08991308230865631,0.13286024415692965,0.007318569842104318,0.971577682777073,0.8585042942308735,0.11421492204430034,0.01243875360670857,3.909411051466509e-12,0.0023766147979084394,0.0037013137357526185,0.4047740712709462,2.619133043827398e-8,1.6317680810699765e-7,7.064113887175146e-8,-0,0.10498287594705227,1
SA_Fine,0.41504862894541317,0.5388402446951859,0.1152270723102431,0.060315642405867516,0.09413469259693931,0.540556721420366,0.17435746494503276,0.04134226737172356,0.3537636356336791,0.12752383613843682,0.2547064607541252,0.060736503065617856,0.2713350545052358,0.6415164215860881,0.23869970534203358,0.2547064607541252,0.24662526251007166,0.590478988652005,0.11848135849909011,0.04134226737172356,0.0029822333891698473,0.18757411613383762,0.038992623432448255,0.10760914039913919,5.302228375973564e-4,0.37373304228189164,0.5532950092839336,0.20968197885535647,0.023649042552059442,1.1910255980042724e-4,9.90622531756468e-6,0.2547064607541252,0.04134226737172356,9.687789139250085e-4,7.236077236996937e-4,0.0014541896038438218,1.47447859476197e-4,-0,0.8950667790222654
Vol_Fine,0.5902000816113703,0.3864524032647757,0.13684432838358276,0.1024423066276814,0.3942840173973614,0.8794129823285037,0.13286024415692965,0.36367498164017825,0.5532950092839336,0.2974384220710292,0.23869970534203358,0.19441291997748622,0.13834237788821271,0.44812738231536575,0.34400021825866983,0.3839365166506742,0.20855405979520888,0.04634590589406464,0.0019551336400009047,0.038992623432448255,0.08186423116569436,0.12752383613843682,0.06729171199351028,0.44812738231536575,0.049004495598330935,0.20140608996104353,0.42617551959450883,0.8807772318718408,0.4717809628217287,0.07803332731018377,0.0023766147979084394,0.7208097995138618,0.002666078612137288,0.13834237788821271,0.1223318876780357,0.1679783461478961,0.08991308230865631,0.0012750239017411188,-0
File added
**Mycorrhization Experiment Protocol**
In this experiment, we investigated the inoculation-effects of two ectomycorrhizal fungi (EMF) species with contrasting evolutionary histories, ecological properties, host-preferences, and habitat-ranges on phenotypic responses and growth dynamics of pedunculate oak (Quercus robur), an ecologically and economically important temperate forest tree species.
We set up the mycorrhization experiment using 96 plants of a genetically uniform Q. robur clone (DF159) and applied four treatments: A control treatment; an inoculation-treatment with the cosmopolitan Ascomycete Cenococcum geophilum, which is commonly found in oak forests; an inoculation-treatment with the Basidiomycete Piloderma croceum, which has not yet been found in natural oak forests but has been shown in previous experiments to support oak growth; and a co-inoculation treatment. We then assessed growth stage development of the trees over eight experimental weeks and measured various phenotypic traits during a destructive sampling.
# ------------------------------------------------------------------
# Script Name: figure1_phenotypicdata.R
# Purpose: Reproduces Figure 1 from "An Ectomycorrhizal Fungus Alters Development Stages Within Pedunculate Oak’s Endogenous Growth Rhythm"
# Author: Felix Zimmermann
# Date: 2025-05-07
# Contact: felix.zimmermann@wsl.ch
# License: CC BY
# ------------------------------------------------------------------
##### BASICS #####
# load packages
library(tidyverse)
library(viridis)
library(magick)
library(grid)
library(ggpubr)
library(psych)
library(rstatix)
library(MASS)
library(emmeans)
library(ggbeeswarm)
library(patchwork)
# check and save session info
sessionInfo() %>%
capture.output(file = "runs/1_phenotypic_data_figure1/Figure1_session_info.txt")
##### DATA LOADING, CLEANING & SCALING #####
# laod data
pheno_data <- read_csv("assays/3_destructive_sampling/dataset/pheno_data.csv")
# exclude contaminated and dead plants
pheno_data_final <- subset(pheno_data, Exclude == "no")
##### DEFINE BASIC PLOTTING PARAMETERS #####
# define treatment labels
treatment_labels <- c(
"Ceno" = expression(italic("Cenococcum geophilum")),
"Pilo" = expression(italic("Piloderma croceum")),
"Co_Inoc" = "Co-Inoculation",
"Control" = "Control"
)
# define legend order
treatment_order <- c("Control", "Pilo", "Ceno", "Co_Inoc")
# define custom colors
custom_colors <- c(
"Control" = "#4B8C6F",
"Ceno" = "#8C5E8C",
"Pilo" = "#D6C9A0",
"Co_Inoc" = "#5E96A6"
)
##### PLOT DRY WEIGHT COMPARISONS - FIGURE 1B #####
### do statistical comparison between treatments for durations of each stage ###
# do wilcoxon test with Benjamini-Hochberg p adjustment for plant dry weight
stat_test_dw_plant <- pheno_data_final %>%
wilcox_test(DW_Plant ~ Treatment) %>%
adjust_pvalue(method = "BH") %>%
add_significance()
# save_results
dw_plant_results <- subset(stat_test_dw_plant, select = -c(.y.))
write.csv(
dw_plant_results,
"runs/1_phenotypic_data_figure1/dw_plant_wilcoxon.csv",
row.names = FALSE
)
### plot results ###
# set plot order
pheno_data_final$Treatment <- factor(
pheno_data_final$Treatment,
levels = treatment_order
)
# create plot
dw_plant_plot <- ggplot(
pheno_data_final,
aes(x = Treatment, y = DW_Plant, fill = Treatment)
) +
geom_boxplot(
outlier.shape = 16,
outlier.size = 2,
alpha = 0.5,
lwd = 0.5,
aes(color = Treatment)
) +
scale_fill_manual(
values = custom_colors,
labels = treatment_labels,
breaks = treatment_order
) +
scale_color_manual(
values = custom_colors,
labels = treatment_labels,
breaks = treatment_order
) +
scale_x_discrete(labels = treatment_labels) + # format x-axis
theme_classic() +
geom_signif(
y_position = c(1.8, 1.94, 1.66),
xmin = c(2, 2, 1),
xmax = c(3, 4, 3),
annotation = c("< 0.001", "0.002", "0.036"),
textsize = 4
) +
labs(
title = "b",
x = "Treatment",
y = "Dry Weight (g)"
) +
theme_pubr() +
theme(
legend.position = "none",
axis.text.x = element_text(size = 12),
axis.text.y = element_text(size = 12),
axis.title = element_text(size = 14),
plot.title = element_text(
face = "bold",
size = 20,
vjust = 2,
hjust = -0.075
),
panel.grid.major.y = element_line(color = "gray90"),
panel.grid.minor.y = element_line(color = "gray95")
)
# show plot
dw_plant_plot
##### PLOT DRY WEIGHT ABOVE AND BELOW GROUND - FIGURE 1C #####
### do statistical comparison between treatments for durations of each stage ###
# do wilcoxon test with Benjamini-Hochberg p adjustment for plant dry weight
stat_test_above <- pheno_data_final %>%
wilcox_test(DW_Shoot ~ Treatment) %>%
adjust_pvalue(method = "BH") %>%
add_significance()
stat_test_above$Part <- "Shoot"
stat_test_below <- pheno_data_final %>%
wilcox_test(DW_Roots_Total ~ Treatment) %>%
adjust_pvalue(method = "BH") %>%
add_significance()
stat_test_below$Part <- "Root"
# combine results
wilcoxon_results_above_below <- rbind(stat_test_above, stat_test_below)
print(wilcoxon_results_above_below)
# save_results
wilxcoxon_reuslts_above_below <- subset(
wilcoxon_results_above_below,
select = -c(.y.)
)
write.csv(
wilcoxon_results_above_below,
"runs/1_phenotypic_data_figure1/above_below_ground_wilcoxon.csv",
row.names = FALSE
)
### plot results ###
# create long format
pheno_data_long_above_below <- pivot_longer(
pheno_data_final,
cols = c("DW_Roots_Total", "DW_Shoot"),
names_to = "Part",
values_to = "Part_DW"
)
# set treatment labels
treatment_labels_above_below <- c("Shoot", "Root")
# set plot order
pheno_data_long_above_below$Part <- factor(
pheno_data_long_above_below$Part,
levels = c("DW_Shoot", "DW_Roots_Total")
)
treatment_order_above_below <- c("Shoot", "Root")
# create plot
dw_above_below_plot <- ggplot(
pheno_data_long_above_below,
aes(x = Part, y = Part_DW, fill = Treatment)
) +
geom_boxplot(
outlier.shape = 16,
outlier.size = 2,
alpha = 0.5,
lwd = 0.5,
aes(color = Treatment)
) +
scale_fill_manual(
values = custom_colors,
labels = treatment_labels,
breaks = treatment_order
) +
scale_color_manual(
values = custom_colors,
labels = treatment_labels,
breaks = treatment_order
) +
scale_x_discrete(labels = treatment_labels_above_below) +
geom_signif(
y_position = c(1.05, 1.12, 0.98, 0.93, 1, 0.86),
xmin = c(0.906, 0.906, 0.716, 1.906, 1.906, 1.72),
xmax = c(1.094, 1.282, 1.094, 2.0935, 2.282, 1.906),
annotation = c("< 0.001", "< 0.001", "0.030", "< 0.001", "0.006", "0.048"),
textsize = 4
) +
labs(
title = "c",
x = "Plant Part",
y = "Dry Weight (g)"
) +
theme_pubr() +
theme(
legend.position = "right",
axis.text.x = element_text(size = 12),
axis.text.y = element_text(size = 12),
axis.title = element_text(size = 14),
legend.title = element_text(size = 14),
legend.text = element_text(size = 12),
plot.title = element_text(
face = "bold",
size = 20,
hjust = -0.075,
vjust = 2
),
panel.grid.major.y = element_line(color = "gray90"),
panel.grid.minor.y = element_line(color = "gray95")
)
# show plot
dw_above_below_plot
##### BIOMASS ALLOCATION PATTERNS - FIGURE 1D ######
### do statistical test ###
# create long format
pheno_data_long_allocation <- pivot_longer(
pheno_data_final,
cols = c("DW_Shoot", "DW_Roots_Total"),
names_to = "Part",
values_to = "Part_DW"
)
# create data subsets
subset_DW_Shoot <- subset(pheno_data_long_allocation, Part == "DW_Shoot")
subset_DW_Roots <- subset(pheno_data_long_allocation, Part == "DW_Roots_Total")
# calculate GLMs (sum)
model_DW_Shoot_no <- glm(
(Part_DW) ~ Treatment + DW_Plant,
data = subset_DW_Shoot,
family = gaussian()
)
model_DW_Roots_no <- glm(
(Part_DW) ~ Treatment + DW_Plant,
data = subset_DW_Roots,
family = gaussian()
)
bc_shoot <- boxcox(Part_DW ~ Treatment + DW_Plant, data = subset_DW_Shoot)
lambda_shoot <- bc_shoot$x[which.max(bc_shoot$y)]
model_DW_Shoot_bc <- glm(
((Part_DW^lambda_shoot - 1) / lambda_shoot) ~ Treatment + DW_Plant,
data = subset_DW_Shoot,
family = gaussian()
)
bc_roots <- boxcox(Part_DW ~ Treatment + DW_Plant, data = subset_DW_Roots)
lambda_roots <- bc_roots$x[which.max(bc_roots$y)]
model_DW_Roots_bc <- glm(
((Part_DW^lambda_roots - 1) / lambda_roots) ~ Treatment + DW_Plant,
data = subset_DW_Roots,
family = gaussian()
)
model_DW_Shoot_log <- glm(
log(Part_DW) ~ Treatment + DW_Plant,
data = subset_DW_Shoot,
family = gaussian()
)
model_DW_Roots_log <- glm(
log(Part_DW) ~ Treatment + DW_Plant,
data = subset_DW_Roots,
family = gaussian()
)
# check AIC and BIC
AIC(model_DW_Shoot_bc, model_DW_Shoot_log, model_DW_Shoot_no)
AIC(model_DW_Roots_bc, model_DW_Roots_log, model_DW_Roots_no)
BIC(model_DW_Shoot_bc, model_DW_Shoot_log, model_DW_Shoot_no)
BIC(model_DW_Roots_bc, model_DW_Roots_log, model_DW_Roots_no)
# use no transformation (best BIC and AIC)
# check distributions of residuals
hist(residuals(model_DW_Shoot_no))
qqnorm(residuals(model_DW_Shoot_no))
qqline(residuals(model_DW_Shoot_no))
hist(residuals(model_DW_Roots_no))
qqnorm(residuals(model_DW_Roots_no))
qqline(residuals(model_DW_Roots_no))
# get summary statistics
summary(model_DW_Shoot_no)
summary(model_DW_Roots_no)
# calculate and plot estimated means
emm_DW_Shoot <- emmeans(
model_DW_Shoot_no,
~ Treatment | DW_Plant,
type = "response",
adjust = "BH"
)
plot(emm_DW_Shoot, comparisons = TRUE)
emm_DW_Shoot_results <- as.data.frame(emm_DW_Shoot)
emm_DW_Shoot_results$Part <- "Shoot"
emm_DW_Roots <- emmeans(
model_DW_Roots_no,
~ Treatment | DW_Plant,
type = "response",
adjust = "BH"
)
plot(emm_DW_Roots, comparisons = TRUE)
emm_DW_Roots_results <- as.data.frame(emm_DW_Roots)
emm_DW_Roots_results$Part <- "Roots"
# combine results
emm_results <- rbind(emm_DW_Shoot_results, emm_DW_Roots_results)
# save_results
emm_results <- subset(emm_results, select = -c(DW_Plant))
write.csv(
emm_results,
"runs/1_phenotypic_data_figure1/emm_resource_allocation.csv",
row.names = FALSE
)
# calculate pairwise comparison statistics with Benjamini-Hochberg correction
pairs_Shoot <- as.data.frame(pairs(
emm_DW_Shoot,
adjust = "BH",
type = "response"
))
pairs_Shoot$Part <- "Shoot"
pairs_Roots <- as.data.frame(pairs(
emm_DW_Roots,
adjust = "BH",
type = "response"
))
pairs_Roots$Part <- "Roots"
# combine results
emm_pairwise <- rbind(pairs_Shoot, pairs_Roots)
# save_results
emm_pairwise <- subset(emm_pairwise, select = -c(DW_Plant))
write.csv(
emm_pairwise,
"runs/1_phenotypic_data_figure1/pairwise_comparison_resource_allocation.csv",
row.names = FALSE
)
### plot results ###
# define plot order
plot_order_allocation <- c("Shoot", "Roots")
# set treatment order
pheno_data_long_allocation$Part <- factor(pheno_data_long_allocation$Part)
levels(pheno_data_long_allocation$Part) <- c("Roots", "Shoot")
# set part order
emm_results$Part <- factor(emm_results$Part, levels = plot_order_allocation)
# set treatment labels
treatment_labels_allocation <- c("Shoot", "Root")
# create plot
emm_plot <- ggplot() +
geom_point(
data = emm_results,
aes(x = Part, y = response, color = Treatment),
position = position_dodge(width = 0.75),
size = 3
) +
geom_linerange(
data = emm_results,
aes(
x = Part,
y = response,
color = Treatment,
ymin = lower.CL,
ymax = upper.CL
),
position = position_dodge(width = 0.75),
size = 1.2
) +
geom_beeswarm(
data = pheno_data_long_allocation,
aes(x = Part, y = Part_DW, color = Treatment),
alpha = 0.5,
dodge.width = 0.75,
shape = 16
) +
scale_color_manual(
values = custom_colors,
labels = treatment_labels,
breaks = treatment_order
) +
scale_x_discrete(labels = c("Shoot", "Root")) +
labs(
title = "d",
x = "Plant Part",
y = "Dry Weight Estimated Marginal Mean (g)",
color = "Treatment"
) +
annotate("segment", x = 0.905, xend = 1.095, y = 0.95, yend = 0.95) +
annotate("segment", x = 0.905, xend = 0.905, y = 0.922, yend = 0.95) +
annotate("segment", x = 1.095, xend = 1.095, y = 0.922, yend = 0.95) +
annotate("text", x = 1.0, y = 0.98, label = "0.025", size = 4) +
annotate("segment", x = 0.725, xend = 1.095, y = 1.04, yend = 1.04) +
annotate("segment", x = 0.725, xend = 0.725, y = 1.012, yend = 1.04) +
annotate("segment", x = 1.095, xend = 1.095, y = 1.012, yend = 1.04) +
annotate("text", x = 0.91, y = 1.07, label = "0.025", size = 4) +
theme_pubr() +
theme(
axis.text.x = element_text(size = 12),
axis.text.y = element_text(size = 12),
axis.title = element_text(size = 14),
legend.position = "right",
legend.title = element_text(size = 14),
legend.text = element_text(size = 12),
plot.title = element_text(
face = "bold",
size = 20,
hjust = -0.075,
vjust = 2
),
panel.grid.major.y = element_line(color = "gray90"),
panel.grid.minor.y = element_line(color = "gray95")
)
# show plot
emm_plot
##### FINAL VISUALIZATION - FIGURE 1 #####
# create combined plot
combined_plot_pheno <- dw_plant_plot /
dw_above_below_plot /
emm_plot +
plot_layout(widths = c(5), heights = (10))
# show plot
combined_plot_pheno
# save combined plot (has to be combined with experimental setup plot)
ggsave(
"runs/1_phenotypic_data_figure1/Figure1.pdf",
plot = combined_plot_pheno,
width = 12.5,
height = 15
)
dev.off()
# ------------------------------------------------------------------
# Script Name: SI.R
# Purpose: Reproduces SI figures from "An Ectomycorrhizal Fungus Alters Development Stages Within Pedunculate Oak’s Endogenous Growth Rhythm"
# Author: Felix Zimmermann
# Date: 2025-05-07
# Contact: felix.zimmermann@wsl.ch
# License: CC BY
# ------------------------------------------------------------------
##### BASICS #####
# load packages
library(tidyverse)
library(viridis)
library(psych)
library(corrplot)
library(ggpubr)
library(patchwork)
library(forcats)
# check and save session info
sessionInfo() %>%
capture.output(file = "runs/3_additional_analyses_SI/SI_session_info.txt")
This diff is collapsed.
# ------------------------------------------------------------------
# Script Name: SI.R
# Purpose: Reproduces SI figures from "An Ectomycorrhizal Fungus Alters Development Stages Within Pedunculate Oak’s Endogenous Growth Rhythm"
# Author: Felix Zimmermann
# Date: 2025-05-07
# Contact: felix.zimmermann@wsl.ch
# License: CC BY
# ------------------------------------------------------------------
##### BASICS #####
# load packages
library(tidyverse)
library(viridis)
library(psych)
library(corrplot)
library(ggpubr)
library(patchwork)
library(forcats)
# check and save session info
sessionInfo() %>%
capture.output(file = "runs/3_additional_analyses_SI/SI_session_info.txt")
##### DATA LOADING, CLEANING & SCALING #####
# laod data (dead plants are excluded in time_seriess.xlsx file)
pheno_data <- read_csv("assays/3_destructive_sampling/dataset/pheno_data.csv")
randomization_data <- read_csv("assays/1_experimental_setup/dataset/randomization.csv")
# exclude contaminated and dead plants
pheno_data_final <- subset(pheno_data, Exclude == "no")
# create numeric dataframe excluding rows columns only "0" entries and character columns
pheno_data_num <- pheno_data_final %>%
dplyr::select(-c("N_Other", "N_No", "Max_Stages_Reached")) %>%
dplyr::select(where(is.numeric))
# load estimated marginal means data for resource allocation
resource_allocation_data <- read_csv(
"runs/1_phenotypic_data_figure1/emm_resource_allocation.csv"
)
##### DEFINE BASIC PLOTTING PARAMETERS #####
# define treatment labels
treatment_labels <- c(
"Ceno" = expression(italic("Cenococcum geophilum")),
"Pilo" = expression(italic("Piloderma croceum")),
"Co_Inoc" = "Co-Inoculation",
"Control" = "Control"
)
# define legend order
treatment_order <- c("Control", "Pilo", "Ceno", "Co_Inoc")
# define custom colors
custom_colors <- c(
"Control" = "#4B8C6F",
"Ceno" = "#8C5E8C",
"Pilo" = "#D6C9A0",
"Co_Inoc" = "#5E96A6"
)
##### PLANT RANDOMIZATION PLOT - FIGURE S1A #####
### RANDOMIZATION BY STAGE ###
# define custom colors
custom_colors_stage <- c(
"A" = "#66CCEE",
"B" = "#CCBB44",
"C" = "#AA3377"
)
# set plot order
randomization_data$Treatment <- factor(
randomization_data$Treatment,
levels = treatment_order
)
# calculate stage counts
stage_counts <- randomization_data %>%
count(Treatment, Stage) %>%
pivot_wider(
names_from = Stage,
values_from = n,
values_fill = 0
)
# convert to long format
stage_counts_long <- stage_counts %>%
pivot_longer(
cols = -Treatment,
names_to = "Stage",
values_to = "N"
)
# plot stage counts
stage_plot <- ggplot(stage_counts_long) +
geom_bar(aes(x = Treatment, y = N, fill = Stage), stat = "identity") +
theme_pubr() +
scale_fill_manual(values = custom_colors_stage) +
scale_y_continuous(limits = c(0, 24), breaks = seq(0, 24, 1)) +
scale_x_discrete(labels = treatment_labels) +
labs(
title = "a",
x = "Treatment",
y = "N Plants"
) +
theme(
legend.position = "right",
axis.text.x = element_text(size = 12),
axis.text.y = element_text(size = 12),
axis.title = element_text(size = 14),
plot.title = element_text(face = "bold", size = 20),
)
# show plot
stage_plot
### RANDOMIZATION BY SIZE - FIGURE 21B ###
# plot initial stem length
stem_length_plot <- ggplot(
randomization_data %>%
mutate(Treatment = factor(Treatment, levels = treatment_order)),
aes(x = Treatment, y = Length_Init, fill = Treatment, color = Treatment)
) +
geom_boxplot(outlier.alpha = 0.5, alpha = 0.5) +
theme_pubr() +
scale_fill_manual(values = custom_colors) +
scale_color_manual(values = custom_colors) +
scale_x_discrete(labels = treatment_labels) + # Add this line for custom x-axis labels
labs(
title = "b",
x = "Treatment",
y = "Stem Length (cm)"
) +
theme(
legend.position = "none",
axis.text.x = element_text(size = 12),
axis.text.y = element_text(size = 12),
axis.title = element_text(size = 14),
plot.title = element_text(face = "bold", size = 20),
)
# show plot
stem_length_plot
### RANDOMIZATION BY ROOTING DATE - FIGURE S1C ###
# plot initial stem length
date_plot <- ggplot(
randomization_data %>%
mutate(Treatment = factor(Treatment, levels = treatment_order)),
aes(
x = Treatment,
y = Rooting_Date_Divergence,
fill = Treatment,
color = Treatment
)
) +
geom_boxplot(outlier.alpha = 0.5, alpha = 0.5) +
theme_pubr() +
scale_fill_manual(values = custom_colors) +
scale_color_manual(values = custom_colors) +
scale_x_discrete(labels = treatment_labels) + # Add this line for custom x-axis labels
labs(
title = "c",
x = "Treatment",
y = "N Days Divergence from Mean Rooting Date"
) +
theme(
legend.position = "none",
axis.text.x = element_text(size = 12),
axis.text.y = element_text(size = 12),
axis.title = element_text(size = 14),
plot.title = element_text(face = "bold", size = 20),
)
# show plot
date_plot
#### FINAL VISUALIZATION - FIGURE S1 ####
# create combined plot
combined_plot_randomization <- stage_plot /
stem_length_plot /
date_plot +
plot_layout(widths = c(5), heights = (10)) +
plot_annotation(
title = "",
theme = theme(
plot.title = element_text(size = 16, face = "bold", hjust = 0.5)
)
)
# show plot
combined_plot_randomization
# save combined plot (has to be combined with experimental setup plot)
ggsave(
"runs/3_additional_analyses_SI/Randomization_Plot.pdf",
plot = combined_plot_randomization,
width = 12.5,
height = 15
)
dev.off()
##### CORRELATION MATRIX HEATMAP - FIGURE S2 #####
# calculate correlation matrix and p-values
corr_results <- corr.test(na.omit(pheno_data_num), method = "spearman")
corr_matrix <- as.matrix(corr_results$r)
p_matrix <- as.matrix(corr_results$p)
# create pdf to save plot
pdf("runs/3_additional_analyses_SI/Correlation_Plot.pdf", width = 10, height = 10)
# plot all correlations in upper triangle
corrplot(
corr_matrix,
type = "full",
method = "circle",
tl.col = "black",
tl.srt = 90,
tl.cex = 1,
cl.cex = 1,
diag = FALSE,
title = "",
mar = c(0, 0, 0, 0)
)
# plot only significant correlations in lower triangle
corrplot(
corr_matrix,
add = TRUE,
type = "lower",
method = "circle",
diag = FALSE,
tl.pos = "n",
cl.pos = "n",
p.mat = p_matrix,
sig.level = 0.05,
insig = "blank"
)
# save pdf
dev.off()
# convert correlation matrices to dataframe
corr_df <- as.data.frame(corr_matrix)
corr_df <- corr_df %>%
rownames_to_column(var = "var")
p_df <- as.data.frame(p_matrix)
p_df <- p_df %>%
rownames_to_column(var = "var")
# save results
write_csv(corr_df, "runs/3_additional_analyses_SI/Spearman_R.csv")
write_csv(p_df, "runs/3_additional_analyses_SI/Spearman_p.csv")
##### RESOURCE ALLOCATION PROPORTIONS - FIGURE S3 #####
# define colors
custom_colors_allocation <- c(
"Roots" = "#BBBBBB",
"Shoot" = "#228833"
)
# calculate proportions
resource_allocation_data <- resource_allocation_data %>%
group_by(Treatment) %>%
mutate(proportion = response / sum(response)) %>%
ungroup()
# convert proportions to percent
resource_allocation_data <- resource_allocation_data %>%
mutate(percentage = proportion * 100)
# create reversed factor for plotting shoot over root
resource_allocation_data <- resource_allocation_data %>%
mutate(Part = fct_rev(Part))
# create stacked barplot
resource_proportions_plot <- ggplot(
resource_allocation_data,
aes(
x = factor(Treatment, levels = treatment_order),
y = percentage,
fill = Part
)
) +
geom_bar(stat = "identity", position = "stack", width = 0.7) +
geom_hline(
yintercept = 50,
linetype = "dashed",
color = "black",
size = 0.5
) +
scale_y_continuous(
name = "Proportion (%)",
limits = c(0, 100),
breaks = seq(0, 100, by = 25)
) +
scale_fill_manual(values = custom_colors_allocation) +
scale_x_discrete(labels = treatment_labels) +
labs(title = "", x = "Treatment") +
theme_pubr() +
theme(
legend.position = "right",
axis.text.x = element_text(size = 12),
axis.text.y = element_text(size = 12),
axis.title = element_text(size = 14),
panel.grid.major.y = element_line(color = "gray90"),
panel.grid.minor.y = element_line(color = "gray95")
)
# show plot
resource_proportions_plot
# save plot
ggsave(
"runs/3_additional_analyses_SI/Resource_Allocation_Proportions.pdf",
plot = resource_proportions_plot,
width = 12.5,
height = 5
)
dev.off()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment