Skip to content

Commit

Permalink
add continuous value for module_trait_relationships_heatmap()
Browse files Browse the repository at this point in the history
  • Loading branch information
nargesr committed Feb 1, 2024
1 parent 1feba73 commit 3c7694d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions PyWGCNA/wgcna.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from gseapy.plot import dotplot
from pyvis.network import Network
from reactome2py import analysis
from pandas.api.types import is_numeric_dtype

from PyWGCNA.geneExp import *

Expand Down Expand Up @@ -2734,6 +2735,9 @@ def getDatTraits(self, metaData):
data = self.datExpr.obs.copy()[metaData]
datTraits = pd.DataFrame(index=data.index)
for i in range(data.shape[1]):
if is_numeric_dtype(data.iloc[:, i].dtypes):
datTraits[data.columns[i]] = data.iloc[:, i]
continue
data.iloc[:, i] = data.iloc[:, i].astype(str)
if len(np.unique(data.iloc[:, i])) == 2:
datTraits[data.columns[i]] = data.iloc[:, i]
Expand Down

0 comments on commit 3c7694d

Please sign in to comment.