Skip to content

Commit 1210665

Browse files
committed
fix bug for oncoprint
1 parent 42cd53e commit 1210665

File tree

3 files changed

+61
-18
lines changed

3 files changed

+61
-18
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@
66
/notebooks/.ipynb_checkpoints/
77
/notebooks/*.pdf
88
/dist/
9+
data/data.pkl
10+
notebooks/oncoPrint3.ipynb

PyComplexHeatmap/oncoPrint.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def oncoprint(
2626
colors=None,
2727
cmap="Set1",
2828
nvar=None,
29+
fillna=None,
2930
aspect=None,
3031
bgcolor="whitesmoke",
3132
row_gap=1,
@@ -234,6 +235,9 @@ def format_data(self, data, mask=None, z_score=None, standard_scale=None):
234235
)
235236
self.col_vc = data2d.apply(lambda x: x.apply(np.array).sum(), axis=0).T
236237
self.col_vc.columns = self.values
238+
# fillna
239+
na_value=[0] * len(self.values)
240+
data2d=data2d.applymap(lambda x:na_value if not isinstance(x,list) else x)
237241
if self.colors is None:
238242
self.colors = [get_colormap(self.cmap)(i) for i in range(len(self.values))]
239243
self.color_dict = {}

notebooks/oncoPrint.ipynb

Lines changed: 55 additions & 18 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)