From 2fabc5dbf3093742d4eb044bb2ce02c7148ac36c Mon Sep 17 00:00:00 2001 From: lcmmichielsen Date: Tue, 20 Jul 2021 10:53:56 +0200 Subject: [PATCH] Remove pandas --- .gitignore | 1 + scHPL/learn.py | 7 +++++-- scHPL/update.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0c8d8d6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.spyproject/ diff --git a/scHPL/learn.py b/scHPL/learn.py index e005fcf..f76a2bb 100644 --- a/scHPL/learn.py +++ b/scHPL/learn.py @@ -90,9 +90,12 @@ def learn_tree(data: anndata, labels_1 = labels[idx_1] data_1 = xx[idx_1] + print('Starting tree:') + print_tree(tree) + for b in batch_order: - print('Adding dataset', str(b), 'to the tree') + print('\nAdding dataset', str(b), 'to the tree') idx_2 = np.where(batches == b)[0] data_2 = xx[idx_2] @@ -121,7 +124,7 @@ def learn_tree(data: anndata, return_missing = return_missing) missing_pop.extend(mis_pop) - print('Updated tree:') + print('\nUpdated tree:') print_tree(tree) #concatenate the two datasets diff --git a/scHPL/update.py b/scHPL/update.py index 8441179..9d6c07a 100644 --- a/scHPL/update.py +++ b/scHPL/update.py @@ -151,7 +151,7 @@ def _match_trees(X, tree, y_true, pop2): # scan binary matrix binary, y_true, pop2 = _scan_binary(binary, name_root1, name_root2, y_true, tree, pop2) - strict.iloc[binary.values == False] = False + strict.values[binary.values == False] = False # scan strict matrix if needed if (np.any(strict)):