Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def run(data, gmt, cls, permutation_type='phenotype', method='signal_to_noise', permution_num=1000):
prefix = gp.__name__ + "."
for importer, modname, ispkg in pkgutil.iter_modules(gp.__path__, prefix):
if modname == "gseapy.gsea":
module = __import__(modname, fromlist="dummy")
vs = gp.__version__.split(".")
if int(vs[0]) == 0 and int(vs[1]) < 9:
module.ranking_metric = GSEA._ranking_metric
else:
module.ranking_metric = GSEA._ranking_metric2
gp.algorithm.ranking_metric = GSEA._ranking_metric
res = gp.gsea(data, gmt, cls, permutation_type=permutation_type, permutation_num=permution_num,
outdir=os.path.join(os.path.dirname(os.path.realpath(__file__)), 'images'), method=method)
return GSEA(res.res2d, data, gmt, cls)