diff --git a/tests/unit/network_tests/test_newtork_graph_build.py b/tests/unit/network_tests/test_newtork_graph_build.py index a77c2e2b..92d94449 100644 --- a/tests/unit/network_tests/test_newtork_graph_build.py +++ b/tests/unit/network_tests/test_newtork_graph_build.py @@ -1,12 +1,8 @@ -import json - -import pytest - from pyeed.core import ProteinRecord from pyeed.network import SequenceNetwork -class TestNetworkGraphBuild: +class TestNetworkGraphBuild: def test_general_build_networkx(self): # check if it can be created and does the basic job # Accessions from different methionine adenyltransferases @@ -22,39 +18,13 @@ def test_general_build_networkx(self): ] mats = ProteinRecord.get_ids(mat_accessions) # Create a network - network = SequenceNetwork( - sequences=mats, - weight="identity", - dimensions=2, - ) - - def test_graph_build(self): - - mat_accessions = [ - "MBP1912539.1", - "SEV92896.1", - "MBO8174569.1", - "WP_042680787.1", - ] - mats = ProteinRecord.get_ids(mat_accessions) - # Create a network network = SequenceNetwork( sequences=mats, weight="identity", dimensions=2, ) - threshhold = 0.85 - # now create a cytoscape graph - network.create_cytoscape_graph(collection="tests", title="test_cytoscape", threshold=threshhold) - # check if each degree is correct - # it shoudl be at 1 - assert network.network.nodes["MBP1912539.1"]["degree_with_threshold_{}".format(threshhold)] == 1 - assert network.network.nodes["SEV92896.1"]["degree_with_threshold_{}".format(threshhold)] == 1 - assert network.network.nodes["MBO8174569.1"]["degree_with_threshold_{}".format(threshhold)] == 1 - assert network.network.nodes["WP_042680787.1"]["degree_with_threshold_{}".format(threshhold)] == 1 - - def test_cytoscape_nodes_size(self): + def test_graph_build(self): mat_accessions = [ "MBP1912539.1", "SEV92896.1", @@ -66,10 +36,5 @@ def test_cytoscape_nodes_size(self): network = SequenceNetwork( sequences=mats, weight="identity", - dimensions=2, ) - threshhold = 0.85 - # now create a cytoscape graph - network.create_cytoscape_graph(collection="tests", title="test_cytoscape", threshold=threshhold) - network.set_nodes_size(column_name="degree_with_threshold_{}".format(threshhold), min_size=20, max_size=100) - network.color_nodes(column_name='species') + assert len(list(network.network.nodes)) == len(mats)