Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- data = np.genfromtxt('data.txt', delimiter='\t', dtype='str')
- genes = data[1:,0]
- interactions = data[1:,2]
- query = '' # Insert interaction in quotes
- counts = {}
- for x in range(0, len(genes)):
- if genes[x] in counts:
- if interactions[x] == query:
- counts[genes[x]] += 1
- else:
- pass
- else:
- counts[genes[x]] = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement