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
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
39 changes: 21 additions & 18 deletions client/src/js/modules/dc/views/downstreamreprocess.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ define(['backbone', 'marionette', 'views/dialog',
this.model.set('PIPELINENAME', this.ui.pipeline.find('option:selected').text())
var btns = this.buttons
var warning = ''
if (!this.model.get('PIPELINENAME')) {
warning = ' No pipelines available'
btns = this.disabledButtons
}
if (['MrBUMP', 'Dimple'].includes(this.model.get('PIPELINENAME')) && this.type.includes('autoPROC')) {
warning = ' Cannot rerun ' + this.model.get('PIPELINENAME') + ' on ' + this.type + ' results'
btns = this.disabledButtons
Expand All @@ -112,15 +116,15 @@ define(['backbone', 'marionette', 'views/dialog',
warning = ' Cannot run Dimple as no PDBs defined'
btns = this.disabledButtons
}
if (this.model.get('PIPELINENAME') === 'MrBUMP' && this.model.get('HASSEQ') === 'No') {
if (this.model.get('PIPELINENAME') === 'MrBUMP' && (this.model.get('HASSEQ') === 'No' || !this.model.get('HASSEQ'))) {
warning = ' Cannot run MrBUMP as no sequence defined'
btns = this.disabledButtons
}
if (this.model.get('PIPELINENAME') === 'Fast EP' && (!this.model.get('ANOMALOUSSCATTERER'))) {
warning = ' Cannot run Fast EP as no anomalous scatterer defined'
btns = this.disabledButtons
}
if (this.model.get('PIPELINENAME') === 'Big EP' && this.model.get('HASSEQ') === 'No') {
if (this.model.get('PIPELINENAME') === 'Big EP' && (this.model.get('HASSEQ') === 'No' || !this.model.get('HASSEQ'))) {
warning = ' Cannot run Big EP as no sequence defined'
btns = this.disabledButtons
}
Expand Down Expand Up @@ -155,7 +159,7 @@ define(['backbone', 'marionette', 'views/dialog',


initialize: function(options) {
this.proteins = new Proteins(null, { queryParams: { sid: options.model.get('BLSAMPLEID') } })
this.proteins = new Proteins(null, { queryParams: { sid: options.model.get('BLSAMPLEID') || -1 } })
this._ready = this.proteins.fetch()
this._ready.done(this.doOnReady.bind(this))
this.scalingid = options.scalingid
Expand All @@ -169,24 +173,23 @@ define(['backbone', 'marionette', 'views/dialog',
},

onRender: function() {

this.pipelines = new Pipelines([
{ NAME: 'Dimple', VALUE: 'trigger-dimple' },
{ NAME: 'Fast EP', VALUE: 'trigger-fastep' },
{ NAME: 'Big EP', VALUE: 'trigger-bigep' },
{ NAME: 'MrBUMP', VALUE: 'trigger-mrbump' },
])

this.ui.pipeline.html(this.pipelines.opts())
const dspls = app.options.get('downstream_reprocessing_pipelines')
if (dspls) {
const pls = dspls[app.type] ?? dspls['default'];
this.pipelines = new Pipelines(pls)
this.ui.pipeline.html(this.pipelines.opts())
}
},

doOnReady: function() {
var protein = this.proteins.at(0)
var self = this
_.each(['ACRONYM','PROTEINID','HASSEQ','PDBS','ANOMALOUSSCATTERER'], function(k) {
self.model.set(k, protein.get(k))
})
this.pdbs = new PDBs(null, { pid: this.model.get('PROTEINID') })
if (protein) {
var self = this
_.each(['ACRONYM','PROTEINID','HASSEQ','PDBS','ANOMALOUSSCATTERER'], function(k) {
self.model.set(k, protein.get(k))
})
}
this.pdbs = new PDBs(null, { pid: this.model.get('PROTEINID') || -1 })
this.pdbs.fetch().done(this.updatePipeline.bind(this))
this.collection = new IDDataCollections()
if (this.model) {
Expand Down
75 changes: 62 additions & 13 deletions client/src/js/modules/dc/views/reprocess2.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ define(['backbone', 'marionette', 'views/dialog',


selectAll: function(e) {
e.preventDefault()
if (e) e.preventDefault()

var si = parseInt(this.model.get('SI'))
var ni = parseInt(this.model.get('NUMIMG'))
Expand Down Expand Up @@ -148,6 +148,20 @@ define(['backbone', 'marionette', 'views/dialog',
this.$el.find('div input[type="text"]').css('width', '50px')
this.ui.pipeline.html(this.getOption('pipelines').opts())
this.model.set('PIPELINE', this.ui.pipeline.val())

// check .distl element has been created before selecting all
const callback = (mutationList, observer) => {
for (const mutation of mutationList) {
for (const node of mutation.addedNodes) {
if (node.nodeType === Node.ELEMENT_NODE && node.querySelector('.distl')) {
this.selectAll()
observer.disconnect()
}
}
}
}
const observer = new MutationObserver(callback)
observer.observe(document.getElementById("dialog"), { childList: true, subtree: true })
},

toggleSG: function(e) {
Expand Down Expand Up @@ -247,6 +261,12 @@ define(['backbone', 'marionette', 'views/dialog',
sm: 'input[name=sm]',
indexingMethod: 'select[name=method]',
absorptionLevel: 'select[name=absorption_level]',
a: 'input[name=a]',
b: 'input[name=b]',
c: 'input[name=c]',
al: 'input[name=alpha]',
be: 'input[name=beta]',
ga: 'input[name=gamma]',
},

buttons: {
Expand All @@ -259,6 +279,7 @@ define(['backbone', 'marionette', 'views/dialog',
'click a.opt': 'toggleOpts',
'click @ui.ind': 'toggleIndividual',
'change @ui.pipeline': 'updatePipeline',
'change @ui.indexingMethod': 'updateIndexingMethod',
'click a.multicrystal': 'closeDialog',
},

Expand All @@ -276,11 +297,40 @@ define(['backbone', 'marionette', 'views/dialog',
}
},

updateIndexingMethod: function() {
if (this.ui.indexingMethod.val() == 'real_space_grid_search') {
const st = this.ui.ind.is(':checked')
if (st) {
let eachHasCell = true
this.distlview.children.each(function(v) {
if (!v.ui.a.val() || !v.ui.b.val() || !v.ui.c.val() ||
!v.ui.al.val() || !v.ui.be.val() || !v.ui.ga.val()) {
v.ui.cell.show()
eachHasCell = false
}
})
if (!eachHasCell) {
app.alert({ message: 'Real Space Grid Search requires unit cell to be populated' })
this.ui.indexingMethod.val('')
}
} else {
if (!this.ui.a.val() || !this.ui.b.val() || !this.ui.c.val() ||
!this.ui.al.val() || !this.ui.be.val() || !this.ui.ga.val()) {
app.alert({ message: 'Real Space Grid Search requires unit cell to be populated' })
this.ui.indexingMethod.val('')
this.ui.cell.show()
}
}
}
},

toggleIndividual: function(e) {
var st = this.ui.ind.is(':checked')
const st = this.ui.ind.is(':checked')
st ? this.ui.mul.hide() : this.ui.mul.show()
if (st) this.ui.cell.hide()
this.distlview.children.each(function(v) {
v.setInd(st)
if (!st) v.ui.cell.hide()
})
},

Expand Down Expand Up @@ -309,7 +359,7 @@ define(['backbone', 'marionette', 'views/dialog',
var s = this.collection.where({ selected: true })

if (!s.length) {
app.alert({ message: 'Please selected some data sets to integrate' })
app.alert({ message: 'Please select some data sets to integrate' })
return
}

Expand Down Expand Up @@ -530,18 +580,16 @@ define(['backbone', 'marionette', 'views/dialog',
},

onRender: function() {
this.ui.opts.hide()
if (app.type != 'sm') this.ui.opts.hide()
this.ui.cell.hide()
this.$el.find('span input[type="text"]').css('width', '50px')

this.pipelines = new Pipelines([
{ NAME: 'Xia2 DIALS', VALUE: 'xia2-dials' },
{ NAME: 'Xia2 3dii', VALUE: 'xia2-3dii' },
{ NAME: 'Fast DP', VALUE: 'fast_dp' },
{ NAME: 'autoPROC', VALUE: 'autoPROC' },
])
this.$el.find('span input[type="text"]').css('width', '55px')

this.ui.pipeline.html(this.pipelines.opts())
const uspls = app.options.get('upstream_reprocessing_pipelines')
if (uspls) {
const pls = uspls[app.type] ?? uspls['default'];
this.pipelines = new Pipelines(pls)
this.ui.pipeline.html(this.pipelines.opts())
}

this.indexingMethods = new IndexingMethods([
{ NAME: '-', VALUE: '' },
Expand Down Expand Up @@ -578,6 +626,7 @@ define(['backbone', 'marionette', 'views/dialog',
var nm = model.clone()
nm.set('CID', this.collection.length+1)
this.collection.add(nm)
this.toggleIndividual()
},

setCell: function(view, ap) {
Expand Down
2 changes: 0 additions & 2 deletions client/src/js/modules/types/sm/dc/dc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ define([
return DCItemView.extend({
apStatusItem: APStatusItem,
template: Template,

setProcessingVars: function() {},

})

})
4 changes: 2 additions & 2 deletions client/src/js/templates/dc/reprocess.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<span class="multi form">
|
Pipeline :<select name="pipeline"></select>
High Res :<input type="text" name="res" /> &#197;
Low Res :<input type="text" name="lowres" /> &#197; |
High Res :<input type="text" name="res" placeholder="eg 1.5" /> &#197;
Low Res :<input type="text" name="lowres" placeholder="eg 40" /> &#197; |
<a href="#" class="button sgm">Space Group / Cell</a>
<!-- Comments: <input type="text" name="comments" class="full" /> -->
</span>
Expand Down
4 changes: 2 additions & 2 deletions client/src/js/templates/dc/reprocess_dc.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ <h1 class="clearfix">

<div class="ind data_collection">
Pipeline <select name="pipeline"></select>
High Res <input type="text" name="res" /> &#197;
Low Res <input type="text" name="lowres" /> &#197; |
High Res <input type="text" name="res" placeholder="eg 1.5" /> &#197;
Low Res <input type="text" name="lowres" placeholder="eg 40" /> &#197; |
<a href="#" class="button sg">Space Group / Cell</a> <br />
</div>

Expand Down
4 changes: 2 additions & 2 deletions client/src/js/templates/mc/datacollections.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ <h1>Data Collections for <%-VISIT%></h1>
<label>&beta; <input type="text" name="beta" /></label>
<label>&gamma; <input type="text" name="gamma" /></label>

<label>High Res <input type="text" name="res" /> &#197;</label>
<label>Low Res <input type="text" name="lowres" /> &#197;</label>
<label>High Res <input type="text" name="res" placeholder="eg 1.5" /> &#197;</label>
<label>Low Res <input type="text" name="lowres" placeholder="eg 40" /> &#197;</label>

<a href="#" class="button integrate" title="Integrate the selected data collections"><i class="fa fa-cog"></i> Integrate</a>
<a href="#" class="button opt">Xia2 Options</a>
Expand Down
Loading