def min_conn_k(traj_exp):
traj_dist=sps.distance.squareform(sps.distance.pdist(traj_exp)) <EOL>conn_comp=<NUM_LIT:2> <EOL>k=<NUM_LIT:0> <EOL>while (conn_comp><NUM_LIT:1>):<EOL><INDENT>k=k+<NUM_LIT:1> <EOL>adj_mat=adaptive_knn_graph(traj_dist,k) <EOL>traj_graph = nx.Graph(adj_mat) <EOL>conn_comp = nx.number_connected_components(traj_graph) <EOL><DEDENT>return k<EOL>
Function returns the minimum number of connections, k, that are required to form a fully connected graph based gene expression data
:param traj_exp: ndarray representing gene expression
:return k: int of the minimum number of connections needed for a minimally connected graph