CoBrALab / cobra-nmf

Collection of scripts for formatting vertex and/or voxel data into matrix format
5 stars 3 forks source link

compute_stability_corr.py: Missing "/" in lines 49 and 54 #12

Closed alyssadai closed 3 years ago

alyssadai commented 3 years ago

In this command, python vertex/compute_stability_corr.py --n_folds 10 --stability_results_dir $stabilityresultsfolder --k 5 If $stabilityresultsfolder doesn't end with a "/", e.g. --stability_results_dir stability_outputs. script throws an error. Can be fixed by specifying that this argument must end with backslash, or adding "/" to lines 49 & 54:

    #load split input, get W mx for each
    fname = stab_dir + "k" + str(g) + "/a_" + str(i) + ".mat" # HERE
    resA = scipy.io.loadmat(fname)
    Wa = resA['W']
    ea = resA['recon']

    fname = stab_dir + "k" + str(g) + "/b_" + str(i) + ".mat" # HERE
    resB = scipy.io.loadmat(fname)
    Wb = resB['W']
    eb = resB['recon']

to

    #load split input, get W mx for each
    fname = stab_dir + "/k" + str(g) + "/a_" + str(i) + ".mat"
    resA = scipy.io.loadmat(fname)
    Wa = resA['W']
    ea = resA['recon']

    fname = stab_dir + "/k" + str(g) + "/b_" + str(i) + ".mat"
    resB = scipy.io.loadmat(fname)
    Wb = resB['W']
    eb = resB['recon']
raihaan commented 3 years ago

fixed w 1de3486e65046f26878c590739d613eef8b55379 thanks