Skip to content

Instantly share code, notes, and snippets.

@ngopal
Created February 22, 2014 23:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ngopal/9164294 to your computer and use it in GitHub Desktop.
Save ngopal/9164294 to your computer and use it in GitHub Desktop.
make a list of nodes from human PPI data
import os, sys
from itertools import chain, combinations
genes_set = set([])
for i in open(sys.argv[1], 'r').readlines():
if '#' in i:
continue
else:
line = i.strip('\r\n').split('\t')
genes = line[2].replace('_HUMAN','').split(',')
score = line[3]
for k in genes:
genes_set.add(k)
for index, item in enumerate(list(genes_set)):
print str(str(index)+'\t'+str(item))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment