VMD-L Mailing List
From: Eduardo Cruz-Chu (chucruz_at_ks.uiuc.edu)
Date: Mon Apr 27 2009 - 10:50:01 CDT
- Next message: Sebastián Gutiérrez: "Molefacture "namehead" error"
- Previous message: Peter Freddolino: "Re: Calculating system net charge with tcl in VMD"
- In reply to: DimitryASuplatov: "Calculating system net charge with tcl in VMD"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
you can also use "measure" command.
set all [ atomselect top all ]
measure sumweights $all weight charge
On Mon, 27 Apr 2009, DimitryASuplatov wrote:
> Hello,
>
> 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.
> SDA
>
- Next message: Sebastián Gutiérrez: "Molefacture "namehead" error"
- Previous message: Peter Freddolino: "Re: Calculating system net charge with tcl in VMD"
- In reply to: DimitryASuplatov: "Calculating system net charge with tcl in VMD"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]