Skip to content

Commit

Permalink
include get-charge.awk (mistakenly omitted)
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Spiriti committed May 25, 2017
1 parent 1c838dd commit d27fd1d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions par-scripts/get-charge.awk
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#determine the total charge on a molecule using the charge info in columns 79-80 of the pdb file
BEGIN {totalcharge=0}
/HETATM/ {chginfo=substr($0,79,2);
if (substr(chginfo,2,1)=="+") chg=substr(chginfo,1,1)+0;
else if (substr(chginfo,2,1)=="-") chg=-(substr(chginfo,1,1)+0);
else chg=chginfo+0;
totalcharge+=chg;
}
END {print totalcharge}

0 comments on commit d27fd1d

Please sign in to comment.