ora
Run a single-omic ORA with gmt file and list of analytes and reference provided as list of strings.
Parameters
gmt_path-strof the path to the gmt file of interestanalyte_list-list[str]of the analyte list of interest.reference_list-list[str]of the reference list. Typically all observed analytes.
Returns
Returns a list of dictionaries with the results containing the ORA results for every set.
Panics
Panics if the any file or list is malformed or not at specified path.
Example
import webgestaltpy
def file_to_list(file_path: str) -> list[str]:
"""Convert file to list[str]"""
with open(file_path, "r") as r:
return list(r.readlines()
gene_list = file_to_list("genelist.txt")
reference = file_to_list("reference.txt")
res = webgestaltpy.ora("kegg.gmt", gene_list, reference) ## gene_list and reference are both list[str]
print(res[0:2]) ## print first two results
Output
[
{
'set': 'has00010',
'p': 0.7560574551180973,
'fdr': 1,
'overlap': 2,
'expected': 2.6840874707743088,
'enrichment_ratio': 0.7451321992211519
},
{
'set': 'has00020',
'p': 0.7019892669020903,
'fdr': 0.9981116297866582,
'overlap': 1,
'expected': 1.1841562371063128,
'enrichment_ratio': 0.8444831591173054
}
]