本文整理汇总了Python中RNA.md方法的典型用法代码示例。如果您正苦于以下问题:Python RNA.md方法的具体用法?Python RNA.md怎么用?Python RNA.md使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RNA
的用法示例。
在下文中一共展示了RNA.md方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: temperature_reactivity
# 需要导入模块: import RNA [as 别名]
# 或者: from RNA import md [as 别名]
def temperature_reactivity( sequence, structure, temperature1, temperature2 ):
"""Evaluate temperature-dependent difference in energy, entropy, enthalpy."""
temperature_model1 = RNA.md()
temperature_model2 = RNA.md()
temperature_model1.temperature = temperature1
temperature_model2.temperature = temperature2
fc1 = RNA.fold_compound(sequence, temperature_model1)
fc2 = RNA.fold_compound(sequence, temperature_model2)
energy_of_struct1 = fc1.eval_structure(structure)
energy_of_struct2 = fc2.eval_structure(structure)
# normalize delta_energy, add 0.001 to prevent division by 0
delta_energy = abs((energy_of_struct2 - energy_of_struct1) / (energy_of_struct2 + 0.001))
return (delta_energy, energy_of_struct1, energy_of_struct2)
示例2: main
# 需要导入模块: import RNA [as 别名]
# 或者: from RNA import md [as 别名]
#.........这里部分代码省略.........
# Compare --minh, --min-rate, --t8 and --tX :
if args.verbose:
dG_min = -_RT * math.log(1 / args.t_fast / args.k0)
print('# --t-fast: {} s => {} kcal/mol barrier height and {} /s rate at k0 = {}'.format(
args.t_fast, dG_min, 1/args.t_fast, args.k0))
if args.t_slow is not None:
dG_max = -_RT * math.log(1 / args.t_slow / args.k0)
print('# --t-slow {} s => {} kcal/mol barrier height and {} /s rate at k0 = {}'.format(
args.t_slow, dG_max, 1/args.t_slow, args.k0))
if args.t_fast * 10 > args.t_ext:
raise Exception("""Conflicting Settings: rate for equilibration must be
much faster than for nucleotide extension.""")
if args.t_slow is not None and args.t_end * 100 > args.t_slow:
raise Exception("""Conflicting Settings: 1/--min-rate should be much
longer than the simulation time --t_end.""")
try:
check_version(args.treekin, ril._MIN_TREEKIN_VERSION)
except ExecError:
pass
def versiontuple(rv):
return tuple(map(int, (rv.split("."))))
if versiontuple(RNA.__version__) < versiontuple(ril._MIN_VIENNARNA_VERSION):
raise VersionError('ViennaRNA', RNA.__version__, ril._MIN_VIENNARNA_VERSION)
############################
# Start with DrTransformer #
############################
# Set model details.
vrna_md = RNA.md()
vrna_md.noLP = 1
vrna_md.temperature = args.temperature
if args.pyplot:
all_courses = []
# Write logging output
if args.stdout == 'log' or lfh:
fdata = "# File generated using DrTransformer v{}\n".format(ril.__version__)
fdata += "#\n"
fdata += "# >{}\n# {} \n".format(name, fullseq)
fdata += "#\n"
fdata += "# Co-transcriptional folding paramters:\n"
fdata += "# --t-ext: {} sec\n".format(args.t_ext)
fdata += "# --t-end: {} sec\n".format(args.t_end)
fdata += "# --temperature: {} C\n".format(args.temperature)
fdata += "# --start: {}\n".format(args.start)
fdata += "# --stop: {}\n".format(args.stop)
fdata += "#\n"
fdata += "# Algorithm paramters:\n"
fdata += "# --min-occupancy: {}\n".format(args.min_occupancy)
fdata += "# --t-fast: {} sec\n".format(args.t_fast)
fdata += "# --t-slow: {} sec\n".format(args.t_slow)
fdata += "# --findpath-search-width: {}\n".format(args.findpath_search_width)
fdata += "# --structure-search-mode: {}\n".format(args.structure_search_mode)
fdata += "# --min-breathing: {} nuc\n".format(args.min_breathing)
fdata += "# --detailed-pruning: {}\n".format(args.detailed_pruning)
fdata += "# --k0: {}\n".format(args.k0)
fdata += "#\n"
fdata += "#\n"
fdata += "# Results:\n"
fdata += "# Tanscription Step | Energy-sorted structure index | Structure | Energy | Occupancy | Structure ID (-> Plotting ID)\n"
示例3: str2filename
# 需要导入模块: import RNA [as 别名]
# 或者: from RNA import md [as 别名]
"""Calculate the mfes and the partition function of the sequences for both temperatures."""
import sys
import RNA
import matplotlib
import Bio
import re # for regular expressions
import matplotlib.pyplot as plt
from math import exp
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.Alphabet import IUPAC
from matplotlib.backends.backend_pdf import PdfPages
MODEL_LOW_TEMPERATURE = RNA.md()
MODEL_HIGH_TEMPERATURE = RNA.md()
MODEL_LOW_TEMPERATURE.temperature = 30
MODEL_HIGH_TEMPERATURE.temperature = 37
RRS = 'AAGGAG'
SPACER = 6
START = 'AUG'
BOLTZMANN_K = 1.9872041e-3
def str2filename ( string ):
""" turn string into suitable filename """
rawstring = repr(string)
newstring = re.sub(r'[\W]', '-',rawstring)
newstring = newstring.strip('-')
# cut at 31 characters, remove remaining '-' or '_' at the end