Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: BGSU-RNA/RNA-Structure-utils
base: c6f19732f2
...
head fork: BGSU-RNA/RNA-Structure-utils
compare: 6e4546cdc3
  • 3 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
View
5 rnastructure/secondary/basic.py
@@ -44,7 +44,7 @@ def __find_loops(self, node):
for child in node.children:
self.__find_loops(child)
- def parse(self, sequence):
+ def parse(self, sequence, flanking=False):
if len(self) != len(sequence):
msg = "Sequence has wrong size, given '%s' expected '%s'"
raise ValueError(msg % (len(sequence), len(self)))
@@ -55,7 +55,8 @@ def seq(parts, join_str='*'):
return join_str.join(map(lambda p: sequence[p], parts))
ranges = {}
- for name, total in self._loops.iteritems():
+ loops = self.loops(flanking=flanking)
+ for name, total in loops.iteritems():
ranges[name] = []
for positions in total:
char = '*'
View
2  setup.py
@@ -2,7 +2,7 @@
setup(
name='RNAStructure',
- version='0.0.5',
+ version='0.0.6',
author='Blake A. Sweeney',
author_email='bsweene@bgsu.edu',
packages=['rnastructure'],
View
11 test/secondary/basic_test.py
@@ -6,6 +6,7 @@
class SimpleLoopTest(unittest.TestCase):
def setUp(self):
self.pairs = [None, None, 6, 5, None, 3, 2]
+ self.sequence = 'aacugcc'
self.parser = Parser(self.pairs)
self.loops = self.parser.loops()
self.flanking = self.parser.loops(flanking=True)
@@ -14,10 +15,20 @@ def test_hairpins(self):
ans = [tuple([[4]])]
self.assertEqual(self.loops['hairpin'], ans)
+ def test_hairpin_sequences(self):
+ ans = ['g']
+ val = self.parser.parse(self.sequence)
+ self.assertEqual(val['hairpin'], ans)
+
def test_flanking_hairpins(self):
ans = [tuple([[3, 4, 5]])]
self.assertEqual(self.flanking['hairpin'], ans)
+ def test_hairpin_flanking_sequences(self):
+ ans = ['ugc']
+ val = self.parser.parse(self.sequence, flanking=True)
+ self.assertEqual(val['hairpin'], ans)
+
class MultiLoopTest(unittest.TestCase):
def setUp(self):

No commit comments for this range

Something went wrong with that request. Please try again.