Skip to content

Commit 304ef9b

Browse files
committed
suppress pandas performance warning for scanpy
1 parent 6fea57f commit 304ef9b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

snp2cell/snp2cell_class.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from pathlib import Path
1111
from enum import Enum
1212
from typing import Literal, Union, Optional, Any, Iterable, Dict, List, Tuple
13+
import warnings
1314

1415
import dill
1516
import matplotlib as mpl
@@ -862,7 +863,11 @@ def adata_add_de_scores(
862863
kwargs["rankby_abs"] = True
863864

864865
log.info(f"finding DE genes for annotation {groupby}")
865-
sc.tl.rank_genes_groups(self.adata, groupby=groupby, **kwargs)
866+
with warnings.catch_warnings():
867+
warnings.simplefilter(
868+
action="ignore", category=pd.errors.PerformanceWarning
869+
)
870+
sc.tl.rank_genes_groups(self.adata, groupby=groupby, **kwargs)
866871

867872
if "method" in kwargs and kwargs["method"] == "logreg":
868873
de_df = get_rank_df(self.adata)

0 commit comments

Comments
 (0)