Re: AMBER: xleap not recognizing residue

From: Kenley Barrett <>
Date: Mon, 8 May 2006 12:04:37 -0500

Thanks very much for your reply. First, a question: When you say I need to
replace the "first blank string" with my residue name, do you mean that it
should look like this:

> !entry.HMH.unit.residues table str name int seq int childseq int
startatomx str restype int imagingx
> "HMH" 1 27 1 "?" 0

instead of like this?:

> !entry.HMH.unit.residues table str name int seq int childseq int
startatomx str restype int imagingx
> "" 1 27 1 "?" 0

Secondly, a detailed explanation of how I made the library file is cut and
pasted below (I hope it's not too detailed--I included everything). If you
could take a look at it I'd really appreciate it, so that I'll know that
nothing is wrong other than the missing residue name in that particular
line. Thank you very much in advance for any suggestions.


 I did my single point calculation using gamess. I ran the following script
on the gamess output to extract the charges:

 #! /usr/bin/perl

#Usage: my_resp_gamess.perl [job_name]

 #Begin of code

#Enviroment settings

$path ="/h1/kbarrett/amber_post_visit/2003_him/";

 #Fortran files

$xyzfor = "xyz.f";

$espfor = "esp.f";

$cart2pdb = "cart2pdb.f";

 $xyzfor = sprintf("%s%s",$path,$xyzfor);

$espfor = sprintf("%s%s",$path,$espfor);

$cart2pdb = sprintf("%s%s",$path,$cart2pdb);

 #Temporary files

$xyztemp = "temp.866";

$esptemp = "temp.875";

 #Read job_file_name

$jobname = $ARGV[0];

 #Open log file




 #Find the position of molecule in BOHR

#for($i = 0;$i <= $#xyzdata;$i++)


# if ($xyzdata[$i] =~ /COORDINATES/)

# {

# $flag1 = $i;

# }

# if ($xyzdata[$i] =~ /INTERNUCLEAR/)

# {

# $flag2 = $i;

# }

# if ($xyzdata[$i] =~ /ICHARG/)

# {

# $flag3 = $i;

# }


 #set $flag1 and $flag2 according to line numbers in MHaa_New.log

$flag1 = 256;

$flag2 = 285;

 #Get atom number

$flag1 = $flag1 + 2;

$flag2 = $flag2 - 2;

#$natom = $flag2 - $flag1 + 1;

 #set atom number according to MHaa_New

$natom = 26;

 #Get charge

#.temp_array = split(/ +/, $xyzdata[$flag3]);

#$charge = $temp_array[5];

 #set charge according to MHaa_New

$charge = 0;

 print "Total $natom atoms in this molecule with a charge of $charge.\n";

 #Open dat file




 #In Hai's program he uses the term $#datdata which when I checked it

#took me to the last line of printed information in the .dat file.

#This doesn't work for me because after the esp information in my .dat file

#I have the information on the plt0rb and MolPlot input files at the

#end of my .dat file.

#Hai didn't have these in his files.

#So in the place of $#datdata I plugged in the line

#number of the last line of data before the pltOrb and MolPlot stuff.

 #check that 159508 refers to correct line in MHaa_New.dat

if ($datdata[159508] =~ /1156 2.48894 -10.91061 -2.30196 0.103839E-01/)


print "okay\n";


 #Get esp parameter position

for($i = 0;$i <= 159508 ;$i++)


if ($datdata[$i] =~ /ELPOTT/)


$flag3 = $i;



 $line_esp=159508 - $flag3;

 #Create esptemp file


print TEMP "$line_esp\n";

for ($i = $flag3 + 1; $i <= 159508; $i++) { print TEMP "$datdata[$i]"; }


 #Create xyztemp file


print TEMP "$natom, $line_esp, $charge\n";

for($i = $flag1; $i <= $flag2; $i++) { print TEMP "$xyzdata[$i]"; }


 #Create esp dat file

`g77 $xyzfor; a.out < $xyztemp > $jobname.resp`;

`g77 $espfor; a.out < $esptemp >> $jobname.resp`;

 #Create pdb file

`g77 $cart2pdb; a.out < $xyztemp > $`;


`rm $xyztemp $esptemp a.out`;

 I then ran another script to produce input for respgen:

 #! /usr/bin/perl

#Usage: runresp.perl [job_name] [charge]

 $jobname = $ARGV[0];

$charge = $ARGV[1];

print "Total charge is $charge \n";

 #Create ac(AnteChamber) file

`/opt/local/amber7/exe/antechamber -i $ -fi pdb -o

-fo ac`;

#Add charge




 $data[0] =~ s/0.00/$charge/;


for($i = 0;$i <= $#data;$i++)


printf AC $data[$i];



 I then ran the following commands:

 [kbarrett.anatase hybrid]$ /opt/local/amber7/exe/resp -O -i -o MHaa_New_h.resp1.out -e MHaa_New.resp -t

[kbarrett.anatase hybrid]$ /opt/local/amber7/exe/resp -O -i -o MHaa_New_h.resp2.out -e MHaa_New.resp -q
MHaa_New_h.stage1.chg -t Mhaa_New_h.stage2.chg

[kbarrett.anatase hybrid]$ /opt/local/amber7/exe/antechamber -i
-fi ac -o -fo ac -c rc -cf MHaa_New_h.stage2.chg

 [kbarrett.anatase hybrid]$ /opt/local/amber7/exe/atomtype -i -o -p amber

[kbarrett.anatase hybrid]$ /opt/local/amber7/exe/antechamber -i -fi ac -o MHaa_New_h.prep -fo prepi

 I changed the name "TMP" in the prep file to "HMH". Then I ran:

 parmchk -i Mhaa_New_h.prep -f prepi -o Mhaa_New_h.frcmod

 I edited the frcmod file to add the missing parameters. Then I copied
Mhaa_New.prep to MHaa_New_h_edited.prep. I edited this file to have
0.003less on all non-blocking atoms, except for C15, C19, N11, C07,
O05, and N01,
which were the most negatively charged non-blocking atoms, so I subtracted
0.004 from all of them. This brought the charge to zero (it was a little off
before). I read Mhaa_New_h_edited.prep and Mhaa_New_h.frcmod into Xleap,
erased the blocking groups on the residue, and saved it as HMH.lib.

 When I tried to read in the pdb file it crashed. A friend of mine fixed
this for me: he found that the problem was that the HMH.lib file had
incorrect head and tail atoms, so he fixed that I e-mailed me back the a
corrected library file, hmh2.lib, which did not include the parameters. I
added the parameters by doing the command in Xleap:

 loadoff HMH.lib

saveoff e hmh2.lib

 I deleted the old HMH.lib and renamed hmh2.lib HMH.lib. This is final
library file that I sent to you.

On 5/7/06, David A. Case <> wrote:
> On Sun, May 07, 2006, Kenley Barrett wrote:
> > I just created a new library file for a methylated histidine. Initially
> > everything appeared to be fine (XLeap read in the pdb file containing
> the
> > methylated histidine without complaining), but then when I tried to set
> the
> > connect0 and connect1 atoms XLeap told me that "HMH", my residue name,
> was
> > not a residue:
> >
> Here is the problem, in your lib file:
> > !entry.HMH.unit.residues table str name int seq int childseq int
> startatomx str restype int imagingx
> > "" 1 27 1 "?" 0
> ^^^^
> The first blank string should be "HMH", not a blank. This is why you are
> getting a blank residue id after you load the pdb file. (You can use the
> "desc" command after you load the pdb to see what it going on.)
> How (in detail) did you create the lib (aka "off") file? We need to
> figure
> out if something was supposed to be inserting this string and was not.
> But if you manually fix the lib file, you should be able to get further.
> ...good luck...dac
> -----------------------------------------------------------------------
> The AMBER Mail Reflector
> To post, send mail to
> To unsubscribe, send "unsubscribe amber" to

The AMBER Mail Reflector
To post, send mail to
To unsubscribe, send "unsubscribe amber" to
Received on Tue May 09 2006 - 17:06:50 PDT
Custom Search