module: genome_integration.resources

class genome_integration.resources.enrichments.Enrich(gene_list)

Enrich is a class that uses the enrichr API to make enrichments of gene sets.

Makes requests to an outside server. So don’t use it if you don’t want that.

list_to_enrich: list of str
List of strings with genes to enrich.
gene_info: EnsemblGenes
will be filled with gene information for reference
gene_name_list: list of str
List of gene names after conversion.
enrichment_json: str in json format
json that contains the names of the enrichments.
background: list of str
backgrounds behind which to enrich.
enrich(self, enrichment_name = “None”, output=True)
Does an enrichment on the initialized gene list
reset(self)
removes all the data from the class.
convert_gene_list
converts a gene list to names that enrichr accepts.
do_enrichr_analysis(self, target_name)
enriches the gene list.
write_fdr_one_in_twenty_go_enrichments(self, file_name)
writes the fdr < 0.05 results to a stdout (if file_name == None) or a file
convert_gene_list()

internal function to return the gene list. :return:None

do_enrichr_analysis(target_name)

Does the request to enrichr for the enrichment analysis.

Parameters:target_name
Returns:
enrich(enrichment_name='None', output=True)

Enriches the gene list.

Parameters:
  • enrichment_name
  • output – if it should output the file.
Returns:

None

reset()

Resets to a zero gene state.

Returns:None
write_fdr_one_in_twenty_go_enrichments(filename=None)

Writes the enrichr results with an FDR > 0.05 to a file or standard out. :param filename: if None, will write to stdout, otherwise will write to a file. :return: None.