From: Sebastien M. <seb...@ig...> - 2005-10-26 15:37:20
|
>> I looked into this a little. I think the apbs script (its apbs.py or=20 >> something -- if you can't find it search for it on google) calls a=20 >> function called cmd.ramp_new() with a bunch of arguements. Apparently= =20 >> this 'ramp' is a built in c-level object. You maybe able to mimic the= =20 >> code in apbs. What part of the color ramp are you trying to use in=20 >> your app ? >> >> ~Dan >=20 >=20 > Hi Dan, > I saw this function in "apbs_tools.py": > ramp_name =3D 'e_lvl' > map_name =3D self.map.getvalue() > molecule_name =3D self.molecule.getvalue() > low =3D float(self.mol_surf_low.getvalue()) > mid =3D float(self.mol_surf_middle.getvalue()) > high =3D float(self.mol_surf_high.getvalue()) > range =3D [low,mid,high] > print "range is",range > pymol.cmd.delete(ramp_name) > pymol.cmd.ramp_new(ramp_name,map_name,range) > pymol.cmd.set('surface_color',ramp_name,molecule_name) > pymol.cmd.show('surface',molecule_name) > pymol.cmd.sort() >=20 > My range will be always the same, and the ramp_name too. > But, how to set map_name and molecule_name ? > With coordinates, or something else ? I found a way to add a legend box: load Legend.dx, map #with Legend.dx as an empty file zoom PDB_ID #to view our structure again ramp_new legend, map, [1.0,5.0,9.0], color=3D['C1',[1.0,1.0,1.0],'C9'] #legend is the object name for the names panel #map is the fake map #[1.0,5.0,9.0] is the legend range with # [min,medium,max] values #color C1 is the min color, and C9 the max color cmd.delete("map") #delete the map object I hope this will help someone. >>> Hello, >>> I try to make a legend box as apbs plugin does with colors it uses (t= he >>> box is set at the bottom of the visualization screen). >>> >>> Does someone know if a kind of tutorial exists for ? >>> >>> Thanks --=20 S=E9bastien Moretti http://www.igs.cnrs-mrs.fr/ CNRS - IGS 31 chemin Joseph Aiguier 13402 Marseille cedex |