Input Mapping File

The input mapping .csv lists 86 essential parameters in columns and (indepdendent) selection experiments in rows. Here is an example of mapping file with two independent experiments.

selected_function protocol seed exp_id overwrite_plate passage_overwrite_plate output_dir save_function save_composition save_plate function_lograte composition_lograte scale n_inoc rich_medium monoculture dilution n_wells n_propagation n_transfer n_transfer_selection metacommunity_sampling power_alpha lognormal_mean lognormal_sd phi_distribution phi_mean phi_sd phi_lower phi_upper ruggedness function_ratio binary_threshold g0 cost_distribution cost_mean cost_sd cost_lower cost_upper invader_index invader_sampling invader_strength target_resource directed_selection knock_out knock_in knock_in_threshold bottleneck bottleneck_size migration n_migration s_migration coalescence frac_coalescence resource_shift r_type r_percent sampling sn sf Sgen rn rf R0_food food supply muc sigc c0 c1 q sparsity fs fw g w l m n response sigma_max regulation nreg tau r S
f1_additive simple_screening 1 f1_additive-simple_screening-1 NA False /home/cc2553/project/community-selection/data/independent_f1_additive/ True True False 1 20 1000000 1e+06 TRUE False 0.001 96 1 40 20 Power 0.01 8 8 Norm 0 1 0 1 NA 1 1 1 Norm 0 0 0 1 2 Gamma 10 NA False False False NA False NA False 1000000 NA False NA False NA NA Binary_Gamma 2100 1 0 90 1 1000 NA NA NA NA NA NA NA NA NA NA NA NA 0 0 NA type III 1 NA NA NA NA NA
f1_additive simple_screening 1 f1_additive-monoculture-1 NA False /home/cc2553/project/community-selection/data/independent_f1_additive/ True True False 1 20 1000000 1e+06 TRUE True 0.001 96 1 40 20 Power 0.01 8 8 Norm 0 1 0 1 NA 1 1 1 Norm 0 0 0 1 2 Gamma 10 NA False False False NA False NA False 1000000 NA False NA False NA NA Binary_Gamma 2100 1 0 90 1 1000 NA NA NA NA NA NA NA NA NA NA NA NA 0 0 NA type III 1 NA NA NA NA NA

The mapping file has five categories of parameters:

File operation

selected_function
Type:string
Default:f1_additive

Function under selection. Available options are f1_additive and f2_interaction, f2a_interaction, f3_additive_binary, f4_interaction_binary, f5_invader_growth, and resource_distance_community_function.

protocol
Type:string
Default:simple_screening

Protocol to implement. Only the protocols listed in E_protocols.py can be used.

seed
Type:integer
Default:1

Random seed to initiate pseudorandom number generator.

exp_id
Type:string
Default:f1_additive-simple_screening-1

Experiment-specific ID, which will also determine the naming convention of output files. For example, the community function is saved in f1_additive-simple_screening-1_function.txt if save_function=True, whereas community compostition is saved in f1_additive-simple_screening-1_compostition.txt if save_composition=True.

overwrite_plate
Type:string
Default:NA

To replace the initial plate composition with an arbitrary plate, specify a text file of the community composition that containes four columns: Type, ID, Well, and Abundance. If an output text file (e.g., f1_additive-simple_screening-1_compostition.txt) is specified and it contains composition for more than two transfers, by default only the metacommunity compostition of the latter tranfer is read.

passage_overwrite_plate
Type:boolean
Default:False

If overwrite_plate != NA, set TRUE if the community from overwrite_plate is at equilibrium and need an addititonal transfer.

output_dir
Type:string
Default:data/

Directory where the output files will be stored.

save_function
Type:boolean
Default:True

Set True to save function data.

save_composition
Type:boolean
Default:True

Set True to save composition data.

save_plate
Type:boolean
Default:False

Set True to save initial Metacommunity in a pickle file.

function_lograte
Type:integer
Default:1

How often you save the function in transfers. Default is saving functional data from every transfer.

composition_lograte
Type:integer
Default:20

How often do you save the composition in transfers.


Protocol-specific parameters

scale
Type:integer
Default:1000000

Number of cells equivalent to \(N_i = 1\).

n_inoc
Type:integer
Default:1000000

Number of cells in the initial inoculum.

rich_medium
Type:boolean
Default:True

Set True to generate a rich medium sampled from an uniform distribution. Set False to generate a minimal medium with only the first resource is supplied.

monoculture
Type:boolean
Default:False

Set True to run simple screening with all monocultures from the regional species pool. The number of wells is equal to the number of species in the regional pool.

dilution
Type:float
Default:0.001

Dilution factor in the batch culture.

n_wells
Type:integer
Default:96

Number of wells (communities) in a plate (metacommunity).

n_propagation
Type:float
Default:1

Incubation time of a transfer.

n_transfer
Type:integer
Default:40

Number of total transfers (generations) to be run in the protocol.

n_transfer_selection
Type:interger
Default:20

Number of transfers (generations) that consecutively executes selection matrices from the start of an experiment. The number of stabilizaiton transfer equals to the difference between n_transfer_total and n_transfer_selection.

metacommunity_sampling
Type:string
Default:Power

Sampling method for initial metacommunity. Available options are Power, Lognormal, Default.

power_alpha
Type:float
Default:0.01
lognormal_mean
Type:float
Default:8
lognormal_sd
Type:float
Default:8

Species contribution to function

phi_distribution
Type:string
Default:Norm

{“Norm”, “Uniform”}

phi_mean
Type:float
Default:0

Mean of normal distribution when phi_distribution is set to Norm

phi_sd
Type:float
Default:1

Standard deviation of normal distribution when phi_distribution is set to Norm

phi_lower
Type:float
Default:0

Lower boundary of normal distribution when phi_distribution is set to Unif

phi_upper
Type:float
Default:1

Upper boundary of normal distribution when phi_distribution is set to Unif

ruggedness
Type:fload
Default:0.8

(1-ruggedness) of the additive and non-additive per-capita functino will contribute to community function, whereas the rest will be set to 0.

binary_threshold
Type:float
Default:1

Threshold for binary functions.

g0
Type:float
Default:1

The baseline conversion factor of biomass per energy.

cost_distribution
Type:string
Default:Norm

{“Gamma”, “Unif”}

cost_mean
Type:float
Default:0

Mean fraction of cost feeded normal distribution. Suggested maximum to 0.05.

cost_sd
Type:float
Default:0

Standard deviation of fraction of cost feeded into a gamma distribution. cost_sd = 0 if cost_mean = 0, cost_sd = 0.01 if cost_mean > 0.

cost_lower
Type:float
Default:0

Lower bound for cost if cost_distribution is set to Uniform

cost_upper
Type:float
Default:1

Upper bound for cost if cost_distribution is set to Uniform

invader_index
Type:integer
Default:2

Index of an invader. Only one index is choosen. Currently a invasive community is not allowed.

invader_sampling
Type:string
Default:Gamma

Sampling algorithm to generate the invader uptake rate vector. Options are Gaussian, Binary, Gamma, Binary_Gamma.

invader_strength
Type:positive float
Default:10

Mean utiliration vector for the invader versus the average of the species in the pool

target_resource
Type:integer
Default:NA

Target resource production when selected_function is set to f6_target_resourece


Directed evolution

directed_selection
Type:boolean
Default:False

Set True to run directed selection, one of flags below in directed evolution has to be also set True.

knock_out
Type:boolean
Default:False

Set True to perform knock out pertubation.

knock_in
Type:boolean
Default:F

Set True performs knock in pertubation.

knock_in_threshold
Type:float
Default:0.95

If knock_in = True, use the default knock_in_threshold=0.95, which means that top 5% species in the pool is prepared to be knocked in a community, whereas the rest 95% of are not used.

bottleneck
Type:boolean
Default:False

Set True to perform bottleneck pertubations.

bottleneck_size
Type:float
Default:0.00001

If bottleneck=T, perform an bottleneck shock to the specified communities by a dilution factor default to bottleneck_size=0.00001. This bottleneck dilutoon is in addition to the regular dilution factor in the batch culture dilution=0.001.

migration
Type:boolean
Default:False

Set True to perform migration pertubations.

n_migration
Type:integer
Default:1000000

Number of cells in the migrant community.

s_migration
Type:integer
Default:NA

Number of species in the migrant community. If NA (as default), the migrant community is sampled from a regional pool where the species abundance follows power-law distribution. If set into an integer, n_migration cells will be equally allocated to s_migrations species from the pool to build the migrant community.

coalescence
Type:boolean
Default:False

Set True to perform coalescence pertubation.

f_coalescence
Type:float
Default:0.5

Between 0 and 1. Fraction of migrant community during coalescence. The fraction of a perturbed community is 1-f_coalescence.

resource_shift
Type:boolean
Default:False

Set True performs resource pertubations.

r_type
Type:string
Default:add

Type of resource pertubation. Available options are rescale_add, rescale_remove, add, remove, old. A fraction r_percent of resource A is removed, and that amount of resource is added to another resource B.

r_percent
Type:float
Default:1

Fraction of specified resource that is removed. r_percent=1 means all resource A is removed.


Community-simulator parameters

The parameters in this section are inherited and some with differnt values from community-simulator.

sampling
Type:string
Default:Binary_Gamma

Specify choice of sampling algorithm to generate the consumer uptake rate vector. Options are Gaussian, Binary, Gamma, Binary_Gamma.

sn
Type:integer
Default:2100

Number of microbial species in the global pool.

sf
Type:integer
Default:1

Number of specialist family.

s_gen
Type:integer
Default:0

Number/Richness of generalist taxa.

rn
Type:integer
Default:90

Number of resource types.

rf
Type:integer
Default:1

Number of resource classes.

R0_food
Type:float
Default:1000

Total resource abundance.

food
Type:float
Default:1000

Index of food source being supplied in the minimal medium. Only works when rich_medium=False.

supply
Type:string
Default:off

Choice of intrinsic resoruce dynamics. Set off for batch culture where resource is not renewing within a transfer.

muc
Type:float
Default:10

Mean sum over a row of the preference matrix ciα.

sigc
Type:float
Default:3

Standard deviation of sum over a row of the preference matrix ciα.

c0
Type:float
Default:0

Low consumption level for binary ciα.

c1
Type:integer
Default:1:

High consumption level for binary ciα.

q
Type:float
Default:0

Fraction of consumption capacity allocated to preferred resource class.

sparsity
Type:float
Default:0.2

Sparsity of metabolic matrix.

fs
Type:float
Default:0.45

Fraction of secreted byproducts allocated to the same resource class.

fw
Type:float
Default:0.45

Fraction of secreted byproducts allocated to waste resource class.

g
Type:float
Default:1

Conversion factor from energy uptake to growth rate (1/energy).

w
Type:float
Default:1

Energy content of resource α (energy/mass).

l
Type:float
Default:0

Leakage fraction.

m
Type:float
Default:0

Minimal energy uptake for maintenance of species i (energy/time). Mortality.

n
Type:integer
Default:2

Hill coefficient for functional response (unitless).

response
Type:string
Default:type III

Functional response of uptaking rates.

sigma_max
Type:float
Default:1

Maximum input flux (mass/time) for type III functional response.

regulation
Type:string
Default:independent

Metabolic regulation.

nreg
Type:integer
Default:10

Hill coefficient that tunes steepness of metabolic regulation.

tau
Type:float
Default:1

External resource supply rate when supply="external" for chemostat setting.

r
Type:string
Default:independent

Renewal rate for self renewing resources when supply="self-renewing" for chemostat setting.