Skip to content

Commit

Permalink
removed cytoscape tests
Browse files Browse the repository at this point in the history
  • Loading branch information
haeussma committed May 22, 2024
1 parent 540ca68 commit a3ed6eb
Showing 1 changed file with 3 additions and 38 deletions.
41 changes: 3 additions & 38 deletions tests/unit/network_tests/test_newtork_graph_build.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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",
Expand All @@ -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)

0 comments on commit a3ed6eb

Please sign in to comment.