Apart from the atoms[i].model problem, I always find trouble when passing
the variables from php to a function...
If I pass '104:A' like this:
$content .= '<td><script>
jmolCheckbox("myfunction(\' '.$residue.' \')", ..........
How can I, inside the function, especify 104:A.ca as a variable that I can
use in the function? I try this:
function myfunction(res){
var atoms="{" + res + ".ca}"
var n = atoms.length
var fileNameArray = getProperty("modelInfo.models.file")
for (var i = 1; i <= n; i++) {
atoms[i].label = "***%M - " + atoms[i].model + " - lig bin res
%n_%c_%r temperature=%b"
}
}
But this obviously does not work... so which should be the correct way to
define "atoms" (104:A.ca) out of "res" (104:A)? Thanks!
Daniel
2011/4/8 Daniel Carbajo <daniel.carb...@gmail.com>
> I am close to it but a strange things happens; I apply this on console when
> I have 3 proteins loaded (the native structure plus two homology models):
> var natmod = "MOD"
> var desc = "SS"
> var atoms = {104:A.ca}
> var info = "lig bin res"
>
> var fileNameArray = getProperty("modelInfo.models.file")
> var n = atoms.length
> if (desc == "SS"){
> var sarray = ["H","B","E","G","I","T","S","U"]
> for (var i = 1; i <= n; i++) {
> atoms[i].label = "***%M - " + atoms[i].model + " - " + info +
> " %n_%c_%r " + desc + ":" + sarray[atoms[i].temperature]
>
> }
> }
> else{
> for (var i = 1; i <= n; i++) {
> atoms[i].label = "***%M - " + atoms[i].model + " - " + info +
> " %n_%c_%r " + desc + ":%b"
>
> }
> }
> font label 14 serif bold
> color label black
>
>
> So I get correclty 3 atoms labeled, but atoms[i].model turns out to be 1
> in all three situations, I get the following labels:
>
> ***1.1 - 1 - lig bin res PHE_A_104 SS:H
> ***2.1 - 1 - lig bin res PHE_A_104 SS:H
> ***3.1 - 1 - lig bin res PHE_A_104 SS:H
>
> And so when I extract the file name I get always the same... (by the way:
> can I parse the file name removing everything before the last "/" and the
> ".pdb" at the end?). What am I doing wrong? I do not get it...
> Thanks!
>
------------------------------------------------------------------------------
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