def runSamplesPermu(self, df, gmt=None):
assert self.min_size <= self.max_size<EOL>mkdirs(self.outdir)<EOL>self.resultsOnSamples = OrderedDict()<EOL>outdir = self.outdir<EOL>for name, ser in df.iteritems():<EOL><INDENT>self.outdir = os.path.join(outdir, str(name))<EOL>self._logger.info("<STR_LIT>" % name)<EOL>mkdirs(self.outdir)<EOL>dat2 = ser.sort_values(ascending=self.ascending)<EOL>gsea_results, hit_ind,rank_ES, subsets = gsea_compute(data=dat2, n=self.permutation_num, gmt=gmt,<EOL>weighted_score_type=self.weighted_score_type,<EOL>permutation_type='<STR_LIT>', method=None,<EOL>pheno_pos='<STR_LIT>', pheno_neg='<STR_LIT>',<EOL>classes=None, ascending=self.ascending,<EOL>processes=self._processes,<EOL>seed=self.seed, single=True, scale=self.scale)<EOL>res_zip = zip(subsets, list(gsea_results), hit_ind, rank_ES)<EOL>self._save_results(zipdata=res_zip, outdir=self.outdir, module=self.module,<EOL>gmt=gmt, rank_metric=dat2, permutation_type="<STR_LIT>")<EOL>self.resultsOnSamples[name] = self.res2d.es<EOL>if self._noplot: continue<EOL>self._logger.info("<STR_LIT>" % name)<EOL>self._plotting(rank_metric=dat2, results=self.results,<EOL>graph_num=self.graph_num, outdir=self.outdir,<EOL>figsize=self.figsize, format=self.format)<EOL><DEDENT>self._save(outdir)<EOL>return<EOL>
Single Sample GSEA workflow with permutation procedure