unravel.cluster_stats.reshape module#

Use cstats_reshape (reshape) from UNRAVEL to export raw cluster validation data as long, wide and per-cluster CSVs.

Prereqs:
  • cstats_validation, cstats_org_data, cstats_group_data, utils_prepend

  • or cstats_mean_IF for reshaping mean IF intensity data (metric column autodetected if cols: sample, cluster_ID, <metric_col> are present)

Input files:
  • *_data.csv from cstats_validation after condition prefixes were prepended e.g., saline_cell_density_data.csv, drug_cell_density_data.csv

Outputs:
  • _reshaped/raw_data_long.csv

  • _reshaped/raw_data_wide.csv

  • _reshaped/by_cluster/cluster_<cluster_ID>__<value_name>.csv

Note

  • If hemisphere-specific CSVs are present (e.g. cluster_1_LH.csv and cluster_1_RH.csv), the script will attempt to pool the data.

Usage:#

cstats_reshape -g saline drug1 drug2 -i ‘*cell_density_data.csv

Usage with combined groups:#

cstats_reshape -g saline MBDB MDAI RMDMA SMDMA –combine entactogens=MBDB+MDAI+RMDMA+SMDMA

Usage for mean_IF data:#

cstats_reshape -g AwS AwP -o _reshaped_mean_IF

unravel.cluster_stats.reshape.parse_args()[source]#
unravel.cluster_stats.reshape.detect_simple_metric_schema(first_df)[source]#
unravel.cluster_stats.reshape.simple_metric_data_df(csv_files, groups, metric_col)[source]#
unravel.cluster_stats.reshape.main()[source]#