How to use the gseapy.gsea.GSEA function in gseapy

To help you get started, we’ve selected a few gseapy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zqfang / GSEApy / gseapy / __main__.py View on Github external
subcommand = args.subcommand_name

    if subcommand == "replot":
        # reproduce plots using GSEAPY
        from .gsea import Replot
        rep = Replot(indir=args.indir, outdir=args.outdir, weighted_score_type=args.weight,
                     figsize=args.figsize, graph_num=args.graph,
                     format=args.format, verbose=args.verbose)
        rep.run()


    elif subcommand == "gsea":
        # compute using GSEAPY
        from .gsea import GSEA

        gs = GSEA(args.data, args.gmt, args.cls, args.outdir,
                  args.mins, args.maxs, args.n, args.weight,
                  args.type, args.method, args.ascending, args.threads,
                  args.figsize, args.format, args.graph, args.noplot, args.seed, args.verbose)
        gs.run()
    elif subcommand == "prerank":
        from .gsea import Prerank

        pre = Prerank(args.rnk, args.gmt, args.outdir, args.label[0], args.label[1],
                      args.mins, args.maxs, args.n, args.weight, args.ascending, args.threads,
                      args.figsize, args.format, args.graph, args.noplot, args.seed, args.verbose)
        pre.run()

    elif subcommand == "ssgsea":
        from .gsea import SingleSampleGSEA
        ss = SingleSampleGSEA(data=args.data, gene_sets=args.gmt, outdir=args.outdir,
                              sample_norm_method=args.norm,
github zqfang / GSEApy / gseapy / gsea.py View on Github external
:return: Return a GSEA obj. All results store to a dictionary, obj.results,
             where contains::

                 | {es: enrichment score,
                 |  nes: normalized enrichment score,
                 |  p: P-value,
                 |  fdr: FDR,
                 |  size: gene set size,
                 |  matched_size: genes matched to the data,
                 |  genes: gene names from the data set
                 |  ledge_genes: leading edge genes}


    """
    gs = GSEA(data, gene_sets, cls, outdir, min_size, max_size, permutation_num,
              weighted_score_type, permutation_type, method, ascending, processes,
               figsize, format, graph_num, no_plot, seed, verbose)
    gs.run()

    return gs