Re: [AMBER-Developers] Introducing CPPTRAJ: Trajectory analysis written in C++

From: Daniel Roe <daniel.r.roe.gmail.com>
Date: Sun, 21 Nov 2010 09:12:43 -0500

Hi,

Both recent versions of ptraj (as of AmberTools 1.3) and the current
version of Cpptraj support seeking in Amber Trajectories and Netcdf
trajectories. Seeking in compressed files is still not possible to do
efficiently since as you mentioned the number of bytes per frame can
vary based on how the compression has been done, so the streams do
need to be decompressed during reading. However this process is a
little more efficient in cpptraj since the compression libraries are
used directly rather than external calls to gzip or bzip2 (which is
the case in ptraj).

One feature that cpptraj has which is related to this is the ability
to pick out specific frames from a trajectory to write out. For
example, say you want frames 5, 7 through 10, and 17 from trajectory
input.crd to be written as restart files. In cpptraj this can be done
like so:

trajin input.crd
trajout output.rst7 restart 5,7-10,17

Let me know if you have any more questions/concerns/bug reports/etc.. Thanks!

-Dan

On Sun, Nov 21, 2010 at 7:32 AM, Josh Berryman
<the.real.josh.berryman.gmail.com> wrote:
> That sounds like great news.
>
> Something that always annoyed me in ptraj was that you had to read in the
> whole trajectory to dump out one frame - the lack of a `seek' facility meant
> a long wait to do something very simple, to the extent that I eventually
> wrote a perl script of my own for resampling trajectories/dumping out single
> frames.
>
> Perhaps the new cpptraj includes functionality to this effect?  I am not
> sure how to do this with binary or compresed trajectory files if they have a
> variable number of bytes per frame, but at least one could avoid bashing the
> cache or running into swap by reading frames that won't be the subject of
> any further analysis to the same buffer each time.
>
> Josh
>
>
> On Fri, Nov 19, 2010 at 8:47 PM, Daniel Roe <daniel.r.roe.gmail.com> wrote:
>
>> Hello All,
>>
>> Over the past few months I have been working on a project I have
>> dubbed cpptraj, since it is trajectory analysis software in the spirit
>> of ptraj but written in C++. I initially started writing it because I
>> wanted to be able to analyze structures with different topologies in
>> the same analysis run, and modifying ptraj to do that would have been
>> quite difficult to do based on the way ptraj is currently set up. It
>> has since developed into a full-fledged trajectory analysis program.
>> For the most part it should run just like ptraj (and usually a bit
>> faster, especially when processing Netcdf trajectories). Here are some
>> notable differences:
>>
>> 1. File compression is handled internally rather than external calls
>> to gzip, bzip2, etc, which makes reading and writing compressed files
>> more efficient.
>> 2. Any file read or written by Cpptraj can be compressed (with the
>> exception of Netcdf trajectories). So e.g. topology files could be
>> read in as .gz files, and data files could be written as .bz2 files.
>> Compression is detected automatically when reading, and is determined
>> by the filename extension when writing.
>> 3. If two actions specify the same file with the 'out' keyword, data
>> from both actions will be written to that file in separate columns.
>> 4. Data files specified by the 'out' keyword can be written in xmgrace
>> format if the filename given has a '.agr' extension.
>> 5. Multiple output trajectories can be specified. In addition, output
>> files can be directed to write only specific frames from the input
>> trajectories.
>> 6. Multiple reference structures can be specified. Specific frames
>> from trajectories may be used as a reference structure.
>> 7. The rmsd action allows specification of a separate mask for the
>> reference structure. In addition, per-residue RMSD can be calculated
>> easily.
>> 8. When stripping coordinates with the strip action, a stripped
>> topology file can be written out. Currently this topology is good for
>> visualization only, not simulation (although this support is planned
>> for future releases).
>>
>> The ptraj commands currently implemented are: trajin, trajout,
>> reference, angle, center, dihedral, distance, hbond, image, rmsd,
>> secstruct, and strip.
>>
>> Since I have had several requests to get the code out there I have
>> uploaded it to the master branch of the amber GIT repository. The code
>> is located in the directory:
>>
>> amber/AmberTools/src/cpptraj
>>
>> and is completely self-contained. It will not be built by the overall
>> Amber Makefile. The code is still very much in an Alpha state and I am
>> still making modifications and enhancements, but as it is it should
>> function just fine. There is a manual located in the doc/ directory
>> (along with a very incomplete developers guide), and test cases
>> located in the test/ directory. The README file in the cpptraj/
>> directory contains info on how to build it:
>>
>> ./configure gnu
>> make install
>> make check
>>
>> should work on most systems. This will place the cpptraj binary in the
>> amber/AmberTools/src/cpptraj/bin directory, then run all test cases.
>> The configure script by default sets everything up to link
>> dynamically. If you encounter linking errors you may need to specify
>> library locations using the '--with-LIB=' options. For example, to use
>> Netcdf compiled with Amber use the option:
>>
>> --with-netcdf=$AMBERHOME/AmberTools/src/netcdf
>>
>> Alternatively you could disable the library with the 'no-LIB' options.
>>
>> Feedback on this will be hugely appreciated. Likes, dislikes, bugs,
>> desired features - send it all my way. Thanks!
>>
>> -Dan
>>
>> _______________________________________________
>> AMBER-Developers mailing list
>> AMBER-Developers.ambermd.org
>> http://lists.ambermd.org/mailman/listinfo/amber-developers
>>
> _______________________________________________
> AMBER-Developers mailing list
> AMBER-Developers.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber-developers
>

_______________________________________________
AMBER-Developers mailing list
AMBER-Developers.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber-developers
Received on Sun Nov 21 2010 - 06:30:03 PST
Custom Search