Daniel,
the error lies in your php there :
$ESTADO=$_POST["ESTADO"];
echo "<!-- /***** Jmol Embedded Script ****
?php echo $ESTADO; ?
**/  -->";

the parts in red shall be removed

echo "<!-- /***** Jmol Embedded Script ****
$ESTADO
**/  -->";

See the testpage2.php file attached
<?php

include("utility.php");

echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\";>
<!--<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd\";>-->
<HTML xmlns=\"http://www.w3.org/1999/xhtml\";>";

$JMOLFOLDER="Jmol-12new";

echo "<HEAD>
	<script type=\"text/javascript\" src=\"$JMOLFOLDER/Jmol.js\"></script>
	
	<TITLE>TEST PAGE 2!!</TITLE>
	
	<META http-equiv=Content-Style-Type content=text/css><LINK href=\"style_daniel.css\" type=text/css rel=stylesheet>


</HEAD>";

echo "<BODY>";
echo "<div id=\"page_wrapper\">";

echo "<DIV id=page_Jmolcol>";
			
$title1="Jmol views";


$pdb=$_POST["pdb"];
$chain=$_POST["chain"];
$code=$pdb."_".$chain;
$ZIPtoUSE=$_POST["ziptouse"];
$ESTADO=$_POST["ESTADO"];
echo "<!-- /***** Jmol Embedded Script ****
$ESTADO;
**/  -->";
$File = "ESTADO.spt";
$f = fopen($File, 'w') or die("Cannot create file $File");
fwrite($f, $ESTADO);
fclose($f);



$prefix="SA";

$range="0 100";
$JMOL = "<script type=\"text/javascript\">
	jmolInitialize(\"$JMOLFOLDER\", true);
	jmolSetAppletColor(\"white\");
	var jmolcmds = [
		\"load $ZIPtoUSE|$prefix-Models_$code/$prefix-$code.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 isosurfacePropertySmoothing TRUE\",
		\"set showAxes true\",
		\"set appendNew true\",
		\"frame all\",
		\"display all\",
		\"select 1.1; cartoon; set propertyColorScheme 'bwr'; color atoms property temperature ABSOLUTE $range\",
		\"script myJMOLfunctions.spt\"
	 					];
	jmolApplet([580,500], jmolcmds.join(\"; \"));
</script>";
$JMOL .= "<form action=\"\"><script>jmolButton(\"reset\", \"Original orientation\");
	jmolButton(\"move 360 0 0 0 0 0 0 0 20\", \"Rotate X axis\");
	jmolButton(\"move 0 360 0 0 0 0 0 0 20\", \"Rotate Y axis\");
	jmolButton(\"write image.png\", \"Create image\");
</script></form><br>";


$JMOL .= '<script>function restoreState(){jmolScript(document.body.innerHTML)}; jmolButton([restoreState], "RESTORE");</script></form>';


centerbox($title1, $JMOL, "#996666");
echo "</DIV>";











//RESIDUE SELECTION

//models_map
$mapfile="MAPmodel_".$code.".txt";
$modelsmap_HASH="";
$modelsmap_arr = file($mapfile);
foreach($modelsmap_arr as $line){//con php, funcion file, en vez de meter chomp, meto un preg_replace para quitar el espacio final
	$line=preg_replace("/\s$/", "", $line);
	$line_arr=preg_split("/\t/", $line);
	$key=$line_arr[0];
	$value=$line_arr[1];
	$modelsmap_HASH[$key]=$value;
}
						
						

$title5="Residue selection";
echo "<DIV id=page_featcol>";
$contenuto5 = "<div style=\"height:338px; overflow-y: auto; overflow-x: auto; background-color:#ffffff;\">";
$contenuto5 .= "<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"3\" bgcolor=\"#ffffff\">";
						
$contenuto5 .= "<tr><th colspan=2>Native coordinates</th>
<th colspan=2>Models coordinates</th>
<th>d(&#197)</th></tr>";
$contenuto5 .= "<form action=\"\">";
$color_rows = 0;
foreach(array_keys($modelsmap_HASH) as $natres){
	$modres=$modelsmap_HASH[$natres];
	$nat_arr=preg_split("/_/", $natres);
	$select_nat=$nat_arr[2].":".$nat_arr[1];
	if ($color_rows%2!=0) {
		$contenuto5 .="<tr valign=\"middle\" bgcolor=\"#F5F5F5\">"; 
	} 
	else {
		$contenuto5 .="<tr valign=\"middle\" bgcolor=\"#D8D8D8\">";
	}
	$color_rows++;
		
	$contenuto5.="<td>$natres</td>";
	
	$contenuto5 .= '<td><script>
		jmolCheckbox("colorLabel(\'NAT\',\'NO\',\'manual res\',\''.$select_nat.'\',\'ONE\')", "DELcolorLabel(\'NAT\',\''.$select_nat.'\',\'ONE\')", "native");
	</script></td>';
		
	$contenuto5.="<td>$modres</td>";
	
	$posmod = strpos($modres, "GAP");
	if ($posmod !== false){
		$contenuto5 .= "<td>X</td><td>X</td></tr>";
	}
	else{
		$mod_arr=preg_split("/_/", $modres);
		$select_mod=$mod_arr[2].":".$mod_arr[1];
		
		$contenuto5 .= '<td><script>
			jmolCheckbox("colorLabel(\'MOD\',\'NO\',\'manual res\',\''.$select_mod.'\',\'ONE\')", "DELcolorLabel(\'MOD\',\''.$select_mod.'\',\'ONE\')", "loaded models");
		</script></td>';
				
		$contenuto5 .= '<td><script>
			jmolCheckbox("crossMeasure(\''.$select_nat.'\',\''.$select_mod.'\',\'NO\')", "DELcrossMeasure(\''.$select_nat.'\',\''.$select_mod.'\')", "");
		</script></td></tr>';
	}
}
$contenuto5 .= "</form></table></div><br><br>";
centerbox($title5, $contenuto5, "#996666");
echo "</DIV>";

































//MODEL LOAD
$HASHJM="";
$zip = zip_open($ZIPtoUSE);
while ($zip_entry = zip_read($zip)) {
	$entry_name=zip_entry_name($zip_entry);
	$ename=preg_replace("/^$prefix-Models_$code\//", "", $entry_name);
	$pos = strpos($ename, "GDTTS");
	if ($pos !== false){
		$file_arr=preg_split("/-/", $ename);
		$nummod=$file_arr[1];
		$HASHJM[$nummod]["FILE"]=$entry_name;//incluye el directorio
		
		$file_arr=preg_split("/_/", $ename);
//9-11AS_A_model_1e1o_A_temp_Probab_92.84_E-value_0.0098_Score_34.35_Aligned_cols_269:327_82.26_Identities_21_RMSD_2.72_GDTTS_37.08_LGAS3_30.72_LGAQ_5.50.pdb
		$count_arr=count($file_arr);
		$c=$count_arr -1;
		
		$lq=$file_arr[$c];
		$HASHJM[$nummod]["LGAQ"]=preg_replace("/\.pdb$/", "", $lq);
		$HASHJM[$nummod]["LGAS3"]=$file_arr[$c -2];
		$HASHJM[$nummod]["GDTTS"]=$file_arr[$c -4];
		$HASHJM[$nummod]["RMSD"]=$file_arr[$c -6];
		$HASHJM[$nummod]["IDENTS"]=$file_arr[$c -8];
		$HASHJM[$nummod]["COLS"]=$file_arr[$c -11]."(".$file_arr[$c -10].")";
		$HASHJM[$nummod]["SCORE"]=$file_arr[$c -14];
		$HASHJM[$nummod]["EVAL"]=$file_arr[$c -16];
		$HASHJM[$nummod]["PROB"]=$file_arr[$c -18];
		$HASHJM[$nummod]["TEMP"]=$file_arr[$c -22]."_".$file_arr[$c -21];
	}
}


echo "<DIV id=page_modelcol>";
$title1b="$code MODELS";

$JMOLb = "<form action=\"\" name=\"NATFORM\"><b>NATIVE STRUCTURE ($pdb - CHAIN $chain)</b><br><table width=\"70%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\" bgcolor=\"#ffffff\">";

$JMOLb .= "<tr><th><script>
jmolCheckbox(\"display displayed, 1.1\", \"hide hidden, 1.1\", \"SHOW/HIDE STRUCTURE\", \"true\");
</script></th>";

$JMOLb .= "<th><input type=\"checkbox\" onClick='jmolScriptWait(\"frame 1.1; isosurface NATSAS select {1.1} sasurface 1.2 map color ABSOLUTE $range property temperature colorscheme bwr; isosurface NATSOLV select {1.1} solvent 1.2 map color ABSOLUTE $range property temperature colorscheme bwr; frame all; hide hidden; color isosurface translucent 8.5; isosurface NATSAS off;\"); document.NATFORM.natsurf.options[1].selected=true; this.disabled=true'>Render surface before showing it (this can take a couple of minutes)</th></tr>";

$JMOLb .= "<tr><th><script>
	jmolMenu([
		[\"select 1.1; spacefill off; cartoon off; trace off; backbone off\", \"hide except checked residues\"],
		[\"select 1.1; spacefill; cartoon off; trace off; backbone off\", \"spacefill\"],
		[\"select 1.1; spacefill off; cartoon; trace off; backbone off\", \"cartoon\", \"selected\"],
		[\"select 1.1; spacefill off; cartoon off; trace 40; backbone off\", \"trace\"],
		[\"select 1.1; spacefill off; cartoon off; trace off; backbone 40\", \"backbone\"]
	]);
</script></th>";





$JMOLb .= "<th><span><select name=\"natsurf\" onChange='jmolScriptWait(this.options[this.selectedIndex].value);'>
	<option selected=\"selected\" value=\"isosurface NATSAS off; isosurface NATSOLV off\">Hide surfaces</option>
	<option value=\"isosurface NATSAS off; isosurface NATSOLV on; color isosurface translucent 8.5;\">Show translucent solvent excluded surface</option>
	<option value=\"isosurface NATSAS off; isosurface NATSOLV on; color isosurface opaque;\">Show opaque solvent excluded surface</option>
	<option value=\"isosurface NATSOLV off; isosurface NATSAS on; color isosurface translucent 8.5;\">Show translucent solvent accessible surface</option>
	<option value=\"isosurface NATSOLV off; isosurface NATSAS on; color isosurface opaque;\">Show opaque solvent accessible surface</option>
</select></span></th></tr></table></form>";


$JMOLb .= "<div style=\"height:130px; overflow-y: auto; overflow-x: auto; background-color:#ffffff;\">";
$JMOLb .= "<div style=\"width:1700px; overflow-y: auto; overflow-x: auto; background-color:#ffffff;\">";




$JMOLb .= "<form action=\"\" name=\"FORMOD\"><table  class=\"tablesorter\" width=\"100%\" border=\"1\" cellspacing=\"3\" cellpadding=\"3\"><thead><tr>
	<th class=\"\">LOAD</th>
	<th class=\"\">SHOW/HIDE</th>
	<th class=\"\">Model (HHsearch template numbering)</th>
	<th class=\"\">SURFACES</th>
	<th class=\"header\">template</th>
	<th class=\"header\">prob</th>
	<th class=\"header\">e-value</th>
	<th class=\"header\">score</th>
	<th class=\"header\">Aligned cols(%)</th>
	<th class=\"header\">%identity</th>
	<th class=\"header\">RMSD</th>
	<th class=\"header\">GDT-TS</th>
	<th class=\"header\">LGA_S3</th>
	<th class=\"header\">LGA_Q</th></tr></thead><tbody>";

ksort($HASHJM, SORT_NUMERIC);
$color_rows = -1;


foreach(array_keys($HASHJM) as $nmod){
	$F=$HASHJM[$nmod]["FILE"];
	$lgaq=$HASHJM[$nmod]["LGAQ"];
	$lgas3=$HASHJM[$nmod]["LGAS3"];
	$gdt=$HASHJM[$nmod]["GDTTS"];
	$rmsd=$HASHJM[$nmod]["RMSD"];
	$idents=$HASHJM[$nmod]["IDENTS"];
	$cols=$HASHJM[$nmod]["COLS"];
	$score=$HASHJM[$nmod]["SCORE"];
	$eval=$HASHJM[$nmod]["EVAL"];
	$prob=$HASHJM[$nmod]["PROB"];
	$temp=$HASHJM[$nmod]["TEMP"];
	
	
	$JMOLb .= "<tr><td><input type=\"checkbox\" id=\"id_$nmod\" onClick='jmolScriptWait(\"load append $ZIPtoUSE|$F; select @{(_lastFrame)}; cartoon only; color atoms property temperature ABSOLUTE $range; frame all; hide hidden;\"); var LF=jmolEvaluate(\"_lastFrame\"); var rendertext=document.getElementById(\"rendercell_$nmod\").innerHTML; newrender=rendertext.replace(/none/g,LF); document.getElementById(\"rendercell_$nmod\").innerHTML=newrender; var showhidetext=document.getElementById(\"showhide_$nmod\").innerHTML; newshowhide=showhidetext.replace(/none/g,LF); document.getElementById(\"showhide_$nmod\").innerHTML=newshowhide; var menutext=document.getElementById(\"menu_$nmod\").innerHTML; newmenu=menutext.replace(/none/g,LF); document.getElementById(\"menu_$nmod\").innerHTML=newmenu; this.disabled=true; document.getElementById(\"render_$nmod\").disabled=false; document.getElementById(\"show_$nmod\").checked=true'></td>";
	
	$JMOLb .= "<td id=\"showhide_$nmod\"><input type=\"checkbox\" id=\"show_$nmod\" onClick='if(this.checked==true)
		jmolScriptWait(\"display displayed, none;\")
	if(this.checked==false)
		jmolScriptWait(\"hide hidden, none;\")'></td>";

	$JMOLb .= "<td id=\"menu_$nmod\"><b>MODEL $nmod  </b>
		<span><select onChange='jmolScriptWait(this.options[this.selectedIndex].value);'>
			<option value=\"select none; spacefill off; cartoon off; trace off; backbone off;\">hide except checked residues</option>
			<option value=\"select none; spacefill; cartoon off; trace off; backbone off;\">spacefill</option>
			<option selected=\"selected\" value=\"select none; spacefill off; cartoon; trace off; backbone off;\">cartoon</option>
			<option value=\"select none; spacefill off; cartoon off; trace 40; backbone off;\">trace</option>
			<option value=\"select none; spacefill off; cartoon off; trace off; backbone 40;\">backbone</option>
		</select></span>
	</td>";						
	
	
	
	$JMOLb .= "<td id=\"rendercell_$nmod\"><input type=\"checkbox\" id=\"render_$nmod\" onClick='jmolScriptWait(\"frame none; isosurface SAS_$nmod select {none} sasurface 1.2 map color ABSOLUTE $range property temperature colorscheme bwr; isosurface SOLV_$nmod select {none} solvent 1.2 map color ABSOLUTE $range property temperature colorscheme bwr; frame all; hide hidden; color isosurface translucent 8.5; isosurface SAS_$nmod off;\"); document.FORMOD.surfmod$nmod.options[1].selected=true; this.disabled=true'>Render ";

	$JMOLb .= "<span><select name=\"surfmod$nmod\" onChange='jmolScriptWait(this.options[this.selectedIndex].value);'>
		<option value=\"isosurface SAS_$nmod off; isosurface SOLV_$nmod off\">Hide surfaces</option>
		<option selected=\"selected\" value=\"isosurface SAS_$nmod off; isosurface SOLV_$nmod on; color isosurface translucent 8.5\">Show translucent solvent excluded surface</option>
		<option value=\"isosurface SAS_$nmod off; isosurface SOLV_$nmod on; color isosurface opaque\">Show opaque solvent excluded surface</option>
		<option value=\"isosurface SOLV_$nmod off; isosurface SAS_$nmod on; color isosurface translucent 8.5\">Show translucent solvent accessible surface</option>
		<option value=\"isosurface SOLV_$nmod off; isosurface SAS_$nmod on; color isosurface opaque 8.5\">Show opaque solvent accessible surface</option>
	</select></span></td>";


	
	$JMOLb .="<td>$temp</td>
		<td>$prob</td>
		<td>$eval</td>
		<td>$score</td>
		<td>$cols</td>
		<td>$idents</td>
		<td>$rmsd</td>
		<td>$gdt</td>
		<td>$lgas3</td>
		<td>$lgaq</td></tr>";
}

$JMOLb .= "</table></form></div></div>";
	
centerbox($title1b, $JMOLb, "#996666");
echo "</DIV>";


















echo "</div>";	
echo "</BODY>";
?>

Paul

Le 26 août 2011 à 12:35, Daniel Carbajo a écrit :

DanCarb%x

------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to