group_statistics#
Create some statistics to test significant changes in voxelized and labeled data.
- color_p_values(p_vals, p_sign, positive_color=[1, 0], negative_color=[0, 1], p_cutoff=None, positive_trend=[0, 0, 1, 0], negative_trend=[0, 0, 0, 1], p_max=None)[source]#
- Parameters:
np.array (p_sign)
np.array
list (negative_trend)
list
float (p_max)
list
list
float
Returns
- compare_groups(directory, gp1_name, gp2_name, gp1_dirs, gp2_dirs, prefix='p_val_colors', advanced=True)[source]#
- group_cells_counts(struct_ids, group_cells_dfs, sample_ids, volume_map)[source]#
- Parameters:
list (struct_ids)
group_cells_dfs (list(pd.DataFrame))
sample_ids (list)
volume_map (dict) – maps each id from structure_ids to the corresponding structure’s volume (in pixel)
Returns
- make_summary(directory, gp1_name, gp2_name, gp1_dirs, gp2_dirs, output_path=None, save=True)[source]#
- read_group(sources, combine=True, **args)[source]#
Turn a list of sources for data into a numpy stack.
Arguments
- sourceslist of str or sources
The sources to combine.
- combinebool
If true combine the sources to ndarray, oterhwise return a list.
Returns
- grouparray or list
The group data.
- sanitize_df(gp_names, grouped_counts, total_df)[source]#
Remove rows with all 0 or NaN in at least 1 group Args:
gp_names: grouped_counts: total_df:
Returns:
- stack_voxelizations(directory, f_list, suffix)[source]#
Regroup voxelizations to simplify further processing
- Parameters:
directory
f_list
suffix
Returns
- t_test_region_counts(counts1, counts2, signed=False, remove_nan=True, p_cutoff=None, equal_var=False)[source]#
t-Test on differences in counts of points in labeled regions
- t_test_voxelization(group1, group2, signed=False, remove_nan=True, p_cutoff=None)[source]#
t-Test on differences between the individual voxels in group1 and group2
Arguments
- group1, group2array of arrays
The group of voxelizations to compare.
- signedbool
If True, return also the direction of the changes as +1 or -1.
- remove_nanbool
Remove Nan values from the data.
- p_cutoffNone or float
Optional cutoff for the p-values.
Returns
- p_valuesarray
The p values for the group wise comparison.
- test_completed_cumulatives(data, method='AndersonDarling', offset=None, plot=False)[source]#
Test if data sets have the same number / intensity distribution by adding max intensity counts to the smaller sized data sets and performing a distribution comparison test
- test_completed_inverted_cumulatives(data, method='AndersonDarling', offset=None, plot=False)[source]#
Test if data sets have the same number / intensity distribution by adding zero intensity counts to the smaller sized data sets and performing a distribution comparison test on the reversed cumulative distribution