Strawberry analysis function
Function to analyse strawberry mtg: Data extraction and plot
- openalea.strawberry.analysis.apparent_axis(g, vid)[source]
Return apparent axis if module are visible
- openalea.strawberry.analysis.branching_type(vid, g)[source]
Returns the type of branching
- Algorithms
- if module is visible:
branch crown (complex ramification):6
inflorescence : 7
- if module is invisible:
stolon (s): 1,
vegetative bud(bt, at stage None, 17,18,19):2,
initiated bud, (bt, at stage A):3,
aborted or roten or dried bud: 4
floral bud(ht):5
- openalea.strawberry.analysis.complete(vid, g)[source]
Add property complete or not on mtg
- Parameters
vid (int) – vid selected
g (MTG) – MTG
- Returns
The ‘complete’ state of the vid
- Return type
boolean
- openalea.strawberry.analysis.complete_module(g, vids=[])[source]
Return properties incomplete or complete module Algorithm: module are complete: if module are visible and terminated by an Inflorescence (HT) (propertie=True) else module are incomplete (all module terminated by ht or bt) (property=False)
- Parameters
g (MTG) – the MTG module
vids (list, optional) – list of vids, defaults to []
- openalea.strawberry.analysis.compute_leaf_area(g, vids=[])[source]
Compute the leaf area of the selected MTG
- openalea.strawberry.analysis.crown_status(vid, g)[source]
Returns the type of inflorescence
- Algorithms
- if label is bt then
if stage is 17, 18, 19 or None, => vegetative (1)
if stage is A => initiated (2)
if stage is other => non defined (pourri, avorte, coupe) (-1)
Terminal vegetative bud (1): label==bt g.property(Stade)== none or 17 or 18 or 19
Terminal initiated bud (2): label== bt if g.property(Stade) == A
Terminal Floral bud (3): label==ht
Inflorescence Terminal (4): label== HT
runner (5): label = s
- openalea.strawberry.analysis.crowntype_distribution(data, varieties, crown_type, plot=True, expand=0)[source]
Create a dataframe containing relative frequency values by genotype and order for extension and branch crown and a relative frequency distribution plot
- Parameters
data (pd.DataFrame) – panda dataframe issue from extraction of data at module scale
varieties (list of string) – names of varieties which are plot
crown_type (str) – type of branch crown (extension_crown or branch_crown)
plot (bool, optional) – is ploted, defaults to True
expand (int, optional) – allows to change xlim, defaults to 0
- Returns
the dataframe
- Return type
pd.DataFrame
- openalea.strawberry.analysis.date(vid, g)[source]
Return the date of the selected vid in the mtg
- Parameters
vid (int) – vid selected
g (MTG) – MTG
- Returns
The date
- Return type
string
- openalea.strawberry.analysis.df2waffle(df, date, index, variable, order=None, aggfunc=None, crosstab=None, *args, **kwargs)[source]
Transpose dataframe by variable with plant in columns and rank or order in index This function are available for extraction at node scale (index=’rank’) and extraction at module scale (index= ‘order’)
- Parameters
df (pd.DataFrame) – dataframe from extract function at differente scale (modules and nodes scale)
date (str) – date which must be processed
index (str) – scale of the representation (node > ‘rank’, module > ‘order’)
variable (str) – variable which must be processed
order (int, optional) – at module scale, give a specific module to be processed , defaults to None
aggfunc (str, optional) – required if the data need to be grouped quantitative: “mean”, “median” | qualitative: lambda x: ‘ ‘.join(x), defaults to None
crosstab (boolean, optional) – make a crosstab selection of the input data, defaults to None
- Returns
a dataframe in “waffle” shape: index=date, & columns=variable
- Return type
pd.DataFrame
- openalea.strawberry.analysis.extract_at_module_scale(g, vids=[], convert={'Fleurs_avorte': 'FLWRNUMBER_ABORTED', 'Fleurs_ouverte': 'FLWRNUMBER_OPEN', 'Fleurs_total': 'FLWRNUMBER', 'Plante': 'Plant_ID', 'Stade': 'Stade', 'date': 'Sample_date'})[source]
Compute the properties at module scale of a MTG.
- Parameters
- Returns
A dataframe of computed properties at module scale
- Return type
DataFrame
- openalea.strawberry.analysis.extract_at_node_scale(g, vids=[], convert={'Fleurs_avorte': 'FLWRNUMBER_ABORTED', 'Fleurs_ouverte': 'FLWRNUMBER_OPEN', 'Fleurs_total': 'FLWRNUMBER', 'Plante': 'Plant_ID', 'Stade': 'Stade', 'date': 'Sample_date'})[source]
Compute the properties at node scale of a MTG.
- Parameters
- Returns
A dataframe of computed properties at node scale
- Return type
DataFrame
- openalea.strawberry.analysis.extract_at_plant_scale(g, vids=[], convert={'Fleurs_avorte': 'FLWRNUMBER_ABORTED', 'Fleurs_ouverte': 'FLWRNUMBER_OPEN', 'Fleurs_total': 'FLWRNUMBER', 'Plante': 'Plant_ID', 'Stade': 'Stade', 'date': 'Sample_date'})[source]
Compute the properties at plant scale of a MTG.
- Parameters
- Returns
A dataframe of computed properties at plant scale
- Return type
DataFrame
- openalea.strawberry.analysis.genotype(vid, g)[source]
Return the genotype of the selected vids in the mtg
- Parameters
vid (int) – vid selected
g (MTG) – MTG
- Returns
The genotype
- Return type
string
- openalea.strawberry.analysis.is_axis_root(g, vid)[source]
Checks if axis is root
- Parameters
g (MTG) – MTG
vid (int) – vid selected
- Returns
Is the axis a root
- Return type
boolean
- openalea.strawberry.analysis.median_individuals(df)[source]
Generate a median individual from a group of genotype, date, modality
- Parameters
df (DataFrame) – A dataframe extracted from the MTG at a specific scale (order, plant, or node)
- Returns
A reduced dataframe with the median individual
- Return type
DataFrame
- openalea.strawberry.analysis.modality(vid, g)[source]
Return the modality of the selected vid in the mtg
- Parameters
vid (int) – vid selected
g (MTG) – MTG
- Returns
The modality
- Return type
string
- openalea.strawberry.analysis.my_bt(vid, g)[source]
Return branching type on parent if branch crown correspond to Son vertex
- Parameters
vid (int) – vid selected
g (MTG) – MTG
- Returns
the branching type on parent
- Return type
string
- openalea.strawberry.analysis.my_complete(vid, g)[source]
Return complete module, incomplete module or other (if not branch crown)
- Parameters
vid (int) – vid selected
g (MTG) – MTG
- Returns
‘Complete’ state
- Return type
string
- openalea.strawberry.analysis.nb_aborted_flowers(vid, g)[source]
Return the number of aborted flowers
- openalea.strawberry.analysis.nb_branching_tree_weight(v, g)[source]
Compute the number of branching tree weight
- openalea.strawberry.analysis.nb_foliar_primordia(vid, g)[source]
Return the number of foliar primordia (f)
- openalea.strawberry.analysis.nb_total_leaves(vid, g)[source]
Return the total number of leaves (f+F)
- openalea.strawberry.analysis.nb_total_module_tree(v, g)[source]
Compute the number of total module tree
- openalea.strawberry.analysis.nb_vegetative_buds(vid, g)[source]
Return the number of vegetative buds Algorithm: if label is bt then stage is 17,18,19 or None count number of bt and attach at the parent order
- openalea.strawberry.analysis.nb_visible_leaves_tree(v, g)[source]
Compute the number of visible leaves tree
- openalea.strawberry.analysis.occurence_module_order_along_time(data, frequency_type)[source]
Compute the occurence module order along time
- Parameters
data (pd.DataFrame) – data extracted at module scale
frequency_type (str) – type of distribution frequency distribution (freq), probability distribution frequency (pbf) or cumulative frequency distribution (cdf)
- Returns
A dataframe with frequency, probability or cumulative frequency distribution for each module order along time
- Return type
pd.DataFrame
- openalea.strawberry.analysis.plant(vid, g)[source]
Return the plant id of the selected vid in the mtg
- Parameters
vid (int) – vid selected
g (MTG) – MTG
- Returns
The plant id
- Return type
string
- openalea.strawberry.analysis.plot_waffle(df, layout={}, legend_name={}, savepath=None, plot_func='matplotlib')[source]
Plot a dataframe in “waffle” shape
- layout: dict of layout parameters:
height/width: size of the picture in inch x/ylabel: label of the x/y axis x/yticks: ticks of the x/y axis x/yticks_labels: labels of the ticks on the x/y axis title: title
- plot_func: library used for the ploting:
matplotlib: matplotlib.pyplot.subplot.imshow plotly.imshow: plotly.express.imshow plotly.heatmap: plotly.graph_objs.heatmap
- openalea.strawberry.analysis.pointwisemean_plot(data_mean, data_sd, varieties, variable, title, ylab, expand=0)[source]
Plot a pointwise mean of variables.
- Parameters
data_mean (DataFrame) – panda dataframe containg mean values
data_sd (DataFrame) – panda dataframe containing standars error values
varieties (list of string) – names of varieties which are plot
variable (string) – The variable to plot
title (string) – plot title
ylab (string) – y axis label
expand (int, optional) – allows to change xlim, defaults to 0
- openalea.strawberry.analysis.prob_axillary_production(g, order=None, vids=[], frequency=False)[source]
Probability of axillary production as function of node rank
- Parameters
- Returns
A dataframe with the probability of axillary production for each node
- Return type
pd.DataFrame
- openalea.strawberry.analysis.property(g, name)[source]
Change the name of the MTG properties without changing the code
- Parameters
g (MTG) – The MTG to modify
name (string) – The property name
- Returns
A MTG with the name of the property changed
- Return type
MTG
- openalea.strawberry.analysis.strawberry_dataframe(g)[source]
Convert a strawberry MTG into a dataframe
- Parameters
g (MTG) – the strawberry MTG
- Returns
A dataframe
- Return type
DataFrame
- openalea.strawberry.analysis.to_dataframe(g, vertices=[], f=None)[source]
Convert an MTG into a full dataframe.
- Parameters
g (MTG) – MTG graph
vertices (list, optional) – define the vertices you want to export, defaults to []
f (function, optional) – v -> dict : function that returns a set of properties for any vertex, defaults to None
- Returns
A dataframe that include all the MTG properties
- Return type
DataFrame
- openalea.strawberry.analysis.type_of_crown(vid, g)[source]
Returns the type of crown.
- Definition of type of crown (1, 2, 3):
principal crown (1): label == T
- branch_crown (3)
parent(component_roots()[0]) : if successor() == F
extension_crown (2): contains(HT, ht, bt)
error (4)
- openalea.strawberry.analysis.visible_modules(g, vids=[])[source]
Give “visible” property to module
- Parameters
g (MTG) – The MTG
vids (list, optional) – List of vids whose property will be “visible”, defaults to []