Files
analysis_pdb/process_xtc.sh
2023-12-04 09:19:19 +08:00

30 lines
1.2 KiB
Bash

#!/bin/bash
# ndx:http://bbs.keinsci.com/thread-16290-1-1.html
alias gmx = "gmx_mpi"
# 参数设置
PDB_FILE="5sws_fixer.pdb" # 输入的PDB文件
INPUT_FOLDER="/path/to/input" # 输入文件夹路径
TEMP_FOLDER="/path/to/temp" # 临时文件夹路径
OUTPUT_FOLDER="/path/to/output" # 输出文件夹路径
# 确保临时和输出文件夹存在
mkdir -p "$TEMP_FOLDER"
mkdir -p "$OUTPUT_FOLDER"
# 文件路径
INDEX_FILE="${INPUT_FOLDER}/index.ndx"
TPR_FILE="${INPUT_FOLDER}/md.tpr"
XTC_FILE="${INPUT_FOLDER}/md.xtc"
# 提取ndx文件
echo -e "Protein\nq\n" | gmx make_ndx -f 5sws_fixer.pdb -o index.ndx
# Command 1: 提取蛋白质
echo "Protein" | gmx trjconv -dt 1000 -s "${TPR_FILE}" -f "${XTC_FILE}" -n "${TEMP_FOLDER}/tarj_show.ndx" -pbc mol -o "${TEMP_FOLDER}/temp.xtc"
# Command 2: 中心对齐蛋白质
echo "Protein\nProtein\nProtein" | gmx trjconv -s "${TPR_FILE}" -f "${TEMP_FOLDER}/temp.xtc" -n "${TEMP_FOLDER}/tarj_show.ndx" -center -fit rot+trans -o "${OUTPUT_FOLDER}/traj_show.xtc"
# Command 3: 抽取帧生成 .pdb 文件
echo "Protein\nProtein\nProtein" | gmx trjconv -s "${TPR_FILE}" -f "${TEMP_FOLDER}/temp.xtc" -n "${TEMP_FOLDER}/tarj_show.ndx" -center -fit rot+trans -b 0 -e 0 -o "${OUTPUT_FOLDER}/tarj_show.pdb"