Re: [AMBER] CPPTRAJ issues parsing NETCDF RST file

From: Gustaf Olsson <gustaf.olsson.lnu.se>
Date: Thu, 30 Aug 2018 14:35:15 +0000

Hi Daniel and thank you for your kind reply

I did not consider the extension given as deterministic of the output format, which was dumb since I seem unable to specify a desired output format on the command line. Changing rst to rst7 solved the issue.

  cpptraj -p *.prmtop -y nvt10ns.rst -x nvt10ns_ascii.rst7

Produces the expected output.

I did not consider using cpptraj directly, I’m using a shell script to perform a large series of actions on a large number of input files and using ambmask seemed the easiest way. Though I could write the cpptraj input and call cpptraj -i instead, though that would be a slightly complex input since I suppose you cannot “unstrip”. I have a series of these running:

  ambmask -p *.prmtop -c nvt10ns.rst -out pdb -find '(:1)' > guestDSA_1_10ns.pdb
  ambmask -p *.prmtop -c nvt10ns.rst -out pdb -find '(:1<:8.0) & !(:1)' > hostDSA_1_10ns_JTR.pdb
  ambmask -p *.prmtop -c nvt10ns.rst -out pdb -find '(:1<:8.0) & !(:DSA)' > hostDSA_1_10ns_NoT.pdb
  ambmask -p *.prmtop -c nvt10ns.rst -out pdb -find '(:1<:8.0) & !(:1 | :CL3)' > hostDSA_1_10ns_JTR.pdb
  ambmask -p *.prmtop -c nvt10ns.rst -out pdb -find '(:1<:8.0) & !(:DSA | :CL3)' > hostDSA_1_10ns_NoT.pdb

I have been producing these PDB files using a scripted procedure in VMD and stripping molecules from the output using grep, however vmd mangles the atom types for a particular structure (CL3) making the docking input produced useless since chloroform is interpreted as a non-bonded carbon.

Anyway, I’ll start with the conversion using the correct format and I’ll look into bypassing this conversion using cpptraj directly for future projects!

Tank you very much Dan, your answer solved my problem 100%

Best regards
// Gustaf

> On 30 Aug 2018, at 14:46, Daniel Roe <daniel.r.roe.gmail.com> wrote:
>
> Hi,
>
> I'm almost certain that you're writing nvt10ns_ascii.rst as an Amber
> ASCII trajectory, not a restart file; the recognized extension for
> Amber ASCII restarts is '.rst7' (see section 29.9 in the Amber 18
> manual or 'help trajout' in cpptraj). Cpptraj will let you know what
> format it is writing under 'OUTPUT TRAJECTORIES'.
>
> Also, if what you want to do is create a PDB containing only residue 1
> you could just use cpptraj directly:
>
> cpptraj -p *.prmtop -y nvt10ns.rst <<EOF
> strip !:1
> trajout pdb pdb
> EOF
>
> Hope this helps,
>
> -Dan
>
>
> On Thu, Aug 30, 2018 at 8:20 AM Gustaf Olsson <gustaf.olsson.lnu.se> wrote:
>>
>> So, I am trying to make CPPTRAJ do something it was probably not intended to do in order to create input files for another piece of software.
>>
>> This is the command that I am attempting to execute:
>> ambmask -p *.prmtop -c nvt10ns.rst -out pdb -find '(:1)’
>>
>> When I am doing this on a simulation where both RST and CRD files are binary (NETCDF) I get this error:
>>
>> | New format PARM file being parsed.
>> | Version = 1.000 Date = 01/30/18 Time = 11:33:27
>> natom = 21616
>> nres = 2149
>> STOP error reading natom from inpcrd
>>
>> When trying to do the same on a simulation that wrote the RST files in ASCII it works. Naively I though that a simple conversation a la:
>>
>> cpptraj -p *.prmtop -y nvt10ns.rst -x nvt10ns_ascii.rst
>>
>> Would fix this however it did not. I do notice that there are slight differences, the ascii written RST file has the following first lines:
>>
>> default_name
>> 21616 0.1230000E+05
>>
>> Whereas this information is missing in the converted file, along with what I am assuming is the box side angles on the last row.
>>
>> So, I would prefer not having to manually edit all of the files I need to be able to perform the task at hand, can I somehow get this information included when converting formats so that I can get the expected output from ambmask?
>>
>> Best regards
>> // Gustaf
>>
>> _______________________________________________
>> 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

_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Thu Aug 30 2018 - 08:00:02 PDT
Custom Search