Re: [AMBER] Error with a cpptraj loop

From: SATYAJIT KHATUA via AMBER <amber.ambermd.org>
Date: Sun, 1 Oct 2023 20:41:35 +0000

Hi,

I may help you with a alternate script. A simple bash script will do the job for you.


In terminal, please write the following:

for i in {1..500};do echo trajin *.mdcrd $i $i > 1.in;echo trajout frame$i.mdcrd crd > 2.in;cat 1.in 2.in > traj$i.in;cpptraj -p *.prmtop -i traj$i.in;done

Best,
Satyajit

________________________________
From: VERONICA MARTIN HERNANDEZ via AMBER <amber.ambermd.org>
Sent: 02 October 2023 01:26
To: AMBER Mailing List <amber.ambermd.org>
Subject: [AMBER] Error with a cpptraj loop

Hi everyone again (and sorry for writting to much)

I've to extract all the frames of a dynamic in separated files and I was trying with cpptraj and the following loop:

parm CRBN-LVR-solv.prmtop
trajin CRBN-LVR-NVTcenter.mdcrd
for iFrame in {1..500}
  trajout CRBN-LVR-\$iFrame.mdcrd onlyframes \$iFrame
do
run

But I get the following error:

INPUT: Reading input from 'extract.in'
  [parm CRBN-LVR-solv.prmtop]
        Reading 'CRBN-LVR-solv.prmtop' as Amber Topology
        Radius Set: H(N)-modified Bondi radii (mbondi2)
  [trajin CRBN-LVR-NVTcenter.mdcrd]
        Reading 'CRBN-LVR-NVTcenter.mdcrd' as Amber Trajectory
  [for iFrame in {1..500}]
    Setting up 'for' loop.
CONTROL: Parsing control block.
  BLOCK 0: for ((iFrame in {1..500})) do
  [trajout CRBN-LVR-\$iFrame.mdcrd onlyframes \$iFrame]
        Added command 'trajout' to control block 0.
  [do]
        Added command 'do' to control block 0.
Error: 1 unterminated control block(s) detected.
Error: 0 : for ((iFrame in {1..500})) do
TIME: Total execution time: 0.1296 seconds.
Error: Error(s) occurred during execution.

How can I fix it?
Thanks in advance
_______________________________________________
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 Sun Oct 01 2023 - 14:00:02 PDT
Custom Search