From: Efthymiou, Christos (christos.dereschuk.20_at_ucl.ac.uk)
Date: Mon Aug 29 2022 - 04:29:13 CDT

Hi Norman,

Thank you so much, those changes fixed the previous errors. Unfortunately, now I am getting another error message:

>catdcd -s protein.pdb -o MD_protein.dcd -otype dcd -i indexfile -dcd MD.dcd
CatDCD 5.4
Reading indices from file 'indexfile'
Opening file 'MD_protein.dcd' for writing.
dcdplugin) detected standard 32-bit DCD file of native endianness
dcdplugin) CHARMM format DCD file (also NAMD 2.1 and later)
Error: dcd file MD.dcd contains wrong number of atoms (75716)

In summary, I loaded the original psf and pdb files containing the solvated protein complex into VMD. Next, I used the following commands to create psf and pdb files only containing protein:

set a [atomselect top "protein"]
$a writepsf protein.psf
$a writepdb protein.pdb

With the solvated psf and pdb files loaded in VMD, I used these commands to create the index file:

set fp [open indexfile w]
set a [atomselect top "protein"]
puts $fp [$a get index] nonewline
$a delete
close $fp

Then, I entered catdcd -s protein.pdb -o MD_protein.dcd -otype dcd -i indexfile -dcd MD.dcd, leading to the above error. The MD.dcd file is the trajectory with the water molecules that I am trying to remove the water from, so I do not understand why this error appears. Do I need to modify the structure of the catdcd command in some way?

Apologies for the number of questions but I cannot find any information online! Thank you again.

Best,
Christos
________________________________
From: Geist, Norman <norman.geist_at_uni-greifswald.de>
Sent: Monday, August 29, 2022 12:07 PM
To: Efthymiou, Christos <christos.dereschuk.20_at_ucl.ac.uk>
Cc: vmd-l_at_ks.uiuc.edu <vmd-l_at_ks.uiuc.edu>
Subject: Re: vmd-l: How to reduce the size of a .dcd file?

Hi,

I think the indexfiles catdcd expects should be 0-indexed, not 1-indexed. Simply do:

puts $fp [$a get index]

instead of

puts $fp [$a get serial]

and it should work.

You can also add "-nonewline" to TCL's puts to prevent the final "additional" linebreak.

Bests
Norman Geist

Am Montag, den 29-08-2022 um 10:55 schrieb Efthymiou, Christos:
Dear Norman,

I checked the index file, and the error seems to have been caused by a second blank line in the index file that needed to be deleted. However, now another error has appeared:

>catdcd -s protein.pdb -o MD_protein.dcd -otype dcd -i indexfile -dcd MD.dcd
CatDCD 5.4
Reading indices from file 'indexfile'
Atom index #6622 (6623) is out of range.

If I load the protein.pdb file into VMD, it shows there are 6623 atoms, therefore I do not understand how atom index #6622 (6623) can be out of range. My index file formatting is the following:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ... 6618 6619 6620 6621 6622 6623

And the index file was created with slightly modifying the tcl code you provided:

set fp [open indexfile w]
set a [atomselect top "protein"]
puts $fp [$a get serial]
$a delete
close $fp

Please let me know if you have any ideas for solving this error.

Best,
Christos

________________________________
From: Geist, Norman <norman.geist_at_uni-greifswald.de<mailto:norman.geist_at_uni-greifswald.de>>
Sent: Monday, August 29, 2022 9:47 AM
To: Efthymiou, Christos <christos.dereschuk.20_at_ucl.ac.uk<mailto:christos.dereschuk.20_at_ucl.ac.uk>>; Axel Kohlmeyer <akohlmey_at_gmail.com<mailto:akohlmey_at_gmail.com>>
Cc: vmd-l_at_ks.uiuc.edu<mailto:vmd-l_at_ks.uiuc.edu> <vmd-l_at_ks.uiuc.edu<mailto:vmd-l_at_ks.uiuc.edu>>
Subject: Re: vmd-l: How to reduce the size of a .dcd file?

Best would be to see the content of your indexfile, probably the format is just wrong [;)]

Bests
Norman Geist

Am Freitag, den 26-08-2022 um 21:04 schrieb Efthymiou, Christos:
Hi Norman,

I am trying to use catdcd on my Windows 10 computer using the commands you provided but I am having some trouble. Here is the error that appears:

>catdcd -s protein.pdb -o MD_protein.dcd -otype dcd -i indexfile -dcd MD.dcd
CatDCD 5.4
Reading indices from file 'indexfile'
Error opening index file indexfile
Error reading index file.

I have tried renaming the index file in my folder to indexfile.txt and indexfile.dat, but neither solved the issue. I also do not see .txt or .dat listed as one of the accepted input file types for catdcd. Therefore, what format should the index file be? Even without an extension I got that same error message.

Please let me know and thank you again for the help.

Best,
Christos
________________________________
From: Geist, Norman <norman.geist_at_uni-greifswald.de<mailto:norman.geist_at_uni-greifswald.de>>
Sent: Sunday, June 19, 2022 9:51 PM
To: Efthymiou, Christos <christos.dereschuk.20_at_ucl.ac.uk<mailto:christos.dereschuk.20_at_ucl.ac.uk>>; Axel Kohlmeyer <akohlmey_at_gmail.com<mailto:akohlmey_at_gmail.com>>
Cc: vmd-l_at_ks.uiuc.edu<mailto:vmd-l_at_ks.uiuc.edu> <vmd-l_at_ks.uiuc.edu<mailto:vmd-l_at_ks.uiuc.edu>>
Subject: Re: vmd-l: How to reduce the size of a .dcd file?

Hi,

saving a shortened DCD is also quite easily possible. Load PSF and PDB (PSF 1st.) and then in Extensions->TKConsole:

set a [atomselect top "not water"]
$a writepsf short.psf
$a writepdb short.pdb

Saving the indexfile for catdcd is similarly easy:

set fp [open indexfile w}]
set a [atomselect top "not water"]
puts $fp [$a get serial]
$a delete
close $fp

Then use catdcd like:

catdcd -s short.pdb -o short.dcd -otype dcd -i indexfile -dcd long1.dcd -dcd long2.dcd

Bests
Norman Geist

Am Sonntag, den 19-06-2022 um 15:15 schrieb Efthymiou, Christos:
Thank you for the link to the Windows installation!

Reading the possible input files, I see that .psf files are not one of the acceptable files. Is there a reason why water molecules cannot be removed from psf files? For my particular case, I was interested in using catdcd to reduce the size of my dcd trajectories to be able to analyze them with the program MDContactCom, which requires dcd and psf files as inputs. However, if I remove the water molecules from the dcd file and not the psf file, I get this error:

traj2pdb.py - Func: convert - ERROR - xyz must be shape (Any, 44191, 3). You supplied (200, 5508, 3)

Searching online, this seems to be caused by a disconnect between the total number of atoms in the trajectory compared to the psf file (i.e. the lack of water in the dcd file). Is there a way to remove water molecules from the psf file?

Thanks again for all the help.

Best,
Christos
________________________________
From: Axel Kohlmeyer <akohlmey_at_gmail.com<mailto:akohlmey_at_gmail.com>>
Sent: Friday, June 17, 2022 5:45 PM
To: Efthymiou, Christos <christos.dereschuk.20_at_ucl.ac.uk<mailto:christos.dereschuk.20_at_ucl.ac.uk>>
Cc: Geist, Norman <norman.geist_at_uni-greifswald.de<mailto:norman.geist_at_uni-greifswald.de>>; vmd-l_at_ks.uiuc.edu<mailto:vmd-l_at_ks.uiuc.edu> <vmd-l_at_ks.uiuc.edu<mailto:vmd-l_at_ks.uiuc.edu>>
Subject: Re: vmd-l: How to reduce the size of a .dcd file?

⚠ Caution: External sender

On Fri, Jun 17, 2022 at 10:35 AM Efthymiou, Christos <christos.dereschuk.20_at_ucl.ac.uk<mailto:christos.dereschuk.20_at_ucl.ac.uk>> wrote:

Additionally, is catdcd available on Windows? I cannot find any instructions or a manual on how to install and use the program.

I have not installed VMD on Windows in a long time. It used to be that a catdcd executable is only included in some packages and not in the Windows package.
Quite some time ago for some tutorials (and my own education), I had built Windows installer packages for catdcd. Those are still available at: https://urldefense.com/v3/__https://rpm.lammps.org/windows/testing/__;!!DZ3fjg!5kT9TZ3bfXcdmLMCP1QoeSzQpouD1nbbf8z7eZdN467f-Pv7WpPYnN9owk67DbQj5LcfFL17ZCTRqapTHy2odED8UTI0Dho$ <https://urldefense.com/v3/__https://eur01.safelinks.protection.outlook.com/?url=https*3A*2F*2Furldefense.com*2Fv3*2F__https*3A*2F*2Feur01.safelinks.protection.outlook.com*2F*3Furl*3Dhttps*3A*2F*2Frpm.lammps.org*2Fwindows*2Ftesting*2F*26data*3D05*7C01*7Cchristos.dereschuk.20*40ucl.ac.uk*7Cb9566f7fb1064fb4d79c08da5224b0cf*7C1faf88fea9984c5b93c9210a11d9a5c2*7C0*7C0*7C637912614792233125*7CUnknown*7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0*3D*7C3000*7C*7C*7C*26sdata*3DpEQUjYh6CLNIH4bpqMp0qjR6LP4qOKcjWWOiNNXD0m4*3D*26reserved*3D0__*3BJSUlJSUlJSUlJSUlJSUlJSUlJSUlJQ!!DZ3fjg!-fEZzNf7qMiACvrnmq4d4H8GFnjdrNajshf6IbzIQ5G46x0pxEJZ75J1v4eXDmWoHtJqFsa382ZK_7ySxFzRC60J_EMFyMY*24&data=05*7C01*7Cchristos.dereschuk.20*40ucl.ac.uk*7Cad22e694c5754f48a68308da899de1ad*7C1faf88fea9984c5b93c9210a11d9a5c2*7C0*7C0*7C637973608436025878*7CUnknown*7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0*3D*7C3000*7C*7C*7C&sdata=1i3ck0Q3*2BTgQsFfVrrwOUSQasBrn9hUFWwz0KMZr3HI*3D&reserved=0__;JSUlJSUlJSUlJSUqKioqKiolJSoqKioqKioqKioqKioqKiUlKiUlJSUlJSUlJSUlJSUlJSUlJSUlJQ!!DZ3fjg!5kT9TZ3bfXcdmLMCP1QoeSzQpouD1nbbf8z7eZdN467f-Pv7WpPYnN9owk67DbQj5LcfFL17ZCTRqapTHy2odED8rpQLvTI$ >
Use at your own risk. I just checked with a Windows 11 virtual machine and it can still be installed and run...

Axel.

```
Microsoft Windows [Version 10.0.22000.739]
(c) Microsoft Corporation. All rights reserved.

C:\Users\akohl>catdcd
CatDCD 5.4
   catdcd -o outputfile [-otype <filetype>] [-i indexfile]
      [-stype <filetype>] [-s structurefile]
      [-first firstframe] [-last lastframe] [-stride stride]
      [-<filetype>] inputfile1 [-<filetype>] inputfile2 ...

Allowed input file types:
crd crdbox XDATCAR rst7 OUTCAR xml vcf vtf js car dcd namdbin POSCAR pqr cpmd dlpolyhist dlpoly3hist dlpolyconfig xyz tinker binpos ABINIT pdb lammpstrj hoomd cor bgf xsf gro g96 trr trj xtc pdbx xbgf cube mol2 dms dtr mae

Allowed output file types:
crd crdbox rst7 js dcd namdbin POSCAR pqr xyz binpos ABINIT pdb lammpstrj hoomd bgf gro trr pdbx xbgf mol2 dms dtr mae
```

Thanks for the help!

Best,
Christos

--
Dr. Axel Kohlmeyer  akohlmey_at_gmail.com<mailto:akohlmey_at_gmail.com>  https://urldefense.com/v3/__http://goo.gl/1wk0__;!!DZ3fjg!5kT9TZ3bfXcdmLMCP1QoeSzQpouD1nbbf8z7eZdN467f-Pv7WpPYnN9owk67DbQj5LcfFL17ZCTRqapTHy2odED8HnM-av0$  <https://urldefense.com/v3/__https://eur01.safelinks.protection.outlook.com/?url=https*3A*2F*2Furldefense.com*2Fv3*2F__https*3A*2F*2Feur01.safelinks.protection.outlook.com*2F*3Furl*3Dhttp*3A*2F*2Fgoo.gl*2F1wk0*26data*3D05*7C01*7Cchristos.dereschuk.20*40ucl.ac.uk*7Cb9566f7fb1064fb4d79c08da5224b0cf*7C1faf88fea9984c5b93c9210a11d9a5c2*7C0*7C0*7C637912614792233125*7CUnknown*7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0*3D*7C3000*7C*7C*7C*26sdata*3DXMa13zy07J*2BYhRq6RdkLczXAwRFPwm4dg5iRPCpb4LU*3D*26reserved*3D0__*3BJSUlJSUlJSUlJSUlJSUlJSUlJSUl!!DZ3fjg!-fEZzNf7qMiACvrnmq4d4H8GFnjdrNajshf6IbzIQ5G46x0pxEJZ75J1v4eXDmWoHtJqFsa382ZK_7ySxFzRC60Jyp6ptcY*24&data=05*7C01*7Cchristos.dereschuk.20*40ucl.ac.uk*7Cad22e694c5754f48a68308da899de1ad*7C1faf88fea9984c5b93c9210a11d9a5c2*7C0*7C0*7C637973608436025878*7CUnknown*7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0*3D*7C3000*7C*7C*7C&sdata=pQpDThCX8nFdsWVry1px1U4ueGCaLAz5XcGqULcu64Y*3D&reserved=0__;JSUlJSUlJSUlJSUqKioqJSUqKioqKioqKioqKioqKiolJSoqJSUlJSUlJSUlJSUlJSUlJSUlJSU!!DZ3fjg!5kT9TZ3bfXcdmLMCP1QoeSzQpouD1nbbf8z7eZdN467f-Pv7WpPYnN9owk67DbQj5LcfFL17ZCTRqapTHy2odED83imgGog$  >
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.