Re: [AMBER] Split a trajectory into frames

From: Kenneth Huang <>
Date: Thu, 26 Jan 2017 09:50:51 -0500


The best way I've found to split by every frame is to loop it through a
shell script that ticks up after every frame, which at least automates the
process and saves you from having to making a trajin for every 40000
frames, so something like-


while [ $firstframe -le $lastframe ]; do

cat >analysis.ptraj<<EOF
        parm *.prmtop
        trajin *.nc $firstframe $firstframe 1
        trajout snapshot_$firstframe.pdb

    let firstframe=firstframe+1


I'd also be curious if there's a faster way that doesn't require reloading
the trajectory every single time, though.



On Thu, Jan 26, 2017 at 9:35 AM, Elisa Pieri <>

> Hello,
> how can I split a .nc file into single frames? My nc file has 40000 frames
> and is 4.2 Gb, I think that using a strategy like "trajin mdcrd 1 4000 1 ;
> trajout mdcrd_chunk_" would be reeeeeally long. Anything faster?
> Thanks!
> Elisa
> _______________________________________________
> AMBER mailing list

Ask yourselves, all of you, what power would hell have if those imprisoned
here could not dream of heaven?
AMBER mailing list
Received on Thu Jan 26 2017 - 07:00:03 PST
Custom Search