Git Product home page Git Product logo

tes_spatial_access_2021's Introduction

DOI

Spatial access and resource limitations control carbon mineralization in soils

This repository contains data and code for the manuscript: Spatial access and resource limitations control carbon mineralization in soils

Kaizad F. Patel et al. doi: 10.1016/j.soilbio.2021.108427

PatelKF_SpatialAccess_graphical_abstract

Abstract

Core-scale soil carbon fluxes are ultimately regulated by pore-scale dynamics of substrate availability and microbial access. These are constrained by physicochemical and biochemical phenomena (e.g. spatial access and hydrologic connectivity, physical occlusion, adsorption-desorption with mineral surfaces, nutrient and resource limitations). We conducted an experiment to determine how spatial access and resource limitations influence core-scale water-soluble SOM mineralization, and how these are regulated by antecedent moisture conditions. Intact soil cores were incubated at field-moist vs. drought conditions, after which they were saturated from above (to simulate precipitation) or below (to simulate groundwater recharge). Soluble C (acetate) and N (nitrate) forms were added to some cores during the rewetting process to alleviate potential nutrient limitations. Soil respiration was measured during the incubation, after which pore water was extracted from the saturated soils and analyzed for water soluble organic carbon concentrations and characterization. Our results showed that C amendments increased the cumulative CO2 evolved from the soil cores, suggesting that the soils were C-limited. Drought and rewetting increased soil respiration, and there was a greater abundance of complex aromatic molecules in pore waters sampled from these soils. This newly available substrate appeared to alleviate nutrient limitations on respiration, because there were no further respiration increases with subsequent C and N amendments. We had hypothesized that respiration would be influenced by wetting direction, as simulated precipitation would mobilize C from the surface. However, as a main effect, this response was seen only in the C-amended soils, indicating that surface-C may not have been bioavailable. At the pore scale (pore water samples), drought and the C, N amendments caused a net loss of identified molecules when the soils were rewet from below, whereas wetting from above caused a net increase in identified molecules, suggesting that fresh inputs stimulated the C-and N-limited microbial populations present deeper in the soil profile. Our experiment highlights the complex and interactive role of antecedent moisture conditions, wetting direction, and resource limitations in driving core-scale C fluxes.


Directory Structure


home
|------ code/
|------ data/
|         |------ processed/
|------ reports/
|
|------ README
|------ tes_spatial_access.Rproj

Last updated: 2021-09-22

tes_spatial_access_2021's People

Contributors

bpbond avatar kaizadp avatar

Stargazers

 avatar

Watchers

 avatar  avatar

tes_spatial_access_2021's Issues

variables in functions

@bpbond

I need to calculate the p-values for many sets of nested variables, so I created a function to reproduce it.

Effect of moisture on counts, for each suction

compute_pvalues_counts_moisture = function(dat){
  a1 = aov(log(counts) ~ Moisture, data = dat)
  broom::tidy(a1) %>% 
    filter(term != "Residuals") 
}
peakcounts_core %>% 
  group_by(Suction) %>% 
  do(compute_pvalues_counts_moisture(.))
Suction term df sumsq meansq statistic p.value
1.5 Moisture 1 99.821276 99.821276 62.1550735 0.000000
50.0 Moisture 1 1.204643 1.204643 0.7513581 0.386538

The function above works fine, but it allows me to change only the data file (dat), but I'd also like to change the response variable, instead of hard-coding counts into the script.

essentially, something like:

compute_pvalues_counts_moisture = function(dat, VARIABLE){
  a1 = aov(log(VARIABLE) ~ Moisture, data = dat)
...
}

and then I somehow specify what the VARIABLE is each time I want to run the function

peakcounts_core %>% 
  group_by(Suction) %>% 
  do(compute_pvalues_counts_moisture(., counts))

^^Unfortunately, this doesn't work. Do you know how to fix this so I can set VARIABLE in the function?

more functions/drake

@bpbond

I'm having trouble with some targets in my drake plan. I am trying to make scatterplots with p-values, TukeyHSD letters included.

But I keep getting errors:

https://github.com/kaizadp/tes_spatial_access/blob/5f34b22e8bf9d72448d70f224ba426224896f850/code/2e-fticr_drake_plan.R#L106-L107

x fail gg_totalcounts
Error: target gg_totalcounts failed.
diagnose(gg_totalcounts)$error$message:
object 'peakcounts_core' not found

https://github.com/kaizadp/tes_spatial_access/blob/5f34b22e8bf9d72448d70f224ba426224896f850/code/2e-fticr_drake_plan.R#L156

x fail relabund_coresrelabund_scatterplots
Error: target relabund_coresrelabund_scatterplots failed.
diagnose(relabund_coresrelabund_scatterplots)$error$message:
object 'relabund_cores_complex' not found

^^^

These targets are linked to functions in the 2f-fticr-pipeline_plotting.R script (links below). If I run the functions outside of drake, they work fine. But when I run the drake plan, it breaks. It may be because of the way I have written the functions? Also, the do_gg_totalcounts function is the final step in a line of functions, maybe that causes it to break in drake?

https://github.com/kaizadp/tes_spatial_access/blob/5f34b22e8bf9d72448d70f224ba426224896f850/code/2f-fticr-pipeline_plotting.R#L293

https://github.com/kaizadp/tes_spatial_access/blob/5f34b22e8bf9d72448d70f224ba426224896f850/code/2f-fticr-pipeline_plotting.R#L414

f-ing drake

@bpbond

drake doesn't like functions?
I get this error when I run the drake_plan. It stops at the fit_hsd_xx functions. But it works if I run the functions before running the plan.

https://github.com/kaizadp/tes_spatial_access/blob/2e8024f14de3ca5e903c5732dbf2c6c327c6d1a1/code/2e-fticr_drake_plan.R#L339

โ–ถ target fticr_hsd_totalpeaks
x fail fticr_hsd_totalpeaks
Error: target fticr_hsd_totalpeaks failed.
diagnose(fticr_hsd_totalpeaks)$error$message:
could not find function "fit_hsd_totalpeaks"
diagnose(fticr_hsd_totalpeaks)$error$calls:
peakcounts_core %>% filter(class == "total") %>% mutate(Suction = as.character(Suction)) %>%
group_by(Suction, Homogenization, Moisture) %>% do(fit_hsd_totalpeaks(.))
base::withVisible(eval(quote(_fseq(_lhs)), env, env))
base::eval(quote(_fseq(_lhs)), env, env)
base::eval(quote(_fseq(_lhs)), env, env)
_fseq(_lhs)
magrittr::freduce(value, _function_list)
base::withVisible(function_list[k])
function_list[k]
dplyr::do(., fit_hsd_totalpeaks(.))
dplyr:::do.grouped_df(., fit_hsd_totalpeaks(.))
rlang::eval_tidy(args[[j]], mask)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.