My software notes

January 25, 2006

[MOLMOL]align your structures by a simple macro

Filed under: pymol/ molmol — kpwu @ 3:45 am

Save the following lines into a macro(xxx.mac), you can put the file in the MOLMOL_HOME/macros, then you will find the file in the standard macro directory while you browse the toolbar in MOLMOL

**** ONLY align the backbone, and you will see the RMSD value at the bottom of MOLMOL

——————-copy the following lines into a xxx.mac——————-

SelectAtom ”
SelectBond ”
SelectAngle ”
SelectDist ”
SelectPrim ”
StyleAtom invisible
StyleBond invisible
StyleRibbon invisible as_is as_is as_is
SelectAtom ‘bb’
SelectBond ‘bb’
StyleAtom invisible
StyleBond line
Fit to_first ’selected’

convert protein sequence from 1 to 3 letter code for each residue

Filed under: NMRPipe and NMRview, xplor/xplor-nih/cns — kpwu @ 3:37 am

Copy the following lines in a shell script file, make sure the file is executable, so far only work one direction from single letter code to 3-letter code, plan to cover both directions and DNA/RNA in the future.

The script was designed for NMRView sequence format, and Xplor sequence format,too.
————————————————————————————–

#!/bin/sh
# convert protein sequence from one letter code to three letter code
# Just set up your sequence file name for “xseq= ??”
# Kuen-Phon Wu, 06/11/2004 version 0.2
# 06/17/2004 version 0.3
#
# This program will ignore any other characters which are not standard 20 Amino
# acids, like: B,O…. Either lowercases or uppercases can be process via this
# program, have fun!
#
# Just use as: ./seq1to3.sh [FILENAME] > [OUT_FILE]

usage=”Usage: seq1to3.sh [inputfile] > [OUTPUT]“

if [ $# -lt 1 ] ; then
echo “$usage”
exit 1
fi

tr ‘A-Z’ ‘a-z’ ==== $1 | tr ‘[:punct:]‘ ‘b’ | tr ‘0-9′ ‘b’ |tr ‘\n’ ‘b’| \
sed -e ’s/[o|x|z|u|j|b| ]//g’ \
-e ’s/a/ALA\n/g’ -e ’s/c/CYS\n/g’ -e ’s/d/ASP\n/g’ \
-e ’s/e/GLU\n/g’ -e ’s/f/PHE\n/g’ -e ’s/g/GLY\n/g’ \
-e ’s/h/HIS\n/g’ -e ’s/i/ILE\n/g’ -e ’s/k/LYS\n/g’ \
-e ’s/l/LEU\n/g’ -e ’s/m/MET\n/g’ -e ’s/p/PRO\n/g’ \
-e ’s/r/ARG\n/g’ -e ’s/q/GLN\n/g’ -e ’s/n/ASN\n/g’ \
-e ’s/s/SER\n/g’ -e ’s/t/THR\n/g’ -e ’s/w/TRP\n/g’ \
-e ’s/y/TYR\n/g’ -e ’s/v/VAL\n/g’

re-order the PDB file

Filed under: xplor/xplor-nih/cns — kpwu @ 12:06 am

Please save the followng lines in a shell script file, the script could be worked well in most cases, that is very convinient for change the PDB residue number from 1 to designated number, for example change from 1 to 331, when your protein is a part of C-terminal domain.

Enjoy it
—————————————————-

#!/bin/sh

## Author: Kuen-Phon Wu, 06/10/2004, v 0.5
#############  set up pdb file name ##############
PDB=gb1-2gb1.pdb
output=x.pdb
###############

#### just adjust the $5-33, which -33 is the number you want to minus
####  if you want to plus, just do an addition like +33

awk ‘ $1 ~ \
 /ATOM/{printf (“%s%7s%5s%4s%6s%12.3f%8.3f%8.3f%6.2f%6.2f\n”,\
  $1,$2,$3,$4,$5-33,$6,$7,$8,$9,$10) }
 ’ $PDB  > _temp

### do sed for LYS+, HIS+,and  ARG+
sed -e ’s/LYS+ / LYS+/g’ -e ’s/ARG+ / ARG+/g’ -e ’s/HIS+ / HIS+/g’ \
 _temp >$output
rm -f _temp

Blog at WordPress.com.