# get downsampling parameters noise, target = pcreode.get_thresholds( pca_reduced_data) # run pCreode out_graph, out_ids = pcreode.pCreode( data = pca_reduced_data, density = density, noise = noise, target = target, file_path = "/ti/workspace/.", num_runs = params["num_runs"], mute=True ) # score graphs, returns a vector of ranks by similarity graph ranks = pcreode.pCreode_Scoring(data = pca_reduced_data, file_path = "/ti/workspace/.", num_graphs = params["num_runs"], mute=True) # select most representative graph gid = graph_ranks[0] # extract cell graph # Wrapper's note: This is actually a cluster graph and a grouping, but none of the objects contain this grouping # the only thing that is available is a cell graph of only a subset of cells # so we use this cell graph as milestone network, and then project all cells onto this analysis = pcreode.Analysis( file_path = "/ti/workspace/.", graph_id = gid, data = pca_reduced_data, density = density, noise = params["noise"] )
dens = pcreode.Density(pca_reduced_data) density_1 = dens.get_density(radius=1.0) noise = 8.0 target = 50.0 file_path = './myeloid_w_ids/' #pdb.set_trace() out_graph, out_ids = pcreode.pCreode(data=pca_reduced_data, density=density_1, noise=noise, target=target, file_path=file_path, num_runs=10) pcreode.pCreode_Scoring(data=pca_reduced_data, file_path=file_path, num_graphs=10) seed = 123 gid = 9 #Plot graph pcreode.plot_save_graph(seed=seed, file_path=file_path, graph_id=gid, data=pca_reduced_data, overlay=data_raw.ELANE, density=density_1, file_out='Elane', upper_range=1.5)
# get downsampling parameters noise, target = pcreode.get_thresholds( pca_reduced_data) # run pCreode out_graph, out_ids = pcreode.pCreode( data = pca_reduced_data, density = density, noise = noise, target = target, file_path = "/", num_runs = parameters["num_runs"], mute = True ) # score graphs, returns a vector of ranks by similarity graph_ranks = pcreode.pCreode_Scoring(data = pca_reduced_data, file_path = "/", num_graphs = parameters["num_runs"], mute=True) # select most representative graph gid = graph_ranks[0] # extract cell graph # Wrapper's note: This is actually a cluster graph and a grouping, but none of the objects contain this grouping # the only thing that is available is a cell graph of only a subset of cells # so we use this cell graph as milestone network, and then project all cells onto this analysis = pcreode.Analysis( file_path = "/", graph_id = gid, data = pca_reduced_data, density = density, noise = noise )
# downsample downed, downed_ind = pcreode.Down_Sample(pca_reduced_data, density, params["noise"], params["target"]) # run pCreode out_graph, out_ids = pcreode.pCreode(data=pca_reduced_data, density=density, noise=params["noise"], target=params["target"], file_path="/.", num_runs=params["num_runs"]) # score graphs # Wrapper's note: There is currently no way of extracting the best graph ordering, even though it is printed. Will select random graph. pcreode.pCreode_Scoring(data=pca_reduced_data, file_path="/.", num_graphs=params["num_runs"]) gid = np.random.choice(range(params["num_runs"]), 1)[0] # extract cell graph # Wrapper's note: This is actually a cluster graph and a grouping, but none of the objects contain this grouping # the only thing that is available is a cell graph of only a subset of cells # so we use this cell graph as milestone network, and then project all cells onto this analysis = pcreode.Analysis(file_path="/.", graph_id=gid, data=pca_reduced_data, density=density, noise=params["noise"]) checkpoints["method_aftermethod"] = time.time()
file_path, man_clust=[[0, 1], [50, 51]], num_runs=num_runs, mute=True) # sparse cell types out_graph, out_ids = pcreode.pCreode_sparse(pca_reduced_data, density, noise, target, file_path, num_runs=num_runs, mute=True) # score graphs, returns a vector of ranks by similarity graph_ranks = pcreode.pCreode_Scoring(data=pca_reduced_data, file_path=file_path, num_graphs=num_runs, mute=True) # select most representative graph gid = graph_ranks[0] # extract cell graph analysis = pcreode.Analysis(file_path=file_path, graph_id=gid, data=pca_reduced_data, density=density, noise=noise) #analysis.plot_save_graph( seed=0, overlay=expression.iloc[:,1], file_out=file_path, upper_range=3, node_label_size=0) print "all good"