本文整理汇总了Python中RNA.gmlRNA方法的典型用法代码示例。如果您正苦于以下问题:Python RNA.gmlRNA方法的具体用法?Python RNA.gmlRNA怎么用?Python RNA.gmlRNA使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RNA
的用法示例。
在下文中一共展示了RNA.gmlRNA方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: import RNA [as 别名]
# 或者: from RNA import gmlRNA [as 别名]
def main(argv):
ArgumentDic = CmdParser(argv)
if ArgumentDic["all"]:
# necessary to allow the Traceback to finish without reaching the recursionlimit
# only needed for calculating all possible structures
resource.setrlimit(resource.RLIMIT_STACK, (2**29,-1))
sys.setrecursionlimit(10**6)
s, m = InputParser(ArgumentDic["FastaFile"])
m = Nussinov(s, m)
# this catches sequences with no secondary structure
if m[0][len(s) - 1] == 0:
print
print " Your Sequence has no computable secondary structure."
print
else:
if ArgumentDic["all"]:
p, n = cTraceBack(s, m)
else:
p, n = TraceBack(s, m)
print
print " This sequence has a maximum of " + str(n) + " base pairs."
print
print s
R = PosSecStruc(p, n)
for res in R:
basepairseq = ""
for _ in range(len(s)):
basepairseq +="."
for pair in res:
bps = basepairseq[:pair[0]] + "(" + basepairseq[pair[0] + 1: pair[1]] + ")" + basepairseq[pair[1] + 1:]
basepairseq = bps
print basepairseq
print
if ArgumentDic["graphic"] == True:
RNA.gmlRNA(s, basepairseq, "Nussinov.gml", "A")
g = igraph.read("Nussinov.gml")
layout = g.layout("kk")
igraph.plot(g, layout = layout)