Commit 035c98f8 authored by David Hrbáč's avatar David Hrbáč
Browse files

Script to create list of modulea for the clusters

parent 57b48ed3
import csv
def get_data(filename):
'''function to read the data form the input csv file to use in the analysis'''
reader = [] # Just in case the file open fails
with open(filename, 'rb') as f:
reader = csv.reader(f,delimiter=',')
#returns all the data from the csv file in list form
#f.close() # May need to close the file when done
return list(reader) # only return the reader when you have finished.
your_list = []
your_list += get_data('modules-anselm.csv')
your_list += get_data('modules-salomon.csv')
#print your_list
counts = dict()
for i in your_list:
#print i[0]
#print int(i[1])
counts[i[0]]=counts.get(i[0], 0) + int(i[1])
#print counts
print "| Module | Clusters |"
print "| ------ | -------- |"
for m,i in counts.iteritems():
print "| %s | %s |" % (m,c[i])
curl -s -o modules-anselm.csv
curl -s -o modules-salomon.csv
#curl -s -o modules-salomon-uv.csv
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