升级 NUPACK 4.1 并支持混合材料设计
This commit is contained in:
parent
5daa60a464
commit
c6189d857d
33 changed files with 5830 additions and 466 deletions
87
rna/操作流程.txt
87
rna/操作流程.txt
|
|
@ -1,44 +1,45 @@
|
|||
准备工作:
|
||||
在 Windows 界面中搜索 控制面板 打开 程序-程序和功能-启动或关闭 Windows 功能-勾选‘适用于 Linux 的 Windows 子系统’与‘虚拟机平台’后点击确定后重启电脑
|
||||
在 Microsoft Store 中下载 Ubunut
|
||||
按 Win+X 键 点击 ‘命令提示符(管理员)’ 输入 wsl --install 后回车。下载完毕后关闭即可。 如果遇到链接失败就是网络问题,链接手机热点后重新输入+回车即可
|
||||
|
||||
安装:打开 Ubunut
|
||||
将群内的所有压缩包直接保存在D盘
|
||||
nupack 安装
|
||||
mkdir nupack-latest
|
||||
cd nupack-latest
|
||||
cp /mnt/d/nupack-4.0.2.0.zip ./
|
||||
sudo apt install unzip
|
||||
unzip nupack-4.0.2.0.zip
|
||||
cd ..
|
||||
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
|
||||
/bin/bash Miniconda3-latest-Linux-x86_64.sh -b
|
||||
miniconda3/bin/conda update -n base -c defaults conda
|
||||
rm Miniconda3-latest-Linux-x86_64.sh
|
||||
export PATH=$HOME/miniconda3/bin:$PATH
|
||||
echo 'export PATH=$HOME/miniconda3/bin:$PATH' >> ~/.bashrc
|
||||
conda install numpy scipy pip matplotlib pandas jupyterlab
|
||||
pip install -U nupack -f ./nupack-latest/nupack-4.0.2.0/package
|
||||
jupyter lab
|
||||
|
||||
RNAplot 安装
|
||||
mkdir rna
|
||||
cd rna
|
||||
cp /mnt/d/ViennaRNA-2.7.2.tar.gz ./
|
||||
tar -zxvf ViennaRNA-2.7.2.tar.gz
|
||||
cd ViennaRNA-2.7.2
|
||||
(可能出现报错的解决方法
|
||||
sudo apt update
|
||||
sudo apt install build-essentia
|
||||
sudo apt install pkg-config)
|
||||
./configure
|
||||
make
|
||||
sudo make install
|
||||
|
||||
图片美化方法
|
||||
|
||||
将生成后的svg图片保存在一个文件夹内,并将该文件夹与群内的 py 文件保存在一个文件夹。后 Shift+鼠标右键 点击在此处打开 Powershell 窗口后
|
||||
输入命令
|
||||
python TrnaStructureBeautifier.py -i 文件夹名称 用于指定一个文件夹
|
||||
准备工作:
|
||||
在 Windows 界面中搜索 控制面板 打开 程序-程序和功能-启动或关闭 Windows 功能-勾选‘适用于 Linux 的 Windows 子系统’与‘虚拟机平台’后点击确定后重启电脑
|
||||
在 Microsoft Store 中下载 Ubunut
|
||||
按 Win+X 键 点击 ‘命令提示符(管理员)’ 输入 wsl --install 后回车。下载完毕后关闭即可。 如果遇到链接失败就是网络问题,链接手机热点后重新输入+回车即可
|
||||
|
||||
安装:打开 Ubunut
|
||||
将群内的所有压缩包直接保存在D盘
|
||||
nupack 安装
|
||||
mkdir nupack-latest
|
||||
cd nupack-latest
|
||||
cp /mnt/d/nupack-4.1.0.1.zip ./nupack-outer.zip
|
||||
sudo apt install unzip
|
||||
unzip nupack-outer.zip
|
||||
unzip nupack-4.1.0.1.zip
|
||||
cd ..
|
||||
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
|
||||
/bin/bash Miniconda3-latest-Linux-x86_64.sh -b
|
||||
miniconda3/bin/conda update -n base -c defaults conda
|
||||
rm Miniconda3-latest-Linux-x86_64.sh
|
||||
export PATH=$HOME/miniconda3/bin:$PATH
|
||||
echo 'export PATH=$HOME/miniconda3/bin:$PATH' >> ~/.bashrc
|
||||
conda install numpy scipy pip matplotlib pandas jupyterlab
|
||||
pip install -U nupack -f ./nupack-latest/nupack-4.1.0.1/package
|
||||
jupyter lab
|
||||
|
||||
RNAplot 安装
|
||||
mkdir rna
|
||||
cd rna
|
||||
cp /mnt/d/ViennaRNA-2.7.2.tar.gz ./
|
||||
tar -zxvf ViennaRNA-2.7.2.tar.gz
|
||||
cd ViennaRNA-2.7.2
|
||||
(可能出现报错的解决方法
|
||||
sudo apt update
|
||||
sudo apt install build-essentia
|
||||
sudo apt install pkg-config)
|
||||
./configure
|
||||
make
|
||||
sudo make install
|
||||
|
||||
图片美化方法
|
||||
|
||||
将生成后的svg图片保存在一个文件夹内,并将该文件夹与群内的 py 文件保存在一个文件夹。后 Shift+鼠标右键 点击在此处打开 Powershell 窗口后
|
||||
输入命令
|
||||
python TrnaStructureBeautifier.py -i 文件夹名称 用于指定一个文件夹
|
||||
python TrnaStructureBeautifier.py -i 文件名称 用于指定一个文件
|
||||
|
|
@ -1,46 +1,46 @@
|
|||
from nupack import *
|
||||
import subprocess
|
||||
import os
|
||||
|
||||
def huatu(Complex,result):#Complex是你想查看的复合物,eg: '(StrandA+StrandB)' 引号和括号都要有;
|
||||
#result是nupack计算(tube_analysis)的结果,eg: nupack指南里用过my_result、my_results和tube_results等, 或者你自己有其他命名
|
||||
def jiegou(Complex,result):
|
||||
m=str(result[Complex].mfe[0].structure)
|
||||
mm=""
|
||||
for i in m:
|
||||
if i != "+":
|
||||
mm=mm+i
|
||||
if i=="":
|
||||
continue
|
||||
return mm
|
||||
def xulie(Complex):
|
||||
inp=''
|
||||
for i in Complex:
|
||||
if i != '(' and i != ')':
|
||||
inp=inp+i
|
||||
else:
|
||||
continue
|
||||
l=inp.split('+',-1)
|
||||
xulie=''
|
||||
for i in l:
|
||||
xulie=xulie+str(eval(i))
|
||||
return xulie
|
||||
sequence=xulie(Complex)
|
||||
best_structure=jiegou(Complex,result)
|
||||
seq_name =Complex
|
||||
output_folder="/home/liusiye/桌面/nupack-4.0.2.0"#指定图片保存在哪个文件夹,需自己更改
|
||||
temp_file_path = os.path.join(output_folder, f"{seq_name}.seq")
|
||||
with open(temp_file_path, "w", newline='\n') as f:
|
||||
f.write(f">{seq_name}\n")
|
||||
f.write(f"{sequence}\n")
|
||||
f.write(f"{best_structure}\n")
|
||||
try:
|
||||
input_filename = f"{seq_name}.seq"
|
||||
process = subprocess.run(["RNAplot", "--o", "svg", input_filename], cwd=output_folder, capture_output=True, text=True)
|
||||
if process.returncode == 0:
|
||||
print(f"🎉 绘图成功!请前往 {output_folder} 文件夹查看 {seq_name}_ss.svg")
|
||||
os.remove(temp_file_path)
|
||||
else:
|
||||
print("❌ RNAplot 运行失败,报错信息:\n", process.stderr)
|
||||
except FileNotFoundError:
|
||||
from nupack import *
|
||||
import subprocess
|
||||
import os
|
||||
|
||||
def huatu(Complex,result):#Complex是你想查看的复合物,eg: '(StrandA+StrandB)' 引号和括号都要有;
|
||||
#result是nupack计算(tube_analysis)的结果,eg: nupack指南里用过my_result、my_results和tube_results等, 或者你自己有其他命名
|
||||
def jiegou(Complex,result):
|
||||
m=str(result[Complex].mfe[0].structure)
|
||||
mm=""
|
||||
for i in m:
|
||||
if i != "+":
|
||||
mm=mm+i
|
||||
if i=="":
|
||||
continue
|
||||
return mm
|
||||
def xulie(Complex):
|
||||
inp=''
|
||||
for i in Complex:
|
||||
if i != '(' and i != ')':
|
||||
inp=inp+i
|
||||
else:
|
||||
continue
|
||||
l=inp.split('+',-1)
|
||||
xulie=''
|
||||
for i in l:
|
||||
xulie=xulie+str(eval(i))
|
||||
return xulie
|
||||
sequence=xulie(Complex)
|
||||
best_structure=jiegou(Complex,result)
|
||||
seq_name =Complex
|
||||
output_folder="/home/liusiye/桌面/nupack-4.1.0.1"#指定图片保存在哪个文件夹,需自己更改
|
||||
temp_file_path = os.path.join(output_folder, f"{seq_name}.seq")
|
||||
with open(temp_file_path, "w", newline='\n') as f:
|
||||
f.write(f">{seq_name}\n")
|
||||
f.write(f"{sequence}\n")
|
||||
f.write(f"{best_structure}\n")
|
||||
try:
|
||||
input_filename = f"{seq_name}.seq"
|
||||
process = subprocess.run(["RNAplot", "--o", "svg", input_filename], cwd=output_folder, capture_output=True, text=True)
|
||||
if process.returncode == 0:
|
||||
print(f"🎉 绘图成功!请前往 {output_folder} 文件夹查看 {seq_name}_ss.svg")
|
||||
os.remove(temp_file_path)
|
||||
else:
|
||||
print("❌ RNAplot 运行失败,报错信息:\n", process.stderr)
|
||||
except FileNotFoundError:
|
||||
print("❌ 找不到 RNAplot 命令,请确认环境变量。")
|
||||
Loading…
Add table
Add a link
Reference in a new issue