You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, I would like to say that it is very nice of you to share your code with the community.
I wrote a function to dump the JSD matrix to a .tsv file, that can be easily exported to other platforms, such as R or MATLAB. It can be extended to dump the JSD_aprox matrix as well. If you think it could be useful for others, feel free to add it to your project!
def dump_JSD_tsv(self, output_filename = 'JSD.tsv', force_compute=False):
if self.JSD == None:
if force_compute:
self.compute_JSD_matrix()
else:
print "Error!!! call to dump_JSD_tsv but JSD matrix has not been computed!!!"
sys.exit(1)
f = open(output_filename, "w")
# column names
f.write('\t')
for i in range(len(self.layers)):
f.write(str(i)+'\t')
f.write('\n')
for i in range(len(self.layers)):
f.write(str(i)+'\t') # rowname
for j in range(len(self.layers)):
f.write(str(self.JSD[i][j])+'\t')
f.write('\n')
I also suggest replacing self.len in lines 320 and 321 for len(self.layers)
Have a good one!
The text was updated successfully, but these errors were encountered:
Hello KatolaZ,
First, I would like to say that it is very nice of you to share your code with the community.
I wrote a function to dump the JSD matrix to a .tsv file, that can be easily exported to other platforms, such as R or MATLAB. It can be extended to dump the JSD_aprox matrix as well. If you think it could be useful for others, feel free to add it to your project!
I also suggest replacing
self.len
in lines 320 and 321 forlen(self.layers)
Have a good one!
The text was updated successfully, but these errors were encountered: