Skip to content
Permalink
5bf0bf30e1
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 32 lines (25 sloc) 1 KB
#!/usr/bin/env python
'''
@author: Jens Preussner <jens.preussner@mpi-bn.mpg.de>
This is a wrapper for Julia Bayers geneset enrichment analysis program.
Input:
sys.argv[1] - geneset dictionary, key=name of geneset, value=list of genes (strings)
sys.argv[2] - tab separated rank file, 1st col genes, 2nd col rank
sys.argv[3] - output base
'''
import sys
import enrichAnalysis
import json
try:
with open(sys.argv[1]) as geneset_dict:
genesets = json.load(geneset_dict)
except IOError as e:
print("Unable to open file "+sys.argv[1]+". File might not exist or missing read permissions.")
ranks = []
try:
with open(sys.argv[2]) as rank_file:
for line in rank_file:
ranks.append(line)
except IOError as e:
print("Unable to open file "+sys.argv[2]+". File might not exist or missing read permissions.")
enrichAnalysis.main(mti_d = genesets, rank_l = ranks, s_path = sys.argv[3]+'-genesets_ranked.txt', h_path = sys.argv[3]+'-geneset_overlap.pdf', e_path = sys.argv[3], le_path = sys.argv[3]+'-geneset_genes.txt')