+from pymol import cmd, stored, math
+import time
+
+cmd.load('plik.pdb')
+mol='plik'
+obj=cmd.get_object_list(mol)[0]
+inFile = open('fluctuations.txt', 'r')
+
+cmd.iterate("first %s and polymer and n. CA" % mol,"stored.first=resv")
+counter=stored.first
+
+bfacts=[]
+for line in inFile.readlines():
+ bfact=float(line)
+ bfacts.append(bfact)
+ cmd.alter("%s and resi %s and n. CA"%(mol,counter), "b=%s"%bfact)
+ counter=counter+1
+
+#cmd.hide("all")
+#cmd.show_as("stick", "name ca")
+
+cmd.show_as("cartoon",mol)
+cmd.cartoon("putty", mol)
+cmd.set("cartoon_putty_scale_min", min(bfacts),obj)
+cmd.set("cartoon_putty_scale_max", max(bfacts),obj)
+cmd.set("cartoon_putty_transform", 7,obj)
+cmd.set("cartoon_putty_radius", 0.3,obj)
+
+cmd.spectrum("b","rainbow", "%s and n. CA " %mol)
+cmd.ramp_new("count", obj, [min(bfacts), max(bfacts)], "rainbow")
+cmd.recolor()
+cmd.bg_color("white")
+#cmd.zoom("all",7)
+#cmd.set("all_states","on")
+cmd.save("fluct.pse")
+cmd.png("fluct.png",500,400,ray=1)
+cmd.quit()
+
+