-
Notifications
You must be signed in to change notification settings - Fork 31
LIMS-1501: Allow re-running downstream processing #948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ndg63276
merged 8 commits into
pre-release/2025-R3.4
from
improvement/LIMS-1501/rerun-downstream-processing
Jul 8, 2025
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c0c3964
LIMS-1501: Early work on re-running downstream processing
3e30467
LIMS-1501: Flesh out re-running downtream processing
18e0f68
LIMS-1501: Remove unnecessary ProcessingJobParameters
21428d2
Merge branch 'master' into improvement/LIMS-1501/rerun-downstream-pro…
ndg63276 dd8b5fc
LIMS-1501: Enable fast_ep and some fast_dp
8b5d198
LIMS-1501: Trigger zocalo directly
b7da336
LIMS-1501: Rename recipes for consistency
f821f9d
LIMS-1501: Rename file more appropriately
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,204 @@ | ||
| define(['backbone', 'marionette', 'views/dialog', | ||
| 'collections/datacollections', | ||
| 'collections/proteins', | ||
| 'collections/autoprocattachments', | ||
| 'models/datacollection', | ||
| 'modules/mc/views/dcdistl_downstream', | ||
| 'modules/samples/collections/pdbs', | ||
| 'utils/kvcollection', | ||
| 'templates/dc/downstream.html', 'templates/dc/downstream_dc.html' | ||
| ], function(Backbone, Marionette, DialogView, | ||
| DataCollections, Proteins, AutoProcAttachments, | ||
| DataCollection, DCDistlView, | ||
| PDBs, | ||
| KVCollection, | ||
| template, dctemplate | ||
| ) { | ||
|
|
||
|
|
||
| var IDDataCollection = DataCollection.extend({ | ||
| idAttribute: 'CID', | ||
| }) | ||
|
|
||
| var IDDataCollections = DataCollections.extend({ | ||
| model: IDDataCollection, | ||
| }) | ||
|
|
||
| var DCDistlViewLarge = DCDistlView.extend({ | ||
| template: dctemplate, | ||
| intStatus: false, | ||
| className: 'data_collection', | ||
|
|
||
| initialize: function(options) { | ||
| DCDistlView.prototype.initialize.apply(this, arguments) | ||
| }, | ||
|
|
||
| onRender: function() { | ||
| this.$el.find('ul').addClass('half') | ||
| this.$el.find('li input[type="text"]').css('width', '25%') | ||
| }, | ||
|
|
||
| }) | ||
|
|
||
|
|
||
| var DCDistlsView = Marionette.CollectionView.extend({ | ||
| childView: DCDistlViewLarge, | ||
| childViewOptions: function() { | ||
| return { | ||
| pipelines: this.getOption('pipelines'), | ||
| parent: this.model, | ||
| } | ||
| } | ||
| }) | ||
|
|
||
|
|
||
| var Pipelines = Backbone.Collection.extend(_.extend({ | ||
| keyAttribute: 'NAME', | ||
| valueAttribute: 'VALUE', | ||
| }, KVCollection)) | ||
|
|
||
|
|
||
| return ReprocessView = DialogView.extend({ | ||
| template: template, | ||
| dialog: true, | ||
| title: 'Rerun downstream processing', | ||
| className: 'rp content', | ||
| dOptions: { | ||
| width: '1000px', | ||
| }, | ||
|
|
||
| regions: { | ||
| dcr: '.dcs', | ||
| }, | ||
|
|
||
| ui: { | ||
| pipeline: 'select[name=pipeline]', | ||
| warning: '#warning', | ||
| }, | ||
|
|
||
| buttons: { | ||
| Submit: 'submit', | ||
| Close: 'closeDialog', | ||
| }, | ||
|
|
||
| disabledButtons: { | ||
| Close: 'closeDialog', | ||
| }, | ||
|
|
||
| events: { | ||
| 'change @ui.pipeline': 'updatePipeline', | ||
| }, | ||
|
|
||
| templateHelpers: function() { | ||
| return { | ||
| VISIT: this.getOption('visit') | ||
| } | ||
| }, | ||
|
|
||
| updatePipeline: function() { | ||
| this.model.set('PIPELINE', this.ui.pipeline.val()) | ||
| this.model.set('PIPELINENAME', this.ui.pipeline.find('option:selected').text()) | ||
| var btns = this.buttons | ||
| var warning = '' | ||
| 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 | ||
| } | ||
| if (['MrBUMP', 'Big EP'].includes(this.model.get('PIPELINENAME')) && this.type.includes('fast_dp')) { | ||
| warning = ' Cannot rerun ' + this.model.get('PIPELINENAME') + ' on ' + this.type + ' results' | ||
| btns = this.disabledButtons | ||
| } | ||
| if (this.model.get('PIPELINENAME') === 'Dimple' && this.pdbs.length === 0) { | ||
| warning = ' Cannot run Dimple as no PDBs defined' | ||
| btns = this.disabledButtons | ||
| } | ||
| if (this.model.get('PIPELINENAME') === 'MrBUMP' && this.model.get('HASSEQ') === 'No') { | ||
| 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') { | ||
| warning = ' Cannot run Big EP as no sequence defined' | ||
| btns = this.disabledButtons | ||
| } | ||
| if (this.model.get('PIPELINENAME') === 'Big EP' && (!this.model.get('ANOMALOUSSCATTERER'))) { | ||
| warning = ' Cannot run Big EP as no anomalous scatterer defined' | ||
| btns = this.disabledButtons | ||
| } | ||
| this.setButtons(btns) | ||
| this.ui.warning.html(warning) | ||
| }, | ||
|
|
||
| submit: function(e) { | ||
| e.preventDefault() | ||
|
|
||
| this._enqueue({ RECIPE: this.model.get('PIPELINE'), DATACOLLECTIONID: this.model.get('ID'), SCALINGID: this.scalingid }) | ||
| app.message({ message: 'Downstream processing job successfully submitted'}) | ||
|
|
||
| }, | ||
|
|
||
|
|
||
| _enqueue: function(options) { | ||
| Backbone.ajax({ | ||
| url: app.apiurl+'/process/enqueue/downstream', | ||
| method: 'POST', | ||
| data: { | ||
| DATACOLLECTIONID: options.DATACOLLECTIONID, | ||
| SCALINGID: options.SCALINGID, | ||
| RECIPE: options.RECIPE | ||
| }, | ||
| }) | ||
| }, | ||
|
|
||
|
|
||
| initialize: function(options) { | ||
| this.proteins = new Proteins(null, { queryParams: { sid: options.model.get('BLSAMPLEID') } }) | ||
| this._ready = this.proteins.fetch() | ||
| this._ready.done(this.doOnReady.bind(this)) | ||
| this.scalingid = options.scalingid | ||
| this.type = options.type | ||
| this.attachments = new AutoProcAttachments() | ||
| this.attachments.queryParams = { | ||
| AUTOPROCPROGRAMID: options.autoprocprogramid, | ||
| filetype: 'Result', | ||
| } | ||
| this.attachments.fetch() | ||
| }, | ||
|
|
||
| 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()) | ||
| }, | ||
|
|
||
| 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') }) | ||
| this.pdbs.fetch().done(this.updatePipeline.bind(this)) | ||
| this.collection = new IDDataCollections() | ||
| if (this.model) { | ||
| var nm = new IDDataCollection(this.model.toJSON()) | ||
| nm.set('CID', this.collection.length+1) | ||
| this.collection.add(nm) | ||
| } | ||
| this.distlview = new DCDistlsView({ collection: this.collection, pipelines: this.pipelines }) | ||
| this.dcr.show(this.distlview) | ||
| } | ||
|
|
||
|
|
||
| }) | ||
|
|
||
| }) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use a different filename, so that the purpose of this file is a bit more obvious?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah the name was to mirror the reprocess2.js file in the same directory, but you're right, better to use something that actually describes it. Have renamed to downstreamreprocess.js.