Skip to content

Commit

Permalink
Merge pull request #486 from olofsvensson/issue_485
Browse files Browse the repository at this point in the history
Issue #485 :
  • Loading branch information
olofsvensson authored Jan 25, 2019
2 parents 5763b3d + e150ef4 commit 299d5eb
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 8 deletions.
23 changes: 20 additions & 3 deletions js/mx/view/phasingview/phasinggridview.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ PhasingGridView.prototype.printHTML = function(target) {
var values = phasingStep.statisticsValue.split(",");
for (var j = 0; j < singleMetric.length; j++) {
/* Spaces are replaced by _ to be used on the templates */
phasingStep[singleMetric[j].replace(/ /g, '_')] = values[j];
phasingStep[singleMetric[j].trim().replace(/ /g, '_')] = values[j];
}
}
if (phasingStep.png){
Expand Down Expand Up @@ -169,8 +169,11 @@ PhasingGridView.prototype.printHTML = function(target) {
} else if (step == "REFINEMENT") {
var refinedPdbFileId = -1;
var mrPdbFileId = -1;
var peaksFileId = -1;
var blobFileId = -1;
var mapsArr = steps[z].map.split(",");
var pdbsArr = steps[z].pdb.split(",");
var csvsArr = steps[z].csv.split(",");
if ("mapFileName" in steps[z]) {
var mapFileNamesArr = steps[z].mapFileName.split(",");
for (var i = 0; i < mapFileNamesArr.length; i++) {
Expand All @@ -191,6 +194,18 @@ PhasingGridView.prototype.printHTML = function(target) {
} else {
var pdbFileNamesArr = [];
}
if ("csvFileName" in steps[z]) {
var csvFileNamesArr = steps[z].csvFileName.split(",");
for (var i = 0; i < csvFileNamesArr.length; i++) {
if (csvFileNamesArr[i] == "peaks.csv") {
peaksFileId = csvsArr[i];
} else if (pdbFileNamesArr[i] == "blobs.csv") {
blobFileId = csvsArr[i];
}
}
} else {
var csvFileNamesArr = [];
}
if (mrPdbFileId != -1) {
index2FOFC_MR = mapFileNamesArr.indexOf("2FOFC_MR");
indexFOFC_MR = mapFileNamesArr.indexOf("FOFC_MR");
Expand All @@ -200,7 +215,8 @@ PhasingGridView.prototype.printHTML = function(target) {
var pdbUrl = EXI.getDataAdapter().mx.phasing.downloadPhasingFilesByPhasingAttachmentId( mrPdbFileId );
var mapUrl1 = EXI.getDataAdapter().mx.phasing.downloadPhasingFilesByPhasingAttachmentId( mapsArr[index2FOFC_MR]);
var mapUrl2 = EXI.getDataAdapter().mx.phasing.downloadPhasingFilesByPhasingAttachmentId( mapsArr[indexFOFC_MR]);
listUglyMol.push('../viewer/uglymol/index.html?pdb=' + pdbUrl + '&map1=' + mapUrl1 + '&map2=' + mapUrl2);
var peaks = EXI.getDataAdapter().mx.phasing.downloadPhasingFilesByPhasingAttachmentId(peaksFileId);
listUglyMol.push('../viewer/uglymol/index.html?pdb=' + pdbUrl + '&map1=' + mapUrl1 + '&map2=' + mapUrl2 + '&peaks=' + peaks);
}
}
if (refinedPdbFileId != -1) {
Expand All @@ -212,7 +228,8 @@ PhasingGridView.prototype.printHTML = function(target) {
var pdbUrl = EXI.getDataAdapter().mx.phasing.downloadPhasingFilesByPhasingAttachmentId( refinedPdbFileId );
var mapUrl1 = EXI.getDataAdapter().mx.phasing.downloadPhasingFilesByPhasingAttachmentId( mapsArr[index2FOFC_REFINE]);
var mapUrl2 = EXI.getDataAdapter().mx.phasing.downloadPhasingFilesByPhasingAttachmentId( mapsArr[indexFOFC_REFINE]);
listUglyMol.push('../viewer/uglymol/index.html?pdb=' + pdbUrl + '&map1=' + mapUrl1 + '&map2=' + mapUrl2);
var peaks = EXI.getDataAdapter().mx.phasing.downloadPhasingFilesByPhasingAttachmentId(peaksFileId);
listUglyMol.push('../viewer/uglymol/index.html?pdb=' + pdbUrl + '&map1=' + mapUrl1 + '&map2=' + mapUrl2 + '&peaks=' + peaks);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@

<th><abbr title="Phasing Step">PHASING</abbr></th>

<th><abbr title="Model Building Step">REFINEMENT</abbr></th>
<th><abbr title="Model Building Step">REFINEMENT</abbr></th>
<th>MR directory<br>(< 30 days)</th>
<th>Download</th>
<th style='color:gray'></th>
<th style='color:gray'>Program</th>
<th style='color:gray'>Method</th>
<th style='color:gray'>Resolution</th>
<th style='color:gray'>Start Rw / Rf</th>
<th style='color:gray'>Final Rw / Rf</th>
<th style='color:gray'>Electron density MR</th>
<th style='color:gray'>Electron density REFINE</th>
</tr>
Expand Down Expand Up @@ -52,6 +55,26 @@
{/eq}
{/eq}
</td>
<td>
<button type="button" class="btn btn-sm" data-toggle="modal" data-target="#myModal{.dataCollectionId}"><span class="glyphicon glyphicon-folder-close" aria-hidden="true"></span></button>
<!-- Modal -->
<div class="modal fade" id="myModal{.dataCollectionId}" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">MR directory - available up to 30 days</h4>
</div>
<div class="modal-body">
<p>{.PhasingProgramRun_phasingDirectory}</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</td>
<td >
{@eq key=$idx value=0}
<a href='{.downloadFilesUrl}' ><span style='font-size: 1.5em;' class="glyphicon glyphicon-download " ></span></a>
Expand All @@ -67,7 +90,9 @@

<td>{.PhasingProgramRun_phasingPrograms} </td>
<td>{.PhasingStep_method} </td>
<td>{.PhasingStep_highRes} - {.PhasingStep_lowRes} </td>
<td>{@decimal key="PhasingStep_highRes" decimals=1}{/decimal} - {@decimal key="PhasingStep_lowRes" decimals=1}{/decimal}</td>
<td>{@decimal key="Start_R-work" decimals=2}{/decimal} / {@decimal key="Start_R-free" decimals=2}{/decimal}</td>
<td>{@decimal key="Final_R-work" decimals=2}{/decimal} / {@decimal key="Final_R-free" decimals=2}{/decimal}</td>
{#listUglyMol}
{@eq key="{.}" value=""}
<td></td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@
<td>{.PhasingStep_highRes} - {.PhasingStep_lowRes} </td>
<td>{.PhasingStep_solventContent} </td>
<td>{@decimal key="Chain_Count" decimals=0}{/decimal} </td>
<td>{@decimal key="_Residues_Count" decimals=0}{/decimal} </td>
<td>{@decimal key="_Average_Fragment_Length" decimals=0}{/decimal} </td>
<td>{@decimal key="_CC_of_partial_model" decimals=2}{/decimal}</td>
<td>{@decimal key="Residues_Count" decimals=0}{/decimal} </td>
<td>{@decimal key="Average_Fragment_Length" decimals=0}{/decimal} </td>
<td>{@decimal key="CC_of_partial_model" decimals=2}{/decimal}</td>
<td>
{?uglymol}
<a><a target="_blank" href='{.uglymol}' ><span style='font-size: 1em;' class="glyphicon glyphicon-eye-open" ></span></a>
Expand Down
4 changes: 4 additions & 0 deletions viewer/uglymol/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,16 @@
console.log(getParameterByName("pdb"));
console.log(getParameterByName("map1"));
console.log(getParameterByName("map2"));
console.log(getParameterByName("peaks"));

V = new UM.Viewer({viewer: "viewer", hud: "hud", help: "help"});
V.load_pdb(getParameterByName("pdb"));
if (getParameterByName("map1")){
V.load_ccp4_maps(getParameterByName("map1"), getParameterByName("map2"));
}
if (getParameterByName("peaks")){
V.load_peaks(getParameterByName("peaks"), function(data){});
}
</script>
</body>
</html>
47 changes: 47 additions & 0 deletions viewer/uglymol/uglymol.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 299d5eb

Please sign in to comment.