CatDCD
From Computational Biophysics and Materials Science Group
Contents
[hide]Single dcd
First: Make an index file
set filename "1chain_A_wt" #mol new ionized.pdb type pdb waitfor all # set sel [atomselect top "((resid >=1 and resid <=28) or (resid >=134 and resid <=140)) and name P"] set sel [atomselect top "chain A"] # set indices [$sel get index] set file [open $filename.ind w] foreach indices [$sel get index] { puts $file "$indices" } # flush $file close $file
Save it as a tcl script.
Load your molecule manually or uncomment the molecule loading command in the script (with your molecule name replaced).
Then
source getind.tcl
in the Tk Console. You will get your index file with the file name you have defined in the first line.
Second: catdcd
Get your dcd and ind file in the same directory. Simply
catdcd -o output.dcd -i index.ind trajectory.dcd
does the job.
Multiple dcd
First: Make an index file
foreach i {A B C D E F G H I J K L M N O P Q R S T U V W X} { set filename "1chain+$i+wt" set sel [atomselect top "chain $i"] set file [open $filename.ind w] foreach indices [$sel get index] { puts $file "$indices" } close $file }
Second: catdcd
#!/bin/bash for i in A B C D E F G H I J K L M N O P Q R S T U V W X do catdcd -o 1chain+$i+wt.dcd -i 1chain+$i+wt.ind NPT-4.dcd done
Get xyz instead of dcd
#!/bin/bash for i in {1..24} do catdcd -o 1chain+P$i+wt+CA+dcd.xyz -otype xyz -i 1chain+P$i+wt+CA.ind -stype pdb -s MjHSP16.5_wt_CA.pdb -first 4050 -last 4500 NPT-4_CA.dcd catdcd -o 1chain+P$i+wt+CA+ref.xyz -otype xyz -i 1chain+P$i+wt+CA.ind -stype pdb -s MjHSP16.5_wt_CA.pdb -first 4050 -last 4050 NPT-4_CA.dcd done
Convert binary DCD to xyz
catdcd -o output.xyz -otype xyz -s struct.psf -stype psf somedcd.dcd
or
catdcd -o output.xyz -otype xyz -s struct.pdb -stype pdb somedcd.dcd