Average b

From PyMOLWiki
Jump to: navigation, search

Contents

average_b.py

usage

author

Gregor Hagelueken

code

from pymol import cmd,stored
def average_b(selection):
	stored.tempfactor = 0
	stored.atomnumber = 0
	cmd.iterate(selection, "stored.tempfactor = stored.tempfactor + b")
	cmd.iterate(selection, "stored.atomnumber = stored.atomnumber + 1")
	print "Your selection: %s" % selection
	print "sum of B factors: %s" % stored.tempfactor
	print "number of atoms: %s" % stored.atomnumber
	averagetempfactor = stored.tempfactor / stored.atomnumber
	print "average B of '%s': %s" % (selection, averagetempfactor)
cmd.extend("average_b", average_b)
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox