Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions api/config_sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,34 @@
$dials_rest_jwt = "";
$dials_rest_url_rings = false;

# Upstream reprocessing pipelines, by beamline type
$upstream_reprocessing_pipelines = array(
'sm' => array(
array('NAME' => 'Xia2 DIALS', 'VALUE' => 'xia2-dials'),
array('NAME' => 'Xia2 DIALS aimless', 'VALUE' => 'xia2-dials-aimless'),
),
'default' => array(
array('NAME' => 'Xia2 DIALS', 'VALUE' => 'xia2-dials'),
array('NAME' => 'Xia2 3dii', 'VALUE' => 'xia2-3dii'),
array('NAME' => 'Fast DP', 'VALUE' => 'fast_dp'),
array('NAME' => 'autoPROC', 'VALUE' => 'autoPROC'),
),
);

# Downstream reprocessing pipelines, by beamline type
$downstream_reprocessing_pipelines = array(
'sm' => array(
array('NAME' => 'shelxt', 'VALUE' => 'trigger-shelxt'),
),
'default' => array(
array('NAME' => 'Dimple', 'VALUE' => 'trigger-dimple'),
array('NAME' => 'Fast EP', 'VALUE' => 'trigger-fastep'),
array('NAME' => 'Big EP', 'VALUE' => 'trigger-bigep'),
array('NAME' => 'MrBUMP', 'VALUE' => 'trigger-mrbump'),
),
);


# Add a button to upload file to CCP4 cloud
#$ccp4_cloud_upload_url = 'https://data.cloud.ccp4.ac.uk/api/data/<%=USERNAME%>/<%=FACILITYNAME%>/<%=IMAGEPREFIX%>_<%=DATACOLLECTIONNUMBER%>/upload';
?>
12 changes: 7 additions & 5 deletions api/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ function setupApplication($mode): Slim
$valid_components, $enabled_container_types, $synchweb_version, $redirects,
$shipping_service_app_url, $use_shipping_service_redirect, $use_shipping_service_redirect_incoming_shipments,
$dials_rest_url_rings, $closed_proposal_link, $ccp4_cloud_upload_url,
$only_staff_can_assign, $industrial_prop_codes, $prop_codes_data_deleted, $container_types_with_parents,
$bl_capacity;
$only_staff_can_assign, $industrial_prop_codes, $upstream_reprocessing_pipelines, $downstream_reprocessing_pipelines,
$prop_codes_data_deleted, $container_types_with_parents, $bl_capacity;
$app->contentType('application/json');
$options = $app->container['options'];
$app->response()->body(json_encode(array(
Expand All @@ -97,16 +97,18 @@ function setupApplication($mode): Slim
'valid_components' => $valid_components,
'enabled_container_types' => $enabled_container_types,
'synchweb_version' => $synchweb_version,
'redirects' => $redirects,
'shipping_service_app_url' => $use_shipping_service_redirect || $use_shipping_service_redirect_incoming_shipments ? $shipping_service_app_url : null,
'shipping_service_app_url_incoming' => $use_shipping_service_redirect_incoming_shipments ? $shipping_service_app_url : null,
'closed_proposal_link' => $closed_proposal_link,
'dials_rest_url_rings' => $dials_rest_url_rings,
'closed_proposal_link' => $closed_proposal_link,
'ccp4_cloud_upload_url' => $ccp4_cloud_upload_url,
'redirects' => $redirects,
'only_staff_can_assign' => $only_staff_can_assign,
'container_types_with_parents' => $container_types_with_parents,
'industrial_prop_codes' => $industrial_prop_codes,
'upstream_reprocessing_pipelines' => $upstream_reprocessing_pipelines,
'downstream_reprocessing_pipelines' => $downstream_reprocessing_pipelines,
'prop_codes_data_deleted' => $prop_codes_data_deleted ?? array(),
'container_types_with_parents' => $container_types_with_parents,
'bl_capacity' => $bl_capacity,
)));
});
Expand Down
9 changes: 9 additions & 0 deletions api/src/Downstream/Type/FastEp.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ function results() {
'ATOMS' => array(array('sad_fa.pdb file not found'))
);

$integrator = $this->_lookup_autoproc(
null,
$this->process['PARAMETERS']['scaling_id']
);
if ($integrator) {
$dat['PARENTAUTOPROCPROGRAM'] = $integrator['PROCESSINGPROGRAMS'];
$dat['PARENTAUTOPROCPROGRAMID'] = $integrator['AUTOPROCPROGRAMID'];
}

$ats = array();
$pdb = $this->_get_attachments("sad_fa.pdb");
if ($pdb) {
Expand Down
9 changes: 5 additions & 4 deletions api/src/Downstream/Type/LigandFit.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ function _get_model_appaid() {
}

function results() {
$json_data = "[]";
$json_filepath = $this->_get_ligandfit_results_json();
if (sizeof($json_filepath)) {
$json_path = $json_filepath[0]["FILEPATH"] . "/" . $json_filepath[0]["FILENAME"] ;
$json_data = file_get_contents($json_path);
} else {
$json_data = "[]";
$json_path = $json_filepath[0]["FILEPATH"] . "/" . $json_filepath[0]["FILENAME"];
if (file_exists($json_path)) {
$json_data = file_get_contents($json_path);
}
}
$dat = array();
$appaid = $this->_get_model_appaid();
Expand Down
9 changes: 5 additions & 4 deletions api/src/Downstream/Type/Shelxt.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ function _get_pdb() {
}

function results() {
$json_data = "[]";
$json_filepath = $this->_get_shelxt_results_json();
if (sizeof($json_filepath)) {
$json_path = $json_filepath[0]["FILEPATH"] . "/shelxt_results.json" ;
$json_data = file_get_contents($json_path);
} else {
$json_data = "[]";
$json_path = $json_filepath[0]["FILEPATH"] . "/shelxt_results.json";
if (file_exists($json_path)) {
$json_data = file_get_contents($json_path);
}
}
$dat = array();
$dat['BLOBS'] = 1;
Expand Down
41 changes: 15 additions & 26 deletions api/src/Page/Fault.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,19 +308,14 @@ function _update_fault()
# Return a list of beamlines with ids
function _get_beamlines()
{
$row_tmp = $this->db->pq("SELECT distinct beamlinename as name FROM blsession WHERE beamlinename NOT LIKE 'i04 1' ORDER BY beamlinename");
$row_tmp = $this->db->pq("SELECT distinct beamlinename as name FROM blsession WHERE beamlinename != '' ORDER BY beamlinename");
$rows = array();
foreach ($row_tmp as $r)
{
array_push($rows, array('NAME' => $r['NAME']));
}

// $rows = array(array('NAME' => 'i02'), array('NAME' => 'i03'), array('NAME' => 'i04'), array('NAME' => 'i04-1'), array('NAME' => 'i24'));

$bls = array();
foreach ($rows as $r)
$bls[$r['NAME']] = $r['NAME'];
$this->_output($this->has_arg('array') ? $bls : $rows);
$this->_output($rows);
}

# ------------------------------------------------------------------------
Expand Down Expand Up @@ -348,19 +343,18 @@ function _get_systems()

$rows = $this->db->pq("SELECT s.systemid, s.name, s.description, string_agg(hs.beamlinename) as beamlines FROM bf_system s INNER JOIN bf_system_beamline hs ON s.systemid = hs.systemid " . $where . " GROUP BY s.systemid, s.name, s.description ORDER BY s.name", $args);

$sys = array();
foreach ($rows as $s)
$sys[$s['SYSTEMID']] = $s['NAME'];

$this->_output($this->has_arg('array') ? $sys : $rows);
$this->_output($rows);
}

# ------------------------------------------------------------------------
# Return a list of components for a system on a beamline
function _get_components()
{
if (!$this->has_arg('sid'))
$this->_error('No systemid specified');
if (!$this->has_arg('sid')) {
$this->_output(array());
return;
}

$args = array($this->arg('sid'));

if ($this->has_arg('bl'))
Expand All @@ -381,19 +375,18 @@ function _get_components()

$rows = $this->db->pq('SELECT c.componentid, c.name, c.description, string_agg(hc.beamlinename) as beamlines FROM bf_component c INNER JOIN bf_component_beamline hc ON c.componentid = hc.componentid WHERE c.systemid=:1' . $where . ' GROUP BY c.componentid, c.name, c.description ORDER BY beamlines,c.name', $args);

$com = array();
foreach ($rows as $c)
$com[$c['COMPONENTID']] = $c['NAME'];

$this->_output($this->has_arg('array') ? $com : $rows);
$this->_output($rows);
}

# ------------------------------------------------------------------------
# Return a list of subcomponents for a component on a beamline
function _get_subcomponents()
{
if (!$this->has_arg('cid'))
$this->_error('No componentid specified');
if (!$this->has_arg('cid')) {
$this->_output(array());
return;
}

$args = array($this->arg('cid'));

if ($this->has_arg('bl'))
Expand All @@ -414,11 +407,7 @@ function _get_subcomponents()

$rows = $this->db->pq('SELECT s.subcomponentid, s.name, s.description, string_agg(hs.beamlinename) as beamlines FROM bf_subcomponent s INNER JOIN bf_subcomponent_beamline hs ON s.subcomponentid = hs.subcomponentid WHERE s.componentid=:1' . $where . ' GROUP BY s.subcomponentid, s.name, s.description ORDER BY s.name', $args);

$scom = array();
foreach ($rows as $s)
$scom[$s['SUBCOMPONENTID']] = $s['NAME'];

$this->_output($this->has_arg('array') ? $scom : $rows);
$this->_output($rows);
}


Expand Down
4 changes: 2 additions & 2 deletions api/src/Page/Sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class Sample extends Page
's' => '\w+',
'prop' => '\w+\d+',
'term' => '\w+',
'pid' => '\d+',
'sid' => '\d+',
'pid' => '-?\d+',
'sid' => '-?\d+',
'ssid' => '\d+',
'cid' => '\d+',
'crid' => '\d+',
Expand Down
5 changes: 5 additions & 0 deletions client/src/js/modules/dc/views/autointegration.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ define(['marionette',
}

this.$el.slideDown()

if (typeof this.getOption('onReady') === 'function') {
this.getOption('onReady')(this)
}

}

})
Expand Down
22 changes: 14 additions & 8 deletions client/src/js/modules/dc/views/dc.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,20 @@ define(['marionette',
} else this.strat.$el.slideToggle()
},

loadAP: function(e) {
loadAP: function(e, callback) {
if (!this.ap) {
this.ap = new DCAutoIntegrationView({
id: this.model.get('ID'),
dcPurgedProcessedData: this.model.get('PURGEDPROCESSEDDATA'),
el: this.$el.find('div.autoproc'),
parent: this.model
})
} else this.ap.$el.slideToggle()
id: this.model.get('ID'),
dcPurgedProcessedData: this.model.get('PURGEDPROCESSEDDATA'),
el: this.$el.find('div.autoproc'),
parent: this.model,
onReady: callback
})
} else {
this.ap.$el.slideToggle(() => {
if (callback) callback(this.ap);
});
}
},


Expand All @@ -185,7 +190,8 @@ define(['marionette',
id: this.model.get('ID'),
dcPurgedProcessedData: this.model.get('PURGEDPROCESSEDDATA'),
el: this.$el.find('div.downstream'),
holderWidth: this.$el.find('.holder').width()
holderWidth: this.$el.find('.holder').width(),
upstreamLink: true,
})
} else this.dp.$el.slideToggle()
},
Expand Down
21 changes: 14 additions & 7 deletions client/src/js/modules/dc/views/downstream.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,17 @@ define(['backbone', 'marionette',
'modules/dc/views/bigep',
'modules/dc/views/shelxt',
'modules/dc/views/ligandfit',
'templates/dc/downstreamerror.html'

], function(Backbone, Marionette, TabView, DownStreams, DownstreamWrapper,
TableView,
FastEP, DIMPLE, MrBUMP, BigEP, Shelxt, LigandFit, downstreamerror) {
FastEP, DIMPLE, MrBUMP, BigEP, Shelxt, LigandFit) {

var dcPurgedProcessedData = "0"; // dataCollection.PURGEDPROCESSEDDATA via options from DC.js

var DownstreamsCollection = Backbone.Collection.extend()

var DownStreamError = Marionette.ItemView.extend({
template: downstreamerror
template: _.template('<p>This processing job failed: <%-PROCESS.PROCESSINGMESSAGE%></p>')
})

var DownStreamRunning = Marionette.ItemView.extend({
Expand Down Expand Up @@ -69,12 +68,17 @@ define(['backbone', 'marionette',
'LigandFit': LigandFit,
}

if (model.get('PROCESS').PROCESSINGSTATUS != 1) {
if (model.get('PROCESS').PROCESSINGSTATUS == null) {
return DownstreamWrapper.extend({
links: false,
dcPurgedProcessedData,
childView: model.get('PROCESS').PROCESSINGSTATUS == null
? DownStreamRunning : DownStreamError
childView: DownStreamRunning
})
} else if (model.get('PROCESS').PROCESSINGSTATUS != 1) {
return DownstreamWrapper.extend({
mapLink: false,
dcPurgedProcessedData,
childView: DownStreamError
})
}

Expand Down Expand Up @@ -106,6 +110,7 @@ define(['backbone', 'marionette',
}
},
DCID: this.getOption('DCID'),
upstreamLink: this.getOption('upstreamLink'),
}
},

Expand All @@ -128,6 +133,7 @@ define(['backbone', 'marionette',
downstreams: this.getOption('downstreams'),
DCID: this.getOption('id'),
mapButton: this.getOption('mapButton'),
upstreamLink: this.getOption('upstreamLink'),
}
},

Expand Down Expand Up @@ -175,7 +181,8 @@ define(['backbone', 'marionette',
downstreams: this.collection,
id: this.getOption('id'),
el: this.$el.find('.res'),
holderWidth: this.$el.parent().width()
holderWidth: this.$el.parent().width(),
upstreamLink: this.getOption('upstreamLink'),
}))
} else {
this.$el.addClass('ui-tabs')
Expand Down
Loading
Loading