Skip to content

Commit

Permalink
updated build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
fratajcz committed Sep 25, 2024
1 parent 6e0fe4f commit 8b877fd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
python-version: ["3.10"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
Expand Down
28 changes: 16 additions & 12 deletions speos/tests/test_preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
from speos.utils.config import Config
from speos.tests.utils import TestSetup

import logging

logging.disable()

class GWASMapperTest(unittest.TestCase):

def setUp(self):
Expand Down Expand Up @@ -297,52 +301,52 @@ def test_single_adjacency(self):
self.assertEqual(adj[adjacencies[0]["name"]].shape[1], 242512)

def test_two_adjacencies(self):
gwasmappings = self.gwasmapper.get_mappings(tags="immune_dysregulation", fields="name")
adjacencies = self.adjacencymapper.get_mappings(tags="BioPlex", fields="name")
gwasmappings = self.gwasmapper.get_mappings(tags="dummy", fields="name")
adjacencies = self.adjacencymapper.get_mappings(tags="dummy", fields="name")

preprocessor = PreProcessor(self.config, gwasmappings, adjacencies)
X, y, adj = preprocessor.get_data()
self.assertEqual(adj["BioPlex30293T"].shape[1], 168892)
self.assertEqual(adj["BioPlex30HCT116"].shape[1], 105364)
self.assertEqual(adj["DummyUndirectedGraph"].shape[1], 12)
self.assertEqual(adj["DummyDirectedGraph"].shape[1], 6)

def test_contains_directed(self):
# only undirected
gwasmappings = self.gwasmapper.get_mappings(tags="immune_dysregulation", fields="name")
adjacencies = self.adjacencymapper.get_mappings(tags="BioPlex", fields="name")
gwasmappings = self.gwasmapper.get_mappings(tags="dummy", fields="name")
adjacencies = self.adjacencymapper.get_mappings(tags="DummyUndirectedGraph", fields="name")

preprocessor = PreProcessor(self.config, gwasmappings, adjacencies)

self.assertFalse(preprocessor.contains_directed_graphs())

# only directed
adjacencies = self.adjacencymapper.get_mappings(tags="hetionet_regulates", fields="name")
adjacencies = self.adjacencymapper.get_mappings(tags="DummyDirectedGraph", fields="name")

preprocessor = PreProcessor(self.config, gwasmappings, adjacencies)
self.assertTrue(preprocessor.contains_directed_graphs())

# undirected and directed
adjacencies = self.adjacencymapper.get_mappings(tags=["hetionet_regulates", "BioPlex"], fields="name")
adjacencies = self.adjacencymapper.get_mappings(tags=["dummy"], fields="name")

preprocessor = PreProcessor(self.config, gwasmappings, adjacencies)
self.assertTrue(preprocessor.contains_directed_graphs())

def test_contains_only_directed(self):
# only undirected
gwasmappings = self.gwasmapper.get_mappings(tags="immune_dysregulation", fields="name")
adjacencies = self.adjacencymapper.get_mappings(tags="BioPlex", fields="name")
gwasmappings = self.gwasmapper.get_mappings(tags="dummy", fields="name")
adjacencies = self.adjacencymapper.get_mappings(tags="DummyUndirectedGraph", fields="name")

preprocessor = PreProcessor(self.config, gwasmappings, adjacencies)

self.assertFalse(preprocessor.contains_only_directed_graphs())

# only directed
adjacencies = self.adjacencymapper.get_mappings(tags="hetionet_regulates", fields="name")
adjacencies = self.adjacencymapper.get_mappings(tags="DummyDirectedGraph", fields="name")

preprocessor = PreProcessor(self.config, gwasmappings, adjacencies)
self.assertTrue(preprocessor.contains_only_directed_graphs())

# undirected and directed
adjacencies = self.adjacencymapper.get_mappings(tags=["hetionet_regulates", "BioPlex"], fields="name")
adjacencies = self.adjacencymapper.get_mappings(tags=["dummy"], fields="name")

preprocessor = PreProcessor(self.config, gwasmappings, adjacencies)
self.assertFalse(preprocessor.contains_only_directed_graphs())
Expand Down

0 comments on commit 8b877fd

Please sign in to comment.