rnalysis.enrichment.FeatureSet

class rnalysis.enrichment.FeatureSet(gene_set: List[str] | Set[str] | Filter = None, set_name: str = '')

Receives a filtered gene set and the set’s name (optional) and preforms various enrichment analyses on them.

__init__(gene_set: List[str] | Set[str] | Filter = None, 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')

FeatureSet.add

Add an element to a set.

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

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

FeatureSet.biotypes_from_ref_table([ref])

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

FeatureSet.change_set_name(new_name)

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

FeatureSet.clear

Remove all elements from this set.

FeatureSet.copy

Return a shallow copy of a set.

FeatureSet.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).

FeatureSet.difference_update

Remove all elements of another set from this set.

FeatureSet.discard

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

FeatureSet.filter_biotype_from_gtf(gtf_path)

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

FeatureSet.filter_biotype_from_ref_table([...])

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

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

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

FeatureSet.filter_by_go_annotations(go_ids)

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

FeatureSet.filter_by_kegg_annotations(kegg_ids)

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

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

Find paralogs within the same species using the Ensembl database.

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

Find paralogs within the same species using the PantherDB database.

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

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

FeatureSet.intersection(*others)

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

FeatureSet.intersection_update

Update a set with the intersection of itself and another.

FeatureSet.isdisjoint

Return True if two sets have a null intersection.

FeatureSet.issubset(other, /)

Test whether every element in the set is in other.

FeatureSet.issuperset(other, /)

Test whether every element in other is in the set.

FeatureSet.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.

FeatureSet.map_orthologs_ensembl(map_to_organism)

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

FeatureSet.map_orthologs_orthoinspector(...)

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

FeatureSet.map_orthologs_panther(map_to_organism)

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

FeatureSet.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.

FeatureSet.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.

FeatureSet.pop

Remove and return an arbitrary set element.

FeatureSet.remove

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

FeatureSet.save_txt(fname)

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

FeatureSet.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).

FeatureSet.symmetric_difference_update

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

FeatureSet.translate_gene_ids(translate_to)

Translates gene names/IDs from one type to another.

FeatureSet.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).

FeatureSet.update

Update a set with the union of itself and others.

FeatureSet.user_defined_enrichment(...[, ...])

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