From cb7917e8ba695f83366bd7d727a19f27cc3cfbe2 Mon Sep 17 00:00:00 2001 From: kunstler <georges.kunstler@gmail.com> Date: Sat, 30 May 2015 15:36:23 +0200 Subject: [PATCH] add null model --- R/analysis/lmer.run.R | 3 ++ ...GLIN.ER.AD.Tf.r.set.fixed.biomes.species.R | 4 +- ...l.lmer.LOGLIN.r.set.fixed.biomes.species.R | 6 +++ .../model.lmer.LOGLIN.r.set.species.R | 8 ++++ launch.cluster/launch_all_lmer.bash | 37 +++++++++++-------- 5 files changed, 41 insertions(+), 17 deletions(-) create mode 100644 R/analysis/model.lmer/model.lmer.LOGLIN.r.set.fixed.biomes.species.R create mode 100644 R/analysis/model.lmer/model.lmer.LOGLIN.r.set.species.R diff --git a/R/analysis/lmer.run.R b/R/analysis/lmer.run.R index e2b935c..00833dc 100644 --- a/R/analysis/lmer.run.R +++ b/R/analysis/lmer.run.R @@ -27,6 +27,9 @@ run.model.for.set.one.trait <- function(model.file, fun.model, trait, #===================================================================== path.model <- "R/analysis/model.lmer" +model.files.lmer.Tf.0 <- file.path(path.model, + c("model.lmer.LOGLIN.r.set.species.R", + "model.lmer.LOGLIN.r.set.fixed.biomes.species.R")) model.files.lmer.Tf.1 <- file.path(path.model, c("model.lmer.LOGLIN.ER.AD.Tf.r.set.species.R", "model.lmer.LOGLIN.ER.AD.Tf.r.set.fixed.biomes.species.R")) diff --git a/R/analysis/model.lmer/model.lmer.LOGLIN.ER.AD.Tf.r.set.fixed.biomes.species.R b/R/analysis/model.lmer/model.lmer.LOGLIN.ER.AD.Tf.r.set.fixed.biomes.species.R index 7d535d2..9145d04 100644 --- a/R/analysis/model.lmer/model.lmer.LOGLIN.ER.AD.Tf.r.set.fixed.biomes.species.R +++ b/R/analysis/model.lmer/model.lmer.LOGLIN.ER.AD.Tf.r.set.fixed.biomes.species.R @@ -1,6 +1,6 @@ load.model <- function () { - list(name="lmer.LOGLIN.ER.AD.Tf.r.set.fixed.biomes.species", + list(name="lmer.LOGLIN.r.set.fixed.biomes.species", var.BLUP = 'set.id', - lmer.formula.tree.id=formula("logG~1+(1|set.id)+(1|species.id)+(1|plot.id)+biomes.id+Tf+Tf:biomes.id+logD+sumBn+sumBn:biomes.id+sumTfBn+sumTfBn:biomes.id+sumTnBn+sumTnBn:biomes.id+sumTnTfBn.abs+sumTnTfBn.abs:biomes.id +(logD-1|species.id) +(sumBn-1|species.id)+(Tf-1|set.id)+(sumBn-1|set.id)+(sumTfBn-1|set.id)+(sumTnBn-1|set.id)+(sumTnTfBn.abs-1|set.id)")) + lmer.formula.tree.id=formula("logG~1+(1|set.id)+(1|species.id)+(1|plot.id)+biomes.id+Tf+Tf:biomes.id+logD+sumBn+sumBn:biomes.id+sumTfBn+sumTfBn:biomes.id+sumTnBn+sumTnBn:biomes.id+sumTnTfBn.abs+sumTnTfBn.abs:biomes.id +(logD-1|species.id) +(sumBn-1|species.id)+(sumBn-1|set.id)+(Tf-1|set.id)+(sumBn-1|set.id)+(sumTfBn-1|set.id)+(sumTnBn-1|set.id)+(sumTnTfBn.abs-1|set.id)")) } diff --git a/R/analysis/model.lmer/model.lmer.LOGLIN.r.set.fixed.biomes.species.R b/R/analysis/model.lmer/model.lmer.LOGLIN.r.set.fixed.biomes.species.R new file mode 100644 index 0000000..087e7ae --- /dev/null +++ b/R/analysis/model.lmer/model.lmer.LOGLIN.r.set.fixed.biomes.species.R @@ -0,0 +1,6 @@ +load.model <- function () { + list(name="lmer.LOGLIN.r.set.fixed.biomes.species", + var.BLUP = 'set.id', + lmer.formula.tree.id=formula("logG~1+(1|set.id)+(1|species.id)+(1|plot.id)+biomes.id+logD+sumBn+sumBn:biomes.id +(logD-1|species.id) +(sumBn-1|species.id)+(sumBn-1|set.id)")) +} + diff --git a/R/analysis/model.lmer/model.lmer.LOGLIN.r.set.species.R b/R/analysis/model.lmer/model.lmer.LOGLIN.r.set.species.R new file mode 100644 index 0000000..008f0fa --- /dev/null +++ b/R/analysis/model.lmer/model.lmer.LOGLIN.r.set.species.R @@ -0,0 +1,8 @@ +load.model <- function () { + list(name="lmer.LOGLIN.r.set.species", + var.BLUP = 'set.id', + lmer.formula.tree.id=formula("logG~1+(1|set.id)+(1|species.id)+(1|plot.id)+logD+sumBn +(logD-1|species.id) +(sumBn-1|species.id)+(sumBn-1|set.id)")) +} + + + diff --git a/launch.cluster/launch_all_lmer.bash b/launch.cluster/launch_all_lmer.bash index cf16d4c..dea36ca 100644 --- a/launch.cluster/launch_all_lmer.bash +++ b/launch.cluster/launch_all_lmer.bash @@ -22,30 +22,37 @@ samplesize=$1 # "'Seed.mass'" "'Leaf.N'" for trait in "'SLA'" "'Wood.density'" "'Max.height'" ; do - # # ALL data - echo "/usr/local/R/R-3.1.1/bin/Rscript -e \"source('R/analysis/lmer.run.R'); run.multiple.model.for.set.one.trait(model.files.lmer.Tf.1[1], run.lmer,$trait);print('done')\"" > Rscript_temp/allf${trait}.sh - qsub Rscript_temp/allf${trait}.sh -d ~/trait.competition.workshop -l nodes=1:ppn=1,mem=8gb -N "lmerall2all.f${trait}" -q opt32G -j oe + echo "/usr/local/R/R-3.1.1/bin/Rscript -e \"source('R/analysis/lmer.run.R'); run.multiple.model.for.set.one.trait(model.files.lmer.Tf.0[1], run.lmer,$trait);print('done')\"" > Rscript_temp/all0${trait}.sh + qsub Rscript_temp/all0${trait}.sh -d ~/trait.competition.workshop -l nodes=1:ppn=1,mem=8gb -N "lmerall2all.0${trait}" -q opt32G -j oe + + + echo "/usr/local/R/R-3.1.1/bin/Rscript -e \"source('R/analysis/lmer.run.R'); run.multiple.model.for.set.one.trait(model.files.lmer.Tf.0[2], merge.biomes.TF = TRUE, run.lmer,$trait);print('done')\"" > Rscript_temp/all02${trait}.sh + qsub Rscript_temp/all02${trait}.sh -d ~/trait.competition.workshop -l nodes=1:ppn=1,mem=8gb -N "lmerall2all.02${trait}" -q opt32G -j oe + +# # # ALL data +# echo "/usr/local/R/R-3.1.1/bin/Rscript -e \"source('R/analysis/lmer.run.R'); run.multiple.model.for.set.one.trait(model.files.lmer.Tf.1[1], run.lmer,$trait);print('done')\"" > Rscript_temp/allf${trait}.sh +# qsub Rscript_temp/allf${trait}.sh -d ~/trait.competition.workshop -l nodes=1:ppn=1,mem=8gb -N "lmerall2all.f${trait}" -q opt32G -j oe - echo "/usr/local/R/R-3.1.1/bin/Rscript -e \"source('R/analysis/lmer.run.R'); run.multiple.model.for.set.one.trait(model.files.lmer.Tf.1[2], merge.biomes.TF = TRUE, run.lmer,$trait);print('done')\"" > Rscript_temp/allf2${trait}.sh - qsub Rscript_temp/allf2${trait}.sh -d ~/trait.competition.workshop -l nodes=1:ppn=1,mem=8gb -N "lmerall2all.f2${trait}" -q opt32G -j oe +# echo "/usr/local/R/R-3.1.1/bin/Rscript -e \"source('R/analysis/lmer.run.R'); run.multiple.model.for.set.one.trait(model.files.lmer.Tf.1[2], merge.biomes.TF = TRUE, run.lmer,$trait);print('done')\"" > Rscript_temp/allf2${trait}.sh +# qsub Rscript_temp/allf2${trait}.sh -d ~/trait.competition.workshop -l nodes=1:ppn=1,mem=8gb -N "lmerall2all.f2${trait}" -q opt32G -j oe -# # ALL MAT MAP - echo "/usr/local/R/R-3.1.1/bin/Rscript -e \"source('R/analysis/lmer.run.R'); run.multiple.model.for.set.one.trait(model.files.lmer.Tf.3[1], run.lmer,$trait, data.type = 'simple');print('done')\"" > Rscript_temp/allTP${trait}.sh - qsub Rscript_temp/allTP${trait}.sh -d ~/trait.competition.workshop -l nodes=1:ppn=1,mem=8gb -N "lmerall2all.TP${trait}" -q opt32G -j oe +# # # ALL MAT MAP +# echo "/usr/local/R/R-3.1.1/bin/Rscript -e \"source('R/analysis/lmer.run.R'); run.multiple.model.for.set.one.trait(model.files.lmer.Tf.3[1], run.lmer,$trait, data.type = 'simple');print('done')\"" > Rscript_temp/allTP${trait}.sh +# qsub Rscript_temp/allTP${trait}.sh -d ~/trait.competition.workshop -l nodes=1:ppn=1,mem=8gb -N "lmerall2all.TP${trait}" -q opt32G -j oe - echo "/usr/local/R/R-3.1.1/bin/Rscript -e \"source('R/analysis/lmer.run.R'); run.multiple.model.for.set.one.trait(model.files.lmer.Tf.3[2], merge.biomes.TF = TRUE, run.lmer,$trait,data.type = 'simple');print('done')\"" > Rscript_temp/allTP2${trait}.sh - qsub Rscript_temp/allTP2${trait}.sh -d ~/trait.competition.workshop -l nodes=1:ppn=1,mem=8gb -N "lmerall2all.TP2${trait}" -q opt32G -j oe +# echo "/usr/local/R/R-3.1.1/bin/Rscript -e \"source('R/analysis/lmer.run.R'); run.multiple.model.for.set.one.trait(model.files.lmer.Tf.3[2], merge.biomes.TF = TRUE, run.lmer,$trait,data.type = 'simple');print('done')\"" > Rscript_temp/allTP2${trait}.sh +# qsub Rscript_temp/allTP2${trait}.sh -d ~/trait.competition.workshop -l nodes=1:ppn=1,mem=8gb -N "lmerall2all.TP2${trait}" -q opt32G -j oe done -# # # MULTI -# echo "/usr/local/R/R-3.1.1/bin/Rscript -e \"source('R/analysis/lmer.run.R'); run.multiple.model.for.set.one.trait(model.files.lmer.Tf.Multi[1], run.lmer,'SLA', data.type = 'Multi');print('done')\"" > Rscript_temp/allMulti.sh -# qsub Rscript_temp/allMulti.sh -d ~/trait.competition.workshop -l nodes=1:ppn=1,mem=8gb -N "lmerall.Multi" -q opt32G -j oe +# # MULTI + echo "/usr/local/R/R-3.1.1/bin/Rscript -e \"source('R/analysis/lmer.run.R'); run.multiple.model.for.set.one.trait(model.files.lmer.Tf.Multi[1], run.lmer,'SLA', data.type = 'Multi');print('done')\"" > Rscript_temp/allMulti.sh + qsub Rscript_temp/allMulti.sh -d ~/trait.competition.workshop -l nodes=1:ppn=1,mem=8gb -N "lmerall.Multi" -q opt32G -j oe -# echo "/usr/local/R/R-3.1.1/bin/Rscript -e \"source('R/analysis/lmer.run.R'); run.multiple.model.for.set.one.trait(model.files.lmer.Tf.Multi[2], merge.biomes.TF = TRUE, run.lmer, 'SLA',data.type = 'Multi');print('done')\"" > Rscript_temp/allMulti2.sh -# qsub Rscript_temp/allMulti2.sh -d ~/trait.competition.workshop -l nodes=1:ppn=1,mem=8gb -N "lmerall.Multi2" -q opt32G -j oe + echo "/usr/local/R/R-3.1.1/bin/Rscript -e \"source('R/analysis/lmer.run.R'); run.multiple.model.for.set.one.trait(model.files.lmer.Tf.Multi[2], merge.biomes.TF = TRUE, run.lmer, 'SLA',data.type = 'Multi');print('done')\"" > Rscript_temp/allMulti2.sh + qsub Rscript_temp/allMulti2.sh -d ~/trait.competition.workshop -l nodes=1:ppn=1,mem=8gb -N "lmerall.Multi2" -q opt32G -j oe -- GitLab