Skip to content

Commit

Permalink
Move regulatory feature type from core to eukaryote schema
Browse files Browse the repository at this point in the history
  • Loading branch information
YinHoon committed Nov 28, 2018
1 parent 0d9f7ab commit e4962fb
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 13 deletions.
22 changes: 20 additions & 2 deletions tests/test_eukaryote_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,24 @@
import unittest


class TestCore(unittest.TestCase):

def test_RegulatoryElementType(self):
self.assertEqual(eukaryote_schema.RegulatoryElementType.promoter.value, 1)
self.assertEqual(eukaryote_schema.RegulatoryElementType.promoter_flanking_region.value, 2)
self.assertEqual(eukaryote_schema.RegulatoryElementType.enhancer.value, 3)
self.assertEqual(eukaryote_schema.RegulatoryElementType.CTCF_binding_site.value, 4)
self.assertEqual(eukaryote_schema.RegulatoryElementType.TF_binding_site.value, 5)
self.assertEqual(eukaryote_schema.RegulatoryElementType.open_chromatin_region.value, 6)

def test_ActivityLevel(self):
self.assertEqual(eukaryote_schema.ActivityLevel.active.value, 1)
self.assertEqual(eukaryote_schema.ActivityLevel.poised.value, 2)
self.assertEqual(eukaryote_schema.ActivityLevel.repressed.value, 3)
self.assertEqual(eukaryote_schema.ActivityLevel.inactive.value, 4)
self.assertEqual(eukaryote_schema.ActivityLevel.na.value, 5)


class CellTestCase(unittest.TestCase):
def test_constructor(self):
cell = core.Cell(taxon=9606)
Expand Down Expand Up @@ -382,12 +400,12 @@ def test_constructor(self):
class RegulatoryElementLocusTestCase(unittest.TestCase):
def test_constructor(self):
promoter = eukaryote_schema.RegulatoryElementLocus(id='p1', name='promoter1',
type=core.RegulatoryElementType.promoter,
type=eukaryote_schema.RegulatoryElementType.promoter,
activity=eukaryote_schema.ActivityLevel.active,
strand=core.PolymerStrand.positive, start=2, end=10)
self.assertEqual(promoter.id, 'p1')
self.assertEqual(promoter.name, 'promoter1')
self.assertEqual(promoter.type, core.RegulatoryElementType.promoter)
self.assertEqual(promoter.type, eukaryote_schema.RegulatoryElementType.promoter)
self.assertEqual(promoter.activity, eukaryote_schema.ActivityLevel.active)
self.assertEqual(promoter.strand, core.PolymerStrand.positive)
self.assertEqual(promoter.start, 2)
Expand Down
10 changes: 0 additions & 10 deletions wc_kb/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,6 @@ class GeneType(enum.Enum):
tRna = 3


class RegulatoryElementType(enum.Enum):
""" Type of regulatory element """
promoter = 1
promoter_flanking_region = 2
enhancer = 3
CTCF_binding_site = 4
TF_binding_site = 5
open_chromatin_region = 6


class ComplexType(enum.Enum):
""" Type of complex """
tRnaSynthClassII = 0
Expand Down
11 changes: 10 additions & 1 deletion wc_kb/eukaryote_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
#####################
# Enumeration classes

class RegulatoryElementType(enum.Enum):
""" Type of regulatory element """
promoter = 1
promoter_flanking_region = 2
enhancer = 3
CTCF_binding_site = 4
TF_binding_site = 5
open_chromatin_region = 6


class ActivityLevel(enum.Enum):
active = 1
Expand Down Expand Up @@ -81,7 +90,7 @@ class RegulatoryElementLocus(core.PolymerLocus):
Related attributes:
regulatory_modules (:obj:`list` of :obj:`RegulatoryModule`): regulatory_modules
"""
type = obj_model.EnumAttribute(core.RegulatoryElementType)
type = obj_model.EnumAttribute(RegulatoryElementType)
activity = obj_model.EnumAttribute(ActivityLevel)

class Meta(obj_model.Model.Meta):
Expand Down

0 comments on commit e4962fb

Please sign in to comment.