Commit a47fb6a2 authored by Christopher Bennett's avatar Christopher Bennett
Browse files

Full working version of TReNCo

parent 59201a03
......@@ -936,19 +936,16 @@ def tis_enh_gene_net(sample, outdir, matrix1, matrix2, gene_vect, threads):
p.join()
print('Gathering all weights from all TADs')
all_network = tf_pro_mx.multiply(g_vect.T, axis=1)
all_network.to_csv('process/{}_tf_promoter_matrix.txt'.format(sample), sep='\t')
tf_gene_wgt = tf_pro_mx.multiply(g_vect.T, axis=1)
tf_gene_wgt.to_csv('process/{}_tf_promoter_matrix.txt'.format(sample), sep='\t')
for df in dfs:
all_network.add(df)
all_network = pd.concat(dfs, sort = False, axis=1)
all_network.fillna(0, inplace=True)
#all_network = pd.concat(dfs, sort = False)
#all_network.fillna(0, inplace=True)
#all_network_add = all_network.add(tfxpro_wgt, fill_value=0)
all_network_add = all_network.add(tf_gene_wgt, fill_value=0)
hdf = pd.HDFStore('results/networks/{}_full_network.h5'.format(sample))
hdf['results/network'] = all_network
hdf['results/network'] = all_network_add
hdf.close()
print(all_network.shape)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment