Exemplo n.º 1
0
 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())
Exemplo n.º 2
0
 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())
Exemplo n.º 3
0
 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)
Exemplo n.º 4
0
 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")
Exemplo n.º 5
0
 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")
Exemplo n.º 6
0
    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)
Exemplo n.º 7
0
    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)
Exemplo n.º 8
0
 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())
Exemplo n.º 9
0
 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())
Exemplo n.º 10
0
 def test_DataUser(self):
     do = Cell('', conf=self.config)
     self.assertTrue(isinstance(do, DataUser))
Exemplo n.º 11
0
 def test_str(self):
     self.assertEqual('cell_name', str(Cell('cell_name')))
Exemplo n.º 12
0
 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)