Re: [AMBER] MMPBSA error

From: Jan-Philip Gehrcke <jgehrcke.googlemail.com>
Date: Tue, 17 Apr 2012 14:28:02 +0200

Huhu,

"OSError: [Errno 2] No such file or directory" in context of subprocess
means that the executable path provided to `subprocess.Popen()` is not a
valid path. This is contradictory to the message "cpptraj found! Using
cpptraj". Likewise, there must be a problem in the source code.

I went through AmberTools12's MMPBSA source, and if I am not overseeing
something elementary, I found this problem. However, I did not compile
AmberTools12 myself so far and did not run any tests. So in case I've
overseen something, I may have identified the problem wrongly which also
renders the proposed solution to nonsense :-)


Let's look at line 37 of findprogs.py (in function `find_progs()`):

     print '%s found! Using %s' % (prog, str(my_progs[prog]))

which in Kumar's case resulted in "cpptraj found! Using cpptraj".


 From the code in context, `prog` is the 'required' program name, in
this case "cpptraj". "cpptraj found" actually means cpptraj is
required/requested. It does not mean that the executable has been found
so far.

`str(my_progs[prog])` prints what the `__str__` method of class
`ExternProg` returns:


    def __str__(self):
       if self.full_path: return self.full_path
       else: return self.prog_name

`self.full_path` is what `which(self.prog_name, self.search_path)`
returns. This function returns `None` if the requested executable was
neither found in a) $AMBERHOME/bin nor in $PATH. Hence, if the program
is not found by `which()`, `self.full_path` is `None` and
`self.prog_name` is printed. Which does not make sense.

This means that "cpptraj found! Using cpptraj" is printed even if the
cpptraj executable is not found. The same is true for any other required
program.

A `None` returned by `which()` indicates that the executable was not
found. However, I cannot find any place where a `None` returned by
`which()` results in an error message. I think that `find_progs()`
should return `False` or `None` in case one of the requested executables
could not be found. Then, in MMPBSA.py(cc), after line 497:

external_progs = find_progs(INPUT)

we should check for `external_progs` being `None` or `False`. I attached
two patch files implementing these suggestions. Again, I did not test
anything of this.

This is only a suggestion and maybe it helps,

Jan-Philip





On 04/17/2012 12:51 PM, Kumar, Sonu wrote:
> Hi Jason,
>
> I tried with 'debug_printlevel=2' and now it is giving this error:
>
> Reading command-line arguments and input files...
> Loading and checking parameter files for compatibility...
> mmpbsa_py_energy found! Using mmpbsa_py_energy
> cpptraj found! Using cpptraj
> Preparing trajectories for simulation...
> File "/usr/local/AmberTools/bin/MMPBSA.py", line 516, in<module>
> str(external_progs['cpptraj']))
> File "/usr/local/AmberTools/bin/MMPBSA_mods/make_trajs.py", line 57, in make_trajectories
> traj = Trajectory(FILES.solvated_prmtop, FILES.mdcrd, cpptraj)
> File "/usr/local/AmberTools/bin/MMPBSA_mods/make_trajs.py", line 453, in __init__
> self.Query()
> File "/usr/local/AmberTools/bin/MMPBSA_mods/make_trajs.py", line 577, in Query
> process = Popen([self.exe, self.prmtop], stdin=PIPE, stdout=PIPE)
> File "/usr/lib64/python2.6/subprocess.py", line 595, in __init__
> errread, errwrite)
> File "/usr/lib64/python2.6/subprocess.py", line 1092, in _execute_child
> raise child_exception
> OSError: [Errno 2] No such file or directory
> Exiting. All files have been retained.
>
> Thanks,
> Sonu
>
>
> On Apr 12, 2012, at 2:56 PM, Jason Swails wrote:
>
>> Can you add "debug_printlevel=2" to the&general section of your MMPBSA
>> input file and retry it? That will provide a full traceback so I can see
>> where the error is really occurring.
>>
>> Thanks!
>> Jason
>>
>> On Wed, Apr 11, 2012 at 5:24 PM, Kumar, Sonu
>> <sonu.kumar.dkfz-heidelberg.de>wrote:
>>
>>> Hi All,
>>>
>>> I am using MMPBSA.py module of AmberTool12 which is on my institute
>>> cluster for energy calculation, but getting an error?
>>>
>>> Here is my input file:
>>> mmpbsa.in
>>> Input file for running PB and GB in serial
>>> &general
>>> endframe=50, keep_files=2,
>>> /
>>> &gb
>>> igb=2, saltcon=0.100,
>>> /
>>> &pb
>>> istrng=0.100,
>>> /
>>>
>>> /usr/local/AmberTools/bin/MMPBSA.py -O -i mmpbsa.in -o
>>> FINAL_RESULTS_MMPBSA.dat -sp complex_solvated.prmtop -cp complex.prmtop -rp
>>> rec.prmtop -lp lig.prmtop -y *.crdbox
>>>
>>> Error which I am getting after running above command:
>>>
>>> Reading command-line arguments and input files...
>>> Loading and checking parameter files for compatibility...
>>> mmpbsa_py_energy found! Using mmpbsa_py_energy
>>> cpptraj found! Using cpptraj
>>> Preparing trajectories for simulation...
>>> OSError: [Errno 2] No such file or directory
>>> Exiting. All files have been retained.
>>>
>>>
>>> It would be great if someone help me in this..
>>>
>>> Thanks
>>> Sonu
>>>
>>> ----------------
>>> Sonu Kumar, M.Sc
>>>
>>>
>>>
>>> _______________________________________________
>>> AMBER mailing list
>>> AMBER.ambermd.org
>>> http://lists.ambermd.org/mailman/listinfo/amber
>>>
>>
>>
>>
>> --
>> Jason M. Swails
>> Quantum Theory Project,
>> University of Florida
>> Ph.D. Candidate
>> 352-392-4032
>> _______________________________________________
>> AMBER mailing list
>> AMBER.ambermd.org
>> http://lists.ambermd.org/mailman/listinfo/amber
>
> ----------------
> Sonu Kumar, M.Sc
> GlycoImmunology Lab(D015)
> German Cancer Research Center(DKFZ),
> Heidelberg, Germany
>
> sonu.kumar.dkfz.de
>
>
> _______________________________________________
> AMBER mailing list
> AMBER.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber



_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber

Received on Tue Apr 17 2012 - 05:30:04 PDT
Custom Search