rnalysis.enrichment.RankedSet

class rnalysis.enrichment.RankedSet(ranked_genes: Filter | List[str] | Tuple[str] | ndarray, set_name: str = '')

Receives a ranked gene set, sorted by any biologically-meaningful value (expression level, fold-change, etc) and preforms various enrichment analyses on them. ALl functions that can be applied to FeatureSet objects can also be applied to RankedSet objects.

__init__(ranked_genes: Filter | List[str] | Tuple[str] | ndarray, set_name: str = '')
Parameters:
  • gene_set (filtering.Filter object, set of strings or list of strings) – the set of genomic features to be used in downstream analyses

  • set_name (str) – name of the FeatureSet

Examples:
>>> from rnalysis import enrichment, filtering
>>> my_set = enrichment.FeatureSet({'gene1','gene2','gene2'}, 'name of my set')
>>> filter_obj = filtering.CountFilter('tests/test_files/counted.csv')
>>> my_other_set = enrichment.FeatureSet(filter_obj, 'name of my other set')

RankedSet.add

Add an element to a set.

RankedSet.biotypes_from_gtf(gtf_path[, ...])

Returns a DataFrame describing the biotypes in the table and their count.

RankedSet.biotypes_from_ref_table([ref])

Returns a DataFrame describing the biotypes in the gene set and their count.

RankedSet.change_set_name(new_name)

Change the 'set_name' of a FeatureSet to a new name.

RankedSet.clear

Remove all elements from this set.

RankedSet.copy

Return a shallow copy of a set.

RankedSet.difference(*others)

Calculates the set difference of the indices from multiple FeatureSet objects (the indices that appear in the first FeatureSet object but NOT in the other objects).

RankedSet.difference_update

Remove all elements of another set from this set.

RankedSet.discard

Remove an element from a set if it is a member.

RankedSet.filter_biotype_from_gtf(gtf_path)

Filters out all features that do not match the indicated biotype/biotypes (for example: 'protein_coding', 'ncRNA', etc).

RankedSet.filter_biotype_from_ref_table([...])

Filters out all features that do not match the indicated biotype/biotypes (for example: 'protein_coding', 'ncRNA', etc).

RankedSet.filter_by_attribute(attributes[, ...])

Filters features according to user-defined attributes from an Attribute Reference Table.

RankedSet.filter_by_go_annotations(go_ids[, ...])

Filters genes according to GO annotations, keeping only genes that are annotated with a specific GO term.

RankedSet.filter_by_kegg_annotations(kegg_ids)

Filters genes according to KEGG pathways, keeping only genes that belong to specific KEGG pathway.

RankedSet.find_paralogs_ensembl([organism, ...])

Find paralogs within the same species using the Ensembl database.

RankedSet.find_paralogs_panther([organism, ...])

Find paralogs within the same species using the PantherDB database.

RankedSet.go_enrichment(background_genes[, ...])

Calculates enrichment and depletion of the FeatureSet for Gene Ontology (GO) terms against a background set.

RankedSet.intersection(*others)

Calculates the set intersection of the indices from multiple FeatureSet objects (the indices that exist in ALL of the FeatureSet objects).

RankedSet.intersection_update

Update a set with the intersection of itself and another.

RankedSet.isdisjoint

Return True if two sets have a null intersection.

RankedSet.issubset(other, /)

Test whether every element in the set is in other.

RankedSet.issuperset(other, /)

Test whether every element in other is in the set.

RankedSet.kegg_enrichment(background_genes)

Calculates enrichment and depletion of the FeatureSet for Kyoto Encyclopedia of Genes and Genomes (KEGG) curated pathways against a background set.

RankedSet.map_orthologs_ensembl(map_to_organism)

Map genes to their nearest orthologs in a different species using the Ensembl database.

RankedSet.map_orthologs_orthoinspector(...)

Map genes to their nearest orthologs in a different species using the OrthoInspector database.

RankedSet.map_orthologs_panther(map_to_organism)

Map genes to their nearest orthologs in a different species using the PantherDB database.

RankedSet.map_orthologs_phylomedb(...[, ...])

Map genes to their nearest orthologs in a different species using the PhylomeDB database. This function generates a table describing all matching discovered ortholog pairs (both unique and non-unique) and returns it, and can also translate the genes in this data table into their nearest ortholog, as well as remove unmapped genes.

RankedSet.non_categorical_enrichment(...[, ...])

Calculates enrichment and depletion of the FeatureSet for user-defined non-categorical attributes against a background set using either a one-sample T-test or Sign test.

RankedSet.pop

Remove and return an arbitrary set element.

RankedSet.remove

Remove an element from a set; it must be a member.

RankedSet.save_txt(fname)

Save the list of features in the FeatureSet object under the specified filename and path.

RankedSet.single_set_enrichment(attributes)

Calculates enrichment and depletion of the sorted RankedSet for user-defined attributes WITHOUT a background set, using the generalized Minimum Hypergeometric Test (XL-mHG, developed by `Prof.

RankedSet.single_set_go_enrichment([...])

Calculates enrichment and depletion of the sorted RankedSet for Gene Ontology (GO) terms WITHOUT a background set, using the generalized Minimum Hypergeometric Test (XL-mHG, developed by `Prof.

RankedSet.single_set_kegg_enrichment([...])

Calculates enrichment and depletion of the sorted RankedSet for Kyoto Encyclopedia of Genes and Genomes (KEGG) curated pathways WITHOUT a background set, using the generalized Minimum Hypergeometric Test (XL-mHG, developed by `Prof.

RankedSet.symmetric_difference(other)

Calculates the set symmetric difference of the indices from two FeatureSet objects (the indices that appear in EXACTLY ONE of the FeatureSet objects, and not both/neither).

RankedSet.symmetric_difference_update

Update a set with the symmetric difference of itself and another.

RankedSet.translate_gene_ids(translate_to[, ...])

Translates gene names/IDs from one type to another.

RankedSet.union(*others)

Calculates the set union of the indices from multiple FeatureSet objects (the indices that exist in at least one of the FeatureSet objects).

RankedSet.update

Update a set with the union of itself and others.

RankedSet.user_defined_enrichment(...[, ...])

Calculates enrichment and depletion of the FeatureSet for user-defined attributes against a background set.