Skip to content

Commit

Permalink
Optimized code logic for offline enrichment analysis, added backgroun…
Browse files Browse the repository at this point in the history
…d parameter
  • Loading branch information
Starlitnightly committed Sep 21, 2024
1 parent b522c2a commit 3f6b539
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion omicverse/bulk/_Enrichment.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ class pyGSE(object):

def __init__(self,gene_list:list,pathways_dict:dict,pvalue_threshold:float=0.05,pvalue_type:str='auto',
background=None,organism:str='Human',description:str='None',outdir:str='./enrichr',cutoff:float=0.5) -> None:
"""Initialize the pyGSEA class.
"""Initialize the pyGSE class.
Arguments:
gene_list: A list of genes.
Expand Down
4 changes: 0 additions & 4 deletions omicverse/pl/_single.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,10 @@
from scanpy.plotting import _utils

from scanpy.plotting._utils import (
_IGraphLayout,
_FontWeight,
_FontSize,
ColorLike,
VBound,
circles,
check_projection,
check_colornorm,
)

def embedding(
Expand Down
3 changes: 1 addition & 2 deletions omicverse/utils/_scatterplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
from scanpy.plotting import _utils

from scanpy.plotting._utils import (
_IGraphLayout,
_FontWeight,
_FontSize,
ColorLike,
Expand Down Expand Up @@ -813,7 +812,7 @@ def diffmap(adata, **kwargs) -> Union[Axes, List[Axes], None]:
show_save_ax=doc_show_save_ax,
)
def draw_graph(
adata: AnnData, *, layout: Optional[_IGraphLayout] = None, **kwargs
adata: AnnData, *, layout = None, **kwargs
) -> Union[Axes, List[Axes], None]:
"""\
Scatter plot in graph-drawing basis.
Expand Down
3 changes: 2 additions & 1 deletion omicverse_guide/docs/Release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -471,4 +471,5 @@ Support Raw Windows platform

### Bulk Module

- Fixed the import error of `gseapy` in `bulk.geneset_enrichment`
- Fixed the import error of `gseapy` in `bulk.geneset_enrichment`
- Optimized code logic for offline enrichment analysis, added background parameter
12 changes: 11 additions & 1 deletion omicverse_guide/docs/Tutorials-bulk/t_deg.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,17 @@
"id": "477e6940-4e9a-4df3-852b-ee354e57cf9b",
"metadata": {},
"source": [
"Note that the `pvalue_type` we set to `auto`, this is because when the genesets we enrichment if too small, use the `adjusted pvalue` we can't get the correct result. So you can set `adjust` or `raw` to get the significant geneset."
"Note that the `pvalue_type` we set to `auto`, this is because when the genesets we enrichment if too small, use the `adjusted pvalue` we can't get the correct result. So you can set `adjust` or `raw` to get the significant geneset.\n",
"\n",
"If you didn't have internet, please set `background` to all genes expressed in rna-seq,like:\n",
"\n",
"```python\n",
"enr=ov.bulk.geneset_enrichment(gene_list=deg_genes,\n",
" pathways_dict=pathway_dict,\n",
" pvalue_type='auto',\n",
" background=dds.result.index.tolist(),\n",
" organism='mouse')\n",
"```"
]
},
{
Expand Down

0 comments on commit 3f6b539

Please sign in to comment.