📄 x2pdb
字号:
#!/bin/sh# This script converts an extended PDB format file (e.g. DOCK output) # to standard PDB format, commonly used by many graphics packages.# Rewritten in sh 8/26/94 DAG# Check for proper invocationif [ $# != 1 ]; then echo "Error --> need 1 argument. Usage: `basename $0` <xpdb_filename>" exit 1fiinfile=$1# See if the input file actually existsif [ ! -f $infile ]; then echo "Error --> $infile does not exist!" exit 1fi# Substitute "xpdb" extension, if it exists, for "pdb", otherwise append.outfile=`echo $infile | sed -e s/xpdb/pdb/`if [ $outfile = $infile ]; then # the input file did not have an "xpdb" extension, so just append # a .pdb to the original name outfile=$infile.pdbfi# Check to see if the desired output file exists already.if [ -f $outfile ]; then echo "Desired output file $outfile exists. Overwrite? " read ans case $ans in [Yy]*) # we'll continue and overwrite the file... ;; *) # ...otherwise quit now echo "Aborting..." exit ;; esac fi# Now process the xpdb file# note that there are two alternative print statements# the first is for 1,2, or 3 letter pdb atom names, while# the second is for 4 letter pdb atom namesnawk '{if (($1 == "ATOM") || ($1 ~ /ATM/)) { if (NF == 11) { if ( length($3) < 4 ) { printf("%-6s%5d %-4s%-4s%5d%12.3f%8.3f%8.3f%6.2f%6.2f\n", $1,$2,$3,$4,$5,$6,$7,$8,$9,$9*$10) } else { printf("%-6s%5d %-4s %-4s%5d%12.3f%8.3f%8.3f%6.2f%6.2f\n", $1,$2,$3,$4,$5,$6,$7,$8,$9,$9*$10) } } else { print; next } }else {print}}' $1 > $outfileecho "Standard PDB file $outfile created."
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -