[gmx-users] How to get the total charge?
David
spoel at xray.bmc.uu.se
Tue Jun 17 09:19:00 CEST 2003
On Mon, 2003-06-16 at 17:12, TAPO (Thomas Agersten Poulsen) wrote:
> Dear gmx-list.
>
> Given a topology file and an index file, how do I compute to total
> charge of each group in the index file?
>
> This might be a silly question, but I am sort of new to all these wonderful
> Gromacs tools, so please bear with me :-)
Hm........
There is no direct tool that does it, however you might use
editconf -f topol.tpr -o q.pdb -n index -grasp
this will give you a pdb file of your selected group with the charge in
the b-factor field. Then a tiny perl script would be able to get the
total charge
#!/usr/bin/perl -w
open(KKK,"grep ATOM q.pdb |") || die("q.pdb");
$qtot = 0;
while ($line = <KKK>) {
chomp($line);
@tmpe = split(' ',$line);
$qtot += $tmp[8];
}
close KKK;
print "qtot = $qtot\n";
(script not tested...)
>
> Best regards
> Thomas
>
> Thomas A. Poulsen
> Novozymes A/S
> Novo Alle 1, 2C.S44
> DK-2880 Bagsværd
> +45 44 42 27 23
>
> _______________________________________________
> gmx-users mailing list
> gmx-users at gromacs.org
> http://www.gromacs.org/mailman/listinfo/gmx-users
> Please don't post (un)subscribe requests to the list. Use the
> www interface or send it to gmx-users-request at gromacs.org.
--
Groeten, David.
________________________________________________________________________
Dr. David van der Spoel, Dept. of Cell and Molecular Biology
Husargatan 3, Box 596, 75124 Uppsala, Sweden
phone: 46 18 471 4205 fax: 46 18 511 755
spoel at xray.bmc.uu.se spoel at gromacs.org http://xray.bmc.uu.se/~spoel
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
More information about the gromacs.org_gmx-users
mailing list