How to use the pynets.core.utils.create_csv_path function in pynets

To help you get started, we’ve selected a few pynets examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dPys / PyNets / tests / test_utils.py View on Github external
ID = '002'
    models = ['corr', 'cov', 'sps', 'partcorr']
    roi = None
    node_size = 6

    for conn_model in models:
        for val in range(1, 10):
            thr = round(val*0.1, 1)
            for thr_type in ['prop', 'abs', 'dens', 'mst', 'disp']:
                for target_samples in range(0, 100, 1000):
                    for track_type in ['local', 'particle']:
                        for parc in [True, False]:
                            est_path = utils.create_est_path_diff(ID, network, conn_model, thr, roi,
                                                                  dir_path, node_size, target_samples,
                                                                  track_type, thr_type, parc, directget, max_length)
                            out_path = utils.create_csv_path(dir_path, est_path)
                            assert out_path is not None
github dPys / PyNets / tests / test_utils.py View on Github external
c_boot = 100
    hpass = 100
    parc = True
    directget = 'prob'
    max_length = 200

    # Cross test various connectivity models, thresholds, and parc true/false.
    for conn_model in models:
        for val in range(1, 10):
            thr = round(val*0.1, 1)
            for thr_type in ['prop', 'abs', 'dens', 'mst', 'disp']:
                for parc in [True, False]:
                    est_path = utils.create_est_path_func(ID, network, conn_model, thr, roi, dir_path, node_size,
                                                          smooth, c_boot,
                                               thr_type, hpass, parc)
                    out_path = utils.create_csv_path(dir_path, est_path)
                    assert out_path is not None

    dir_path = base_dir + '/002/dmri'
    network = 'Default'
    ID = '002'
    models = ['corr', 'cov', 'sps', 'partcorr']
    roi = None
    node_size = 6

    for conn_model in models:
        for val in range(1, 10):
            thr = round(val*0.1, 1)
            for thr_type in ['prop', 'abs', 'dens', 'mst', 'disp']:
                for target_samples in range(0, 100, 1000):
                    for track_type in ['local', 'particle']:
                        for parc in [True, False]:
github dPys / PyNets / pynets / stats / netstats.py View on Github external
def save_netmets(dir_path, est_path, metric_list_names, net_met_val_list_final):
    from pynets.core import utils

    # And save results to csv
    out_path_neat = "%s%s" % (utils.create_csv_path(dir_path, est_path).split('.csv')[0], '_neat.csv')
    zipped_dict = dict(zip(metric_list_names, net_met_val_list_final))
    df = pd.DataFrame.from_dict(zipped_dict, orient='index', dtype='float32').transpose()
    df.to_csv(out_path_neat, index=False)
    del df, zipped_dict, net_met_val_list_final, metric_list_names

    return out_path_neat
github dPys / PyNets / pynets / stats / netstats.py View on Github external
def save_netmets(dir_path, est_path, metric_list_names, net_met_val_list_final):
    from pynets.core import utils
    import pandas as pd

    # And save results to csv
    out_path_neat = "%s%s" % (utils.create_csv_path(dir_path, est_path).split('.csv')[0], '_neat.csv')
    zipped_dict = dict(zip(metric_list_names, net_met_val_list_final))
    df = pd.DataFrame.from_dict(zipped_dict, orient='index').transpose()
    df.to_csv(out_path_neat, index=False)

    del df, zipped_dict, net_met_val_list_final, metric_list_names
    return out_path_neat