Advertisement
rugrln

Interactions

Apr 11th, 2015
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. import numpy as np
  2.  
  3. data = np.genfromtxt('data.txt', delimiter='\t', dtype='str')
  4.  
  5. genes = data[1:,0]
  6. interactions = data[1:,2]
  7.  
  8. query = ''  # Insert interaction in quotes
  9.  
  10. counts = {}
  11.  
  12. for x in range(0, len(genes)):
  13.     if genes[x] in counts:
  14.         if interactions[x] == query:
  15.             counts[genes[x]] += 1
  16.         else:
  17.             pass
  18.     else:
  19.         counts[genes[x]] = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement