On Thu, Apr 7, 2011 at 8:17 AM, Daniel Carbajo <daniel.carb...@gmail.com>wrote:

> Apart from the "show measures in an echo" issue, now that you know more or
> less how my php page works, I wanted to ask you also the following:
>
> I have this php associative array that relates numbers to secondary
> structures:
> $SS_hash=array(1.0 => "H", "2.0" => "B", "3.0" => "E", "4.0" => "G", "5.0"
> => "I", "6.0" => "T", "7.0" => "S", "8.0" => "U");
>
> and I have this Jmol code to select and label residues:
> $contenuto2 .= "<td><script>
>      jmolCheckbox(\"subset 1.1 and visible; select $select_r; wireframe 80;
> select $select_r.ca; label ***%M - lig bind res \%n_\%c_\%r secondary
> structure=%b; font label 14 serif bold; color label black; subset\",
> \"subset 1.1 and visible; select $select_r; wireframe off; label off;
> subset\", \"native\");
> </script></td>";
>
> But instead of %b (temperature, which is 1.0, 2.0, 3.0, ..., 8.0), I want
> to show $SS_hash[%b], is this possible anyhow? I have been trying several
> possibilities with no success...
>

I think you would just set up the array in Jmol:

Var sarray = ["H","B","E","G","I","T","S","U"]

and then something like this:

Var atoms = {*.CA}
Var n = atoms.length
for (var i = 1; i <= n){
  atoms[i].label = "***%M - lig bind res %n_%c_%r secondary structure=" +
sarray[atoms[i].temperature]
}




> On the other hand, instead of %M (model frame), I would like to show THE
> FILENAME correspondent to that frame, I guess this is impossible.... unless
> I populate a hash when I load each structure upon clicking a checkbox, and
> then I call $frameHASH[%M]..........
>
>
Var fileNameArray = getProperty("modelInfo.models.file")
Var atoms = {*.CA}
Var n = atoms.length
for (var i = 1; i <= n){
  atoms[i].label = "***" + fileNameArray[atoms[i].model] + " - lig bind res
%n_%c_%r secondary structure=" + sarray[atoms[i].temperature]
}



 Bob


-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to