Skip to content

Commit 21916f7

Browse files
committed
Major refactor
1 parent 55cc5e0 commit 21916f7

3 files changed

Lines changed: 18 additions & 18 deletions

File tree

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The following command will run a diffusion method on a given network with the gi
4343

4444
.. code-block:: sh
4545
46-
$ python3 -m diffupy diffuse --network=<path-to-network-file> --input=<path-to-data-file> --method=<method>
46+
$ python3 -m diffupy diffuse --network=<path-to-network-file> --data=<path-to-data-file> --method=<method>
4747
4848
4949
2. **Generate a kernel with one of the seven methods implemented**

src/diffupy/cli.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def kernel(
8383
type=click.Path(exists=True, dir_okay=False)
8484
)
8585
@click.option(
86-
'-i', '--input',
86+
'-i', '--data',
8787
help='Input data',
8888
required=True,
8989
type=click.Path(exists=True, dir_okay=False)
@@ -131,7 +131,7 @@ def kernel(
131131
)
132132
def diffuse(
133133
network: str,
134-
input: str,
134+
data: str,
135135
output: str,
136136
method: str,
137137
binarize: bool,
@@ -150,9 +150,9 @@ def diffuse(
150150
f'{EMOJI}'
151151
)
152152

153-
click.secho(f'Codifying data from {input}.')
153+
click.secho(f'Codifying data from {data}.')
154154

155-
input_scores_dict = process_input(input, method, binarize, absolute_value, p_value, threshold)
155+
input_scores_dict = process_input(data, method, binarize, absolute_value, p_value, threshold)
156156

157157
click.secho(f'Running the diffusion algorithm.')
158158

tests/test_input.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,95 +19,95 @@ class ValidateTest(unittest.TestCase):
1919
"""Test validation of results."""
2020

2121
def test_quantitative_bin_id(self):
22-
"""Test codify input for quantitative scoring methods- only entity IDs given (binary labels)."""
22+
"""Test codify label_input for quantitative scoring methods- only entity IDs given (binary labels)."""
2323
input = NODE_TEST_PATH
2424
input_labels_dict = process_input(
2525
input, method=RAW, binning=True, absolute_value=True, p_value=0.05, threshold=None,
2626
)
2727
self.assertEqual(input_labels_dict, {'A': 1, 'B': 1, 'C': 1, 'D': 1, 'E': 1})
2828

2929
def test_quantitative_bin_fc_sign(self):
30-
"""Test codify input for quantitative scoring methods- logFC given (binary, signed labels)."""
30+
"""Test codify label_input for quantitative scoring methods- logFC given (binary, signed labels)."""
3131
input = NODE_LOGFC_TEST_PATH
3232
input_labels_dict = process_input(
3333
input, method=RAW, binning=True, absolute_value=False, p_value=0.05, threshold=0.5,
3434
)
3535
self.assertEqual(input_labels_dict, {'A': 1, 'B': 1, 'C': 0, 'D': 0, 'E': -1})
3636

3737
def test_quantitative_bin_fc_abs(self):
38-
"""Test codify input for quantitative scoring methods- logFC given (binary, absolute values)."""
38+
"""Test codify label_input for quantitative scoring methods- logFC given (binary, absolute values)."""
3939
input = NODE_LOGFC_TEST_PATH
4040
input_labels_dict = process_input(
4141
input, method=RAW, binning=True, absolute_value=True, p_value=0.05, threshold=0.5,
4242
)
4343
self.assertEqual(input_labels_dict, {'A': 1, 'B': 1, 'C': 0, 'D': 0, 'E': 1})
4444

4545
def test_quantitative_bin_fcp_sign(self):
46-
"""Test codify input for quantitative scoring methods- logFC and adj. p-value given (binary, signed labels)."""
46+
"""Test codify label_input for quantitative scoring methods- logFC and adj. p-value given (binary, signed labels)."""
4747
input = NODE_LOGFC_PVAL_TEST_PATH
4848
input_labels_dict = process_input(
4949
input, method=RAW, binning=True, absolute_value=False, p_value=0.05, threshold=0.5,
5050
)
5151
self.assertEqual(input_labels_dict, {'A': 0, 'B': 1, 'C': 0, 'D': 0, 'E': -1})
5252

5353
def test_quantitative_bin_fcp_abs(self):
54-
"""Test codify input for quant. scoring methods- logFC and adj. p-value given (binary, absolute values)."""
54+
"""Test codify label_input for quant. scoring methods- logFC and adj. p-value given (binary, absolute values)."""
5555
input = NODE_LOGFC_PVAL_TEST_PATH
5656
input_labels_dict = process_input(
5757
input, method=RAW, binning=True, absolute_value=True, p_value=0.05, threshold=0.5,
5858
)
5959
self.assertEqual(input_labels_dict, {'A': 0, 'B': 1, 'C': 0, 'D': 0, 'E': 1})
6060

6161
def test_quantitative_fc_sign(self):
62-
"""Test codify input for quantitative scoring methods- logFC given (quantitative, signed labels)."""
62+
"""Test codify label_input for quantitative scoring methods- logFC given (quantitative, signed labels)."""
6363
input = NODE_LOGFC_TEST_PATH
6464
input_labels_dict = process_input(
6565
input, method=RAW, binning=False, absolute_value=False, p_value=0.05, threshold=0.5,
6666
)
6767
self.assertEqual(input_labels_dict, {'A': 0.7, 'B': 1.2, 'C': 0, 'D': 0, 'E': -2.2})
6868

6969
def test_quantitative_fc_abs(self):
70-
"""Test codify input for quantitative scoring methods- logFC given (quant., absolute values)."""
70+
"""Test codify label_input for quantitative scoring methods- logFC given (quant., absolute values)."""
7171
input = NODE_LOGFC_TEST_PATH
7272
input_labels_dict = process_input(
7373
input, method=RAW, binning=False, absolute_value=True, p_value=0.05, threshold=0.5,
7474
)
7575
self.assertEqual(input_labels_dict, {'A': 0.7, 'B': 1.2, 'C': 0, 'D': 0, 'E': 2.2})
7676

7777
def test_quantitative_fcp_sign(self):
78-
"""Test codify input for quantitative scoring methods- logFC and adj. p-value given (quant., signed labels)."""
78+
"""Test codify label_input for quantitative scoring methods- logFC and adj. p-value given (quant., signed labels)."""
7979
input = NODE_LOGFC_PVAL_TEST_PATH
8080
input_labels_dict = process_input(
8181
input, method=RAW, binning=False, absolute_value=False, p_value=0.05, threshold=0.5,
8282
)
8383
self.assertEqual(input_labels_dict, {'A': 0, 'B': 1.2, 'C': 0, 'D': 0, 'E': -2.2})
8484

8585
def test_quantitative_fcp_abs(self):
86-
"""Test codify input for quant. scoring methods- logFC and adj. p-value given (quant., absolute values)."""
86+
"""Test codify label_input for quant. scoring methods- logFC and adj. p-value given (quant., absolute values)."""
8787
input = NODE_LOGFC_PVAL_TEST_PATH
8888
input_labels_dict = process_input(
8989
input, method=RAW, binning=False, absolute_value=True, p_value=0.05, threshold=0.5,
9090
)
9191
self.assertEqual(input_labels_dict, {'A': 0, 'B': 1.2, 'C': 0, 'D': 0, 'E': 2.2})
9292

9393
def test_non_quantitative_bin_id(self):
94-
"""Test codify input for non-quantitative scoring methods- only entity IDs given (binary labels)."""
94+
"""Test codify label_input for non-quantitative scoring methods- only entity IDs given (binary labels)."""
9595
input = NODE_TEST_PATH
9696
input_labels_dict = process_input(
9797
input, method=ML, binning=True, absolute_value=True, p_value=0.05, threshold=None,
9898
)
9999
self.assertEqual(input_labels_dict, {'A': 1, 'B': 1, 'C': 1, 'D': 1, 'E': 1})
100100

101101
def test_non_quantitative_bin_fc_abs(self):
102-
"""Test codify input for non-quantitative scoring methods- logFC given (binary, absolute values (sign))."""
102+
"""Test codify label_input for non-quantitative scoring methods- logFC given (binary, absolute values (sign))."""
103103
input = NODE_LOGFC_TEST_PATH
104104
input_labels_dict = process_input(
105105
input, method=ML, binning=True, absolute_value=True, p_value=0.05, threshold=0.5,
106106
)
107107
self.assertEqual(input_labels_dict, {'A': 1, 'B': 1, 'C': -1, 'D': -1, 'E': 1})
108108

109109
def test_non_quantitative_bin_fcp_abs(self):
110-
"""Test codify input for non-quant. scoring methods- logFC and adj. p-value given (binary, absolute values)."""
110+
"""Test codify label_input for non-quant. scoring methods- logFC and adj. p-value given (binary, absolute values)."""
111111
input = NODE_LOGFC_PVAL_TEST_PATH
112112
input_labels_dict = process_input(
113113
input, method=ML, binning=True, absolute_value=True, p_value=0.05, threshold=0.5,
@@ -135,7 +135,7 @@ def test_network(self):
135135
})
136136

137137
def test_node_mapping(self):
138-
"""Test mapping of nodes in input to nodes in network"""
138+
"""Test mapping of nodes in label_input to nodes in network"""
139139

140140
input = NODE_LOGFC_TEST_PATH
141141
input_labels_dict = process_input(

0 commit comments

Comments
 (0)