コード例 #1
0
    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)
コード例 #2
0
 def test_can_determine_is_rna(self):
     component = Component([], sequence='A')
     self.assertEquals('rna', units.component_type(component))
コード例 #3
0
 def test_gives_none_otherwise(self):
     component = Component([], sequence='gtp')
     self.assertEquals(None, units.component_type(component))
コード例 #4
0
 def test_can_determine_is_water(self):
     component = Component([], sequence='hoh')
     self.assertEquals('water', units.component_type(component))
コード例 #5
0
 def test_can_determine_is_rna(self):
     component = Component([], sequence='A')
     self.assertEquals('rna', units.component_type(component))
コード例 #6
0
 def test_gives_none_otherwise(self):
     component = Component([], sequence='gtp')
     self.assertEquals(None, units.component_type(component))
コード例 #7
0
 def test_can_determine_is_water(self):
     component = Component([], sequence='hoh')
     self.assertEquals('water', units.component_type(component))