def test_blast_space(self): """ Test that setting the lineage name gives the blast cell. """ c = Cell(name="carrots") c.lineageName("a tahsuetoahusenoatu") self.assertEqual(c.blast(), "a")
def test_blast_dot(self): """ Test that setting the lineage name gives the blast cell. """ c = Cell(name="peas") c.lineageName("ab.tahsuetoahusenoatu") self.assertEqual(c.blast(), "ab")
def __init__(self, name=False, **kwargs): Cell.__init__(self, name=name, **kwargs) self.innervatedBy = Muscle.ObjectProperty("neurons", owner=self, value_type=P.Neuron, multiple=True) Muscle.DatatypeProperty("receptors", owner=self, multiple=True)
def __init__(self, name=False, **kwargs): Cell.__init__(self,name=name,**kwargs) # Get neurons connected to this neuron Neighbor(owner=self) # Get connections from this neuron Connection(owner=self) Neuron.DatatypeProperty("type",self, multiple=True) Neuron.DatatypeProperty("receptor", self, multiple=True) Neuron.DatatypeProperty("innexin", self, multiple=True) Neuron.DatatypeProperty("neurotransmitter", self, multiple=True) Neuron.DatatypeProperty("neuropeptide", self, multiple=True) ### Aliases ### self.get_neighbors = self.neighbor self.receptors = self.receptor
def test_synonyms(self): """ Test that we can add and retrieve synonyms. """ c = Cell(name="ADAL", conf=self.config) c.synonym("lineage name: ABplapaaaapp") c.save() self.assertEqual(set(["lineage name: ABplapaaaapp"]), Cell(name="ADAL").synonym())
def test_same_name_same_id(self): """ Test that two Cell objects with the same name have the same identifier() Saves us from having too many inserts of the same object. """ c = Cell(name="boots") c1 = Cell(name="boots") self.assertEqual(c.identifier(), c1.identifier())
def test_loading_cells_retrieves_all_cells(self): """ Test that retrieving all Cells gives us the right number of Cell objects. """ num_cells = len(list(Cell().load())) m = list(Muscle().load()) num_muscles = len(m) n = list(Neuron().load()) num_neurons = len(n) sum_cells = num_neurons + num_muscles self.assertEqual(sum_cells, num_cells)
def test_parentOf(self): """ Test that we can get the children of a cell Tests for anterior, posterior, left, right, ventral, dorsal divisions """ p = Cell(name="peas") base = 'ab.tahsuetoahusenoat' p.lineageName(base) p.save() c = ["carrots", "jam", "peanuts", "celery", "tuna", "chicken"] division_directions = "alvpdr" for x, l in zip(c, division_directions): ln = base + l Cell(name=x, lineageName=ln).save() names = set(str(x.name()) for x in p.parentOf()) self.assertEqual(set(c), names)
def test_daughterOf(self): """ Test that we can get the parent of a cell """ base = "ab.tahsuetoahusenoat" child = base + "u" p = Cell(name="peas") p.lineageName(base) p.save() c = Cell(name="carrots") c.lineageName(child) c.save() parent_p = c.daughterOf().name() self.assertEqual("peas", parent_p)
def test_wormbaseID(self): """ Test that a Cell object has a wormbase ID """ c = Cell(name="ADAL", conf=self.config) c.wormbaseID("WBbt:0004013") c.save() self.assertEqual("WBbt:0004013", Cell(name="ADAL").wormbaseID())
def test_lineageName(self): """ Test that we can retrieve the lineage name """ c = Cell(name="ADAL", conf=self.config) c.lineageName("AB plapaaaapp") c.save() self.assertEqual("AB plapaaaapp", Cell(name="ADAL").lineageName())
def test_DataUser(self): do = Cell('', conf=self.config) self.assertTrue(isinstance(do, DataUser))
def test_str(self): self.assertEqual('cell_name', str(Cell('cell_name')))
def test_morphology_is_NeuroML_morphology(self): """ Check that the morphology is the kind made by neuroml """ c = Cell(name="ADAR", conf=self.config) # get the morph m = c.morphology() self.assertIsInstance(m, neuroml.Morphology)
def __init__(self, name=False, **kwargs): Cell.__init__(self, name=name, **kwargs) self.innervatedBy = Muscle.ObjectProperty("neurons",owner=self,value_type=P.Neuron, multiple=True) Muscle.DatatypeProperty("receptors",owner=self,multiple=True)