unravel.cluster_stats.org_data module#
Use cstats_org_data
(cod
) from UNRAVEL to aggregate and organize csv outputs from cstats_validation
.
- Inputs:
clusters/cluster_validation_results_`*` (glob pattern matching
cstats_validation
output dirs)CSVs with the density data (e.g., cell_density_data.csv or label_density_data.csv from
cstats_validation
)Optional: path/vstats to copy p val, info, and index files
- Outputs:
target_dir/sample??__cell_density_data__<cluster_validation_results_`*`>.csv
target_dir/sample??__label_density_data__<cluster_validation_results_`*`>.csv
Notes
If the cluster_validation_results_`*` directory name contains “_gt_” or “_lt_”, the script will attempt to replace it with “_v_” to match the vstats directory.
This is useful when non-directional maps were made as directional.
If the cluster_validation_results_`*` directory name contains “_LH” or “_RH”, the script will attempt to remove it to match the vstats directory.
Usage#
cstats_org_data -cvd ‘<asterisk>’ [-dt cell | label] [-vd path/vstats_dir] [-td target_dir] [-pvt p_value_threshold.txt] [-d list of paths] [-p sample??] [-v]
- unravel.cluster_stats.org_data.cp(src, dest)[source]#
Copy a file from src path to a dest path, optionally printing the action.
- Parameters:
src (-) – the source path
dest (-) – the destination path
- unravel.cluster_stats.org_data.copy_stats_files(validation_dir, dest_path, vstats_path, p_val_txt)[source]#
Copy the cluster info, p value threshold, and rev_cluster_index files to the target directory.
- Parameters:
validation_dir (-) – the path to the validation directory
dest_path (-) – the path to the new directory
vstats_path (-) – the path to the vstats directory
p_val_txt (-) – the name of the file with the corrected p value threshold
- unravel.cluster_stats.org_data.organize_validation_data(sample_path, clusters_path, validation_dir_pattern, density_type, target_dir, vstats_path, p_val_txt)[source]#
Copy the cluster validation, p value, cluster info, and rev_cluster_index files to the target directory.
- Parameters:
sample_path (-) – the path to the sample directory
clusters_path (-) – the path to the clusters directory
validation_dir_pattern (-) – the pattern to match the validation directories
density_type (-) – the type of density data to aggregate (cell or label)
target_dir (-) – the path to the target directory
vstats_path (-) – the path to the vstats directory
p_val_txt (-) – the name of the file with the corrected p value threshold
cluster_idx (-) – the name of the rev_cluster_index file