Rosalind第65题:Wobble Bonding and RNA Secondary Structures

Problem

Figure 1. A valid matching of basepair edges in the bonding graph of an RNA string, followed by a diagram of how this bonding will induce the resulting folded RNA.

图1 RNA串键图中的碱基对边缘的有效匹配,然后是该键将如何诱导所得折叠RNA的示意图。

Figure 2. All 12 possible valid basepair matchings in the bonding graph corresponding to the string s = CGAUGCUAG (including the trivial matching in which no edges are matched.) Courtesy Brian Tjaden.

图2 绑定图中与字符串s = CGAUGCUAG对应的所有12个可能有效的碱基对匹配(包括无边匹配的琐碎匹配)。由Brian Tjaden提供。

Given an RNA string , we will augment the bonding graph of  by adding basepair edges connecting all occurrences of 'U' to all occurrences of 'G' in order to represent possible wobble base pairs.

We say that a matching in the bonding graph for  is valid if it is noncrossing (to prevent pseudoknots) and has the property that a basepair edge in the matching cannot connect symbols  and  unless  (to prevent nearby nucleotides from base pairing).

See Figure 1 for an example of a valid matching if we allow wobble base pairs. In this problem, we will wish to count all possible valid matchings in a given bonding graph; see Figure 2 for all possible valid matchings in a small bonding graph, assuming that we allow wobble base pairing.

Given: An RNA string  (of length at most 200 bp).

Return: The total number of distinct valid matchings of basepair edges in the bonding graph of . Assume that wobble base pairing is allowed.

给定一个RNA串 中,我们将增加的接合图表的通过添加 将所有“ U”出现与所有“ G”出现连接的碱基对边来表示可能的摆动碱基对。

我们说绑定图中的匹配 如果它是非 交叉的(以防止伪结),并且具有匹配项中的碱基对边不能连接符号的属性,则有效 和  除非  (以防止附近的核苷酸与碱基配对)。

如果允许摆动碱基对,请参见图1所示的有效匹配示例。在这个问题中,我们希望在给定的键合图中计算所有可能的有效匹配。 假设我们允许摆动碱基配对,请参见图2以了解小绑定图中所有可能的有效匹配。

给定: RNA字符串(最大长度为200 bp)。

返回值:的键合图中碱基对边的不同有效匹配的总数。假设允许摆动碱基配对。

Sample Dataset

AUGCUAGUACGGAGCGAGUCUAGCGAGCGAUGUCGUGAGUACUAUAUAUGCGCAUAAGCCACGU

Sample Output

284850219977421
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值