ps - a much simpler way to do that in JavaScript is to use the \ character
at the end of a line to escape the line terminator:


     var jmolcmds = "\
          load $ZIPtoUSE|$folder/$native.pdb;\
          set frank off; select all; hbonds off; spin off; wireframe off;
spacefill off; trace off; set ambient 40; set specpower 40;\
          slab off;ribbons off; cartoons off; label off; monitor off;\
          set showAxes true;\
          set appendNew true;\
          frame all;\
          display all;\
          select 1.1;\
          var MIN = {selected}.temperature.min;\
          var MAX = {selected}.temperature.max;\
          cartoon; set propertyColorScheme 'bwr'; color atoms property
temperature ABSOLUTE MIN MAX;\
          script Jmol-12new/myJMOLfunctions.spt"

Then you can escape that if you really need to. What's with the escaping of
the JavaScript itself?


On Fri, Jul 29, 2011 at 4:42 AM, Daniel Carbajo <[email protected]>wrote:

> So what I would like to do is something like the following, which obviously
> does not work:
>
> $JMOL = "<script type=\"text/javascript\">
>      jmolInitialize(\"Jmol-12new\", true);
>      jmolSetAppletColor(\"white\");
>      var jmolcmds = [
>           \"load $ZIPtoUSE|$folder/$native.pdb\",
>           \"set frank off; select all; hbonds off; spin off; wireframe off;
> spacefill off; trace off; set ambient 40; set specpower 40; slab off;
> ribbons off; cartoons off; label off; monitor off\",
>           \"set showAxes true\",
>           \"set appendNew true\",
>           \"frame all\",
>           \"display all\",
>           \"select 1.1\",
>           \"var MIN = {selected}.temperature.min\",
>           \"var MAX = {selected}.temperature.max\",
>           \"cartoon; set propertyColorScheme 'bwr'; color atoms property
> temperature ABSOLUTE MIN MAX\",
>           \"script Jmol-12new/myJMOLfunctions.spt\"
>      ];
>      jmolApplet([580,500], jmolcmds.join(\"; \"));
> </script>";
>
> for each model:
> $JMOL .= "<input type=\"checkbox\" id=\"id_$nmod\"
> onClick='jmolScriptWait(\"load append $ZIPtoUSE|$folder/$model; select
> @{(_lastFrame)}; var MIN = {selected}.temperature.min; var MAX =
> {selected}.temperature.max; cartoon only; color atoms property temperature
> ABSOLUTE MIN MAX; frame all; hide hidden;\")'>;
>
>
> How should I do it? Thanks a lot,
> Daniel
>
>
>
>
>
>
>
>
> 2011/7/28 Daniel Carbajo <[email protected]>
>
>> Hello everyone,
>> I have one little problem that had gone unnoticed until now. I have a Jmol
>> window where I load one protein by default (a native structure) and a table
>> next to it that gives the possibility to load many proteins (all of them
>> models built by homology out of the native structure, so sharing the same
>> sequence), and I color them all based on their temperature factor records
>> (which I replace with other descriptors like solvent accessibilities, atom
>> depth inside a cavity, burial indexes or protrusion indexes, for which I do
>> not even now the range they span).
>> If I load one protein at first it is colored correctly, but if the same
>> protein is loaded in third position (the third protein loaded) for example,
>> it is colored following the same pattern but with more pale colors.
>> This makes me think that when I color the protein, the temperature factor
>> ranges taken into account are not the ones of the protein itself, but of all
>> the proteins loaded, how can I resolve this without using "temperature
>> absolute *range*", since I do not know the range for some descriptors
>> (they do not specify in the article)? I do it like this:
>>
>> $ZIPtoUSE-->zip file with the native structure plus the homology models
>> $folder-->folder inside the zip file
>> $native-->native structure, protein loaded by default
>> $model-->homology model, proteins that can be appended
>>
>> $JMOL = "<script type=\"text/javascript\">
>>      jmolInitialize(\"Jmol-12new\", true);
>>      jmolSetAppletColor(\"white\");
>>      var jmolcmds = [
>>           \"load $ZIPtoUSE|$folder/$native.pdb\",
>>           \"set frank off; select all; hbonds off; spin off; wireframe
>> off; spacefill off; trace off; set ambient 40; set specpower 40; slab off;
>> ribbons off; cartoons off; label off; monitor off\",
>>           \"set showAxes true\",
>>           \"set appendNew true\",
>>           \"frame all\",
>>           \"display all\",
>>           \"select 1.1; cartoon; set propertyColorScheme 'bwr'; color
>> atoms property temperature\",
>>           \"script Jmol-12new/myJMOLfunctions.spt\"
>>      ];
>>      jmolApplet([580,500], jmolcmds.join(\"; \"));
>> </script>";
>>
>> foreach model:
>> $JMOL .= "<input type=\"checkbox\" id=\"id_$nmod\"
>> onClick='jmolScriptWait(\"load append $ZIPtoUSE|$folder/$model; select
>> @{(_lastFrame)}; cartoon only; color atoms property temperature; frame all;
>> hide hidden;\")'>;
>>
>> If there is not a way I should investigate more and get the ranges
>> for atom depth inside a cavity, burial indexes and protrusion indexes, I
>> guess... Thanks a lot!
>> Daniel
>>
>>
>
>
> ------------------------------------------------------------------------------
> Got Input?   Slashdot Needs You.
> Take our quick survey online.  Come on, we don't ask for help often.
> Plus, you'll get a chance to win $100 to spend on ThinkGeek.
> http://p.sf.net/sfu/slashdot-survey
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>


-- 
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
------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to