def type(self, unit):
        """Compute the component type, ie A, C, G, U is RNA, DA, DC, etc is DNA
        and so forth.

        Parameters
        ----------
        unit : Component
            The unit to get the component for

        Returns
        -------
        component_type : str
            The component type.
        """
        return units.component_type(unit)
Beispiel #2
0
 def test_can_determine_is_rna(self):
     component = Component([], sequence='A')
     self.assertEquals('rna', units.component_type(component))
Beispiel #3
0
 def test_gives_none_otherwise(self):
     component = Component([], sequence='gtp')
     self.assertEquals(None, units.component_type(component))
Beispiel #4
0
 def test_can_determine_is_water(self):
     component = Component([], sequence='hoh')
     self.assertEquals('water', units.component_type(component))
Beispiel #5
0
 def test_can_determine_is_rna(self):
     component = Component([], sequence='A')
     self.assertEquals('rna', units.component_type(component))
Beispiel #6
0
 def test_gives_none_otherwise(self):
     component = Component([], sequence='gtp')
     self.assertEquals(None, units.component_type(component))
Beispiel #7
0
 def test_can_determine_is_water(self):
     component = Component([], sequence='hoh')
     self.assertEquals('water', units.component_type(component))