Skip to content

Commit 054f24a

Browse files
ndg63276Mark Williams
andauthored
LIMS-538: Remove the 'Centring Method' column from creating an MX container (#908)
Co-authored-by: Mark Williams <mark.williams@diamond.ac.uk>
1 parent 59457ba commit 054f24a

File tree

8 files changed

+33
-50
lines changed

8 files changed

+33
-50
lines changed

api/src/Page/Sample.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,8 +1311,8 @@ function _handle_update_sample_full($a, $sid)
13111311
$blSampleId = $samp['BLSAMPLEID'];
13121312

13131313
$this->db->pq(
1314-
"UPDATE blsample set name=:1,comments=:2,code=:3,volume=:4,packingfraction=:5,dimension1=:6,dimension2=:7,dimension3=:8,shape=:9,looptype=:10 WHERE blsampleid=:11",
1315-
array($a['NAME'], $a['COMMENTS'], $a['CODE'], $a['VOLUME'], $a['PACKINGFRACTION'], $a['DIMENSION1'], $a['DIMENSION2'], $a['DIMENSION3'], $a['SHAPE'], $a['LOOPTYPE'], $blSampleId)
1314+
"UPDATE blsample set name=:1,comments=:2,code=:3,volume=:4,packingfraction=:5,dimension1=:6,dimension2=:7,dimension3=:8,shape=:9,looptype=:10,smiles=:11 WHERE blsampleid=:12",
1315+
array($a['NAME'], $a['COMMENTS'], $a['CODE'], $a['VOLUME'], $a['PACKINGFRACTION'], $a['DIMENSION1'], $a['DIMENSION2'], $a['DIMENSION3'], $a['SHAPE'], $a['LOOPTYPE'], $a['SMILES'], $blSampleId)
13161316
);
13171317

13181318
if (array_key_exists('PROTEINID', $a)) {
@@ -1480,6 +1480,7 @@ function _prepare_sample_args($s = null)
14801480
'LOOPTYPE',
14811481
'ENERGY',
14821482
'USERPATH',
1483+
'SMILES',
14831484
'SCREENINGMETHOD',
14841485
'SCREENINGCOLLECTVALUE',
14851486
'SAMPLEGROUP',
@@ -1537,8 +1538,8 @@ function _do_add_sample($s)
15371538
}
15381539

15391540
$this->db->pq(
1540-
"INSERT INTO blsample (blsampleid,crystalid,diffractionplanid,containerid,location,comments,name,code,blsubsampleid,screencomponentgroupid,volume,packingfraction,dimension1,dimension2,dimension3,shape,looptype,source) VALUES (s_blsample.nextval,:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14,:15,:16,IFNULL(:17,CURRENT_USER)) RETURNING blsampleid INTO :id",
1541-
array($crysid, $did, $a['CONTAINERID'], $a['LOCATION'], $a['COMMENTS'], $a['NAME'], $a['CODE'], $a['BLSUBSAMPLEID'], $a['SCREENCOMPONENTGROUPID'], $a['VOLUME'], $a['PACKINGFRACTION'], $a['DIMENSION1'], $a['DIMENSION2'], $a['DIMENSION3'], $a['SHAPE'], $a['LOOPTYPE'], $a['SOURCE'])
1541+
"INSERT INTO blsample (blsampleid,crystalid,diffractionplanid,containerid,location,comments,name,code,blsubsampleid,screencomponentgroupid,volume,packingfraction,dimension1,dimension2,dimension3,shape,looptype,smiles,source) VALUES (s_blsample.nextval,:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14,:15,:16,:17,IFNULL(:18,CURRENT_USER)) RETURNING blsampleid INTO :id",
1542+
array($crysid, $did, $a['CONTAINERID'], $a['LOCATION'], $a['COMMENTS'], $a['NAME'], $a['CODE'], $a['BLSUBSAMPLEID'], $a['SCREENCOMPONENTGROUPID'], $a['VOLUME'], $a['PACKINGFRACTION'], $a['DIMENSION1'], $a['DIMENSION2'], $a['DIMENSION3'], $a['SHAPE'], $a['LOOPTYPE'], $a['SMILES'], $a['SOURCE'])
15421543
);
15431544
$sid = $this->db->id();
15441545

client/src/js/app/store/modules/store.samples.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const INITIAL_SAMPLE_STATE = {
3939
SCREENINGCOLLECTVALUE: '',
4040
THEORETICALDENSITY: '',
4141
SHAPE: '',
42+
SMILES: '',
4243
SPACEGROUP: '',
4344
SYMBOL: '',
4445
USERPATH: '',

client/src/js/modules/types/mx/samples/mx-puck-samples-table.vue

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -290,19 +290,19 @@ export default {
290290
componentType: 'base-input-text',
291291
data: '',
292292
inputType: 'number'
293-
}
293+
},
294+
{
295+
key: 'SMILES',
296+
title: 'SMILES Code',
297+
className: 'tw-w-3/12',
298+
componentType: 'base-input-text',
299+
data: '',
300+
inputType: 'text'
301+
},
294302
]
295303
},
296304
udcColumns() {
297305
return [
298-
{
299-
key: 'CENTRINGMETHOD',
300-
title: 'Centring Method',
301-
className: 'tw-w-24',
302-
componentType: 'base-input-select',
303-
data: this.centringMethodList,
304-
inputType: 'select'
305-
},
306306
{
307307
key: 'EXPERIMENTKIND',
308308
title: 'Experiment Kind',

client/src/js/modules/types/mx/samples/sample-table-mixin.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,6 @@ export default {
6565
experimentKindList() {
6666
return this.$experimentKindList();
6767
},
68-
centringMethodList() {
69-
return this.$centringMethods().filter(method => method).reduce(
70-
(acc, curr) => {
71-
if (curr) acc.push({ value: curr, text: curr });
72-
73-
return acc;
74-
},
75-
[]
76-
).sort(this.sortSelectField);
77-
},
7868
spaceGroupList() {
7969
const spaceGroups = this.$spaceGroups().reduce((acc, item) => {
8070
acc.push({
@@ -159,6 +149,7 @@ export default {
159149
'SCREENINGMETHOD',
160150
'SCREENINGCOLLECTVALUE',
161151
'SHAPE',
152+
'SMILES',
162153
'SPACEGROUP',
163154
'SYMBOL',
164155
'THEORETICALDENSITY',
@@ -311,7 +302,6 @@ export default {
311302
},
312303
inject: [
313304
"$spaceGroups",
314-
"$centringMethods",
315305
"$anomalousList",
316306
"$experimentKindList",
317307
"$sampleLocation",

client/src/js/modules/types/mx/samples/tabbed-columns-view.vue

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -266,26 +266,18 @@
266266
</extended-validation-provider>
267267
</div>
268268
</div>
269-
</div>
270269

271-
<div
272-
v-show="currentTab === 'unattended'"
273-
class="tw-w-full tw-flex tw-items-center"
274-
>
275270
<extended-validation-provider
276-
:ref="`sample_${sampleIndex}_centring_method`"
277-
class-names="tw-px-2 tw-w-24"
278-
:name="`Sample ${sampleIndex + 1} Centring Method`"
279-
:rules="sample['PROTEINID'] > -1 && queueForUDC ? 'required' : ''"
280-
:vid="`sample ${sampleIndex + 1} centring method`"
271+
:ref="`sample_${sampleIndex}_smiles`"
272+
class-names="tw-px-2 tw-w-3/12"
273+
:name="`Sample ${sampleIndex + 1} SMILES Code`"
274+
:rules="sample['PROTEINID'] > -1 ? { regex: /^[A-Za-z0-9.:%=#$@+\-\[\]\(\)\/\\\\]+$/ } : ''"
275+
:vid="`sample ${sampleIndex + 1} smiles`"
281276
>
282277
<template #default="{errors, inputChanged }">
283-
<base-input-select
284-
v-model="CENTRINGMETHOD"
285-
:is-disabled="!canEditRow(sample['LOCATION'], currentEditingRow)"
286-
:options="centringMethodList"
287-
option-value-key="value"
288-
option-text-key="text"
278+
<base-input-text
279+
v-model="SMILES"
280+
:disabled="!canEditRow(sample['LOCATION'], currentEditingRow)"
289281
input-class="tw-w-full tw-h-8"
290282
:quiet="true"
291283
:error-message="errors[0]"
@@ -295,6 +287,12 @@
295287
</template>
296288
</extended-validation-provider>
297289

290+
</div>
291+
292+
<div
293+
v-show="currentTab === 'unattended'"
294+
class="tw-w-full tw-flex tw-items-center"
295+
>
298296
<extended-validation-provider
299297
:ref="`sample_${sampleIndex}_experiment_kind`"
300298
class-names="tw-px-2 tw-w-32"
@@ -322,7 +320,7 @@
322320
:ref="`sample_${sampleIndex}_energy`"
323321
class-names="tw-px-2 tw-w-20"
324322
:name="`Sample ${sampleIndex + 1} Energy`"
325-
:rules="sample['PROTEINID'] > -1 ? `required_if:sample ${sampleIndex + 1} experiment kind,SAD|non_zero_numeric` : ''"
323+
:rules="sample['PROTEINID'] > -1 ? `required_if:sample ${sampleIndex + 1} experiment kind,SAD|min_value:1501` : ''"
326324
:vid="`sample ${sampleIndex + 1} energy`"
327325
>
328326
<template #default="{errors, inputChanged }">

client/src/js/modules/types/mx/shipment/views/container-mixin.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import Users from 'collections/users'
22
import ProcessingPipelines from 'collections/processingpipelines'
33
import SpaceGroups from 'collections/spacegroups.js'
4-
import CentringMethodList from 'utils/centringmethods.js'
54
import AnomalousList from 'utils/anoms.js'
65
import ExperimentKindsList from 'utils/experimentkinds.js'
76
import DistinctProteins from 'modules/shipment/collections/distinctproteins'
@@ -35,7 +34,6 @@ export default {
3534
return {
3635
anomalousList: AnomalousList.list,
3736

38-
centringMethods: CentringMethodList.list,
3937
containerType: {},
4038
containerTypes: [],
4139
containerTypesCollection: new ContainerTypes(),
@@ -541,7 +539,6 @@ export default {
541539
provide() {
542540
return {
543541
$spaceGroups: () => this.spaceGroups,
544-
$centringMethods: () => this.centringMethods,
545542
$anomalousList: () => this.anomalousList,
546543
$experimentKindList: () => this.experimentKindList,
547544
$sampleLocation: () => this.sampleLocation,

client/src/js/modules/types/mx/shipment/views/mx-container-add.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -696,10 +696,6 @@ export default {
696696
let samples
697697
if (newVal) {
698698
samples = this.samples.map(sample => {
699-
if (!sample.CENTRINGMETHOD) {
700-
sample.CENTRINGMETHOD = 'diffraction'
701-
}
702-
703699
if (!sample.EXPERIMENTKIND) {
704700
sample.EXPERIMENTKIND = 'Ligand binding'
705701
}

client/src/js/utils/experimentkinds.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ define([], function() {
3232
'native': 'OSC',
3333
'phasing': 'SAD',
3434
'ligand': 'Ligand binding',
35-
'stepped': 'Stepped transmission',
3635
},
3736

3837
staff: {
39-
'commissioning': 'Commissioning'
38+
'stepped': 'Stepped transmission',
39+
'commissioning': 'Commissioning',
4040
}
4141
}
4242
})

0 commit comments

Comments
 (0)