From: DimitryASuplatov (
Date: Mon Apr 27 2009 - 04:43:34 CDT


I want to calculate net system charge of my system given pdb and psf
files. I also want to be able to do it automatically via script.

I tried using something like:

        mol load psf $fname.psf pdb $fname.pdb

        set ev [atomselect top all]
        set indices [$ev get index]

        set netcharge 0

        foreach ind $indices {
                set at [atomselect top "index $ind"]
                set charge [$at get charge]
                set netcharge [ expr $netcharge + $charge ]
                $charge delete

        puts "$netcharge"

It works and outputs the correct value though it works some 5-10
seconds compared to autoioize plugin which does the complete job
including ionization in less then 5 seconds.

So my question is
                          Is there a one-word command to quickly
calculate system net charge give charmm topology and pdb coordinates?

Thank you for your time.