if COMPUTE_COMPLETE_DATA:
    data_all,op_id_good = fap.cat_data_from_matfile_root(mat_file_paths, count_op_id_min,is_from_old_matlab = IS_FROM_OLD_MATLAB,
                               data_all_good_op_path = data_all_good_op_path,op_id_good_path = op_id_good_path,is_return_masked = False)

# -- Create masked array from data_all    
# data_all = np.ma.masked_invalid(data_all)

# ---------------------------------------------------------------------------------
# -- Calculate U_statistics for the problems
# ---------------------------------------------------------------------------------   
if CALCULATE_U_STATS:
    
    # -- skip problems with already calculated U-stats
    if CALCULATE_ONLY_NEW_U_STATS:
        task_names = tstat.filter_calculated(mat_file_root,HCTSA_name_search_pattern = 'HCTSA_(.*)_N_70_100_reduced.mat')
        file_paths = [mat_file_root+"HCTSA_{0:s}_N_70_100_reduced.mat".format(s) for s in task_names]
    
    # -- calculate U-stats for all problems        
    else:
        file_paths = mat_file_paths
        _,task_names = tstat.get_calculated_names(mat_file_root,HCTSA_name_search_pattern = 'HCTSA_(.*)_N_70_100_reduced.mat')
    
    u_stat_file_paths = tstat.calculate_ustat_mult_tasks(mat_file_paths,task_names,ustat_data_out_folder,is_from_old_matlab = IS_FROM_OLD_MATLAB)  
    if CALCULATE_U_STATS_ALL_CLASSES_AVG:
        all_classes_avg = tstat.calculate_ustat_avg_mult_task(mat_file_paths,u_stat_file_paths,all_classes_avg_out_path ,is_from_old_matlab = IS_FROM_OLD_MATLAB)


  
  
# ---------------------------------------------------------------------------------
        data_all_good_op_path=data_all_good_op_path,
        op_id_good_path=op_id_good_path,
        is_return_masked=False)

# -- Create masked array from data_all
# data_all = np.ma.masked_invalid(data_all)

# ---------------------------------------------------------------------------------
# -- Calculate U_statistics for the problems
# ---------------------------------------------------------------------------------
if CALCULATE_U_STATS:

    # -- skip problems with already calculated U-stats
    if CALCULATE_ONLY_NEW_U_STATS:
        task_names = tstat.filter_calculated(
            mat_file_root,
            HCTSA_name_search_pattern='HCTSA_(.*)_N_70_100_reduced.mat')
        file_paths = [
            mat_file_root + "HCTSA_{0:s}_N_70_100_reduced.mat".format(s)
            for s in task_names
        ]

    # -- calculate U-stats for all problems
    else:
        file_paths = mat_file_paths
        _, task_names = tstat.get_calculated_names(
            mat_file_root,
            HCTSA_name_search_pattern='HCTSA_(.*)_N_70_100_reduced.mat')

    u_stat_file_paths = tstat.calculate_ustat_mult_tasks(
        mat_file_paths,