コード例 #1
0
class MultiStructureConnectTest(unittest.TestCase):
    def setUp(self):
        connect = open('files/simple_connect.ct', 'r')
        self.parser = Parser(connect)
        connect.close()
        self.loops = self.parser.indices()

    def test_parses_first_only(self):
        ans = [([9, 10, 11, 12, 13, 14, 15, 16],)]
        self.assertEqual(self.loops['hairpin'], ans)
コード例 #2
0
class MultiStructureConnectTest(unittest.TestCase):
    def setUp(self):
        connect = open('files/simple_connect.ct', 'r')
        self.parser = Parser(connect)
        connect.close()
        self.loops = self.parser.indices()

    def test_parses_first_only(self):
        ans = [([9, 10, 11, 12, 13, 14, 15, 16], )]
        self.assertEqual(self.loops['hairpin'], ans)
コード例 #3
0
class Result(object):
    def __init__(self, name):
        self._name = name + ".%s"
        self.parser = Connect(self.connect_file())
        self.sequence = self.parser.sequence

    def connect_file(self):
        with self.__file__('ct') as f:
            return f.readlines()

    def indices(self, flanking=False):
        return self.parser.indices(flanking=flanking)

    def loops(self, flanking=False):
        return self.parser.loops(self.sequence, flanking=flanking)

    def __file__(self, extension):
        ext_file = self._name % extension
        return open(ext_file, 'r')
コード例 #4
0
ファイル: fold.py プロジェクト: BGSU-RNA/RNA-Structure-utils
class Result(object):
    def __init__(self, name):
        self._name = name + ".%s"
        self.parser = Connect(self.connect_file())
        self.sequence = self.parser.sequence

    def connect_file(self):
        with self.__file__('ct') as f:
            return f.readlines()

    def indices(self, flanking=False):
        return self.parser.indices(flanking=flanking)

    def loops(self, flanking=False):
        return self.parser.loops(self.sequence, flanking=flanking)

    def __file__(self, extension):
        ext_file = self._name % extension
        return open(ext_file, 'r')
コード例 #5
0
 def test_roundtrip(self):
     lines = StringIO(self.connect)
     parser = Parser(lines)
     val = parser.indices()['hairpin']
     ans = [([2, 3],)]
     self.assertEqual(val, ans)
コード例 #6
0
 def setUp(self):
     connect = open('files/simple_connect.ct', 'r')
     self.parser = Parser(connect)
     connect.close()
     self.loops = self.parser.indices()
コード例 #7
0
 def test_roundtrip(self):
     lines = StringIO(self.connect)
     parser = Parser(lines)
     val = parser.indices()['hairpin']
     ans = [([2, 3], )]
     self.assertEqual(val, ans)
コード例 #8
0
 def setUp(self):
     connect = open('files/simple_connect.ct', 'r')
     self.parser = Parser(connect)
     connect.close()
     self.loops = self.parser.indices()
コード例 #9
0
 def __init__(self, name):
     self._name = name + ".%s"
     self.parser = Connect(self.connect_file())
     self.sequence = self.parser.sequence
コード例 #10
0
ファイル: fold.py プロジェクト: BGSU-RNA/RNA-Structure-utils
 def __init__(self, name):
     self._name = name + ".%s"
     self.parser = Connect(self.connect_file())
     self.sequence = self.parser.sequence