Skip to content

Commit ad9e69f

Browse files
authored
Merge pull request #1481 from microbiomedata/1464-support-lipidome-results
Support Lipidome Results
2 parents 2c8babb + 18e65d9 commit ad9e69f

File tree

9 files changed

+46
-38
lines changed

9 files changed

+46
-38
lines changed

nmdc_server/database.py

+14-10
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,17 @@
145145
bit_or(
146146
case
147147
when op.annotations->>'omics_type' = 'Metabolomics' then
148-
b'{MultiomicsValue.mb.value:05b}'
148+
b'{MultiomicsValue.mb.value:06b}'
149149
when op.annotations->>'omics_type' = 'Metagenome' then
150-
b'{MultiomicsValue.mg.value:05b}'
150+
b'{MultiomicsValue.mg.value:06b}'
151151
when op.annotations->>'omics_type' = 'Proteomics' then
152-
b'{MultiomicsValue.mp.value:05b}'
152+
b'{MultiomicsValue.mp.value:06b}'
153153
when op.annotations->>'omics_type' = 'Metatranscriptome' then
154-
b'{MultiomicsValue.mt.value:05b}'
154+
b'{MultiomicsValue.mt.value:06b}'
155155
when op.annotations->>'omics_type' = 'Organic Matter Characterization' then
156-
b'{MultiomicsValue.om.value:05b}'
156+
b'{MultiomicsValue.om.value:06b}'
157+
when op.annotations->>'omics_type' = 'Lipidomics' then
158+
b'{MultiomicsValue.li.value:06b}'
157159
end
158160
)::integer as multiomics
159161
from biosample b
@@ -169,15 +171,17 @@
169171
bit_or(
170172
case
171173
when op.annotations->>'omics_type' = 'Metabolomics' then
172-
b'{MultiomicsValue.mb.value:05b}'
174+
b'{MultiomicsValue.mb.value:06b}'
173175
when op.annotations->>'omics_type' = 'Metagenome' then
174-
b'{MultiomicsValue.mg.value:05b}'
176+
b'{MultiomicsValue.mg.value:06b}'
175177
when op.annotations->>'omics_type' = 'Proteomics' then
176-
b'{MultiomicsValue.mp.value:05b}'
178+
b'{MultiomicsValue.mp.value:06b}'
177179
when op.annotations->>'omics_type' = 'Metatranscriptome' then
178-
b'{MultiomicsValue.mt.value:05b}'
180+
b'{MultiomicsValue.mt.value:06b}'
179181
when op.annotations->>'omics_type' = 'Organic Matter Characterization' then
180-
b'{MultiomicsValue.om.value:05b}'
182+
b'{MultiomicsValue.om.value:06b}'
183+
when op.annotations->>'omics_type' = 'Lipidomics' then
184+
b'{MultiomicsValue.li.value:06b}'
181185
end
182186
)::integer as multiomics
183187
from study s

nmdc_server/ingest/omics_processing.py

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
"metatranscriptome": "Metatranscriptome",
3131
"organic matter characterization": "Organic Matter Characterization",
3232
"nom": "Organic Matter Characterization",
33+
"lipidome": "Lipidomics",
34+
"lipidomics": "Lipidomics",
3335
}
3436

3537

nmdc_server/multiomics.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33

44
#: Bitmasks for omics types (see database.update_multiomics_sql)
55
class MultiomicsValue(Enum):
6-
mb = 0b10000
7-
mg = 0b01000
8-
mp = 0b00100
9-
mt = 0b00010
10-
om = 0b00001
6+
mb = 0b100000
7+
mg = 0b010000
8+
mp = 0b001000
9+
mt = 0b000100
10+
om = 0b000010
11+
li = 0b000001

web/src/components/Presentation/UpSet.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default defineComponent({
3939
};
4040
const fontSize = 12;
4141
42-
const setOrder = ['MG', 'MT', 'MP', 'MB', 'NOM'];
42+
const setOrder = ['MG', 'MT', 'MP', 'MB', 'NOM', 'LIP'];
4343
const Samples = 'Samples';
4444
const Studies = 'Studies';
4545
const seriesTitles = [Samples, Studies];

web/src/components/SampleListExpansion.vue

+1-6
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ import { fieldDisplayName } from '@/util';
55
import { BiosampleSearchResult } from '@/data/api';
66
import DataObjectTable from './DataObjectTable.vue';
77
8-
const hiddenOmicsTypes = [
9-
'lipidomics',
10-
];
11-
128
const buttonOrder = [
139
'metagenome',
1410
'metatranscriptome',
@@ -44,8 +40,7 @@ export default defineComponent({
4440
}
4541
4642
const filteredOmicsProcessing = computed(() => Object.entries(groupBy(
47-
props.result.omics_processing
48-
.filter((p) => hiddenOmicsTypes.indexOf((p.annotations.omics_type as string).toLowerCase()) === -1),
43+
props.result.omics_processing,
4944
(p) => p.annotations.omics_type,
5045
)).sort(([agroup], [bgroup]) => {
5146
const ai = buttonOrder.indexOf(agroup.toLowerCase());

web/src/data/api.ts

-2
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,6 @@ async function getFacetSummary(
496496
facet: facetName,
497497
count: data.facets[facetName],
498498
}))
499-
/* TODO: Take out all these lipidomics hacks */
500-
.filter((facetName) => (facetName.facet !== 'Lipidomics'))
501499
.sort((a, b) => b.count - a.count);
502500
}
503501

web/src/encoding.ts

+14-10
Original file line numberDiff line numberDiff line change
@@ -229,21 +229,24 @@ function makeSetsFromBitmask(mask_str: string) {
229229
const sets = [];
230230

231231
/* eslint-disable no-bitwise */
232-
if (1 & mask) {
232+
if ((1 << 1) & mask) {
233233
sets.push('NOM');
234234
}
235-
if ((1 << 4) & mask) {
235+
if ((1 << 5) & mask) {
236236
sets.push('MB');
237237
}
238-
if ((1 << 2) & mask) {
238+
if ((1 << 3) & mask) {
239239
sets.push('MP');
240240
}
241-
if ((1 << 1) & mask) {
241+
if ((1 << 2) & mask) {
242242
sets.push('MT');
243243
}
244-
if ((1 << 3) & mask) {
244+
if ((1 << 4) & mask) {
245245
sets.push('MG');
246246
}
247+
if (1 & mask) {
248+
sets.push('LIP');
249+
}
247250
return sets;
248251
}
249252

@@ -641,11 +644,12 @@ function getField(name: string, table?: entityType): FieldsData {
641644
}
642645

643646
const MultiomicsValue = {
644-
MB: 0b10000,
645-
MG: 0b01000,
646-
MP: 0b00100,
647-
MT: 0b00010,
648-
NOM: 0b00001,
647+
MB: 0b100000,
648+
MG: 0b010000,
649+
MP: 0b001000,
650+
MT: 0b000100,
651+
NOM: 0b000010,
652+
LIP: 0b000001,
649653
};
650654

651655
export {

web/src/views/Search/BiosampleVisGroup.vue

+4
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const staticUpsetTooltips = {
3131
MB: 'Metabolomics',
3232
MT: 'Metatranscriptomics',
3333
NOM: 'Natural Organic Matter',
34+
LIP: 'Lipidomics',
3435
};
3536
3637
export default defineComponent({
@@ -210,6 +211,7 @@ export default defineComponent({
210211
<span>MP: metaproteomics</span>
211212
<span>MB: metabolomics</span>
212213
<span>NOM: natural organic matter</span>
214+
<span>LI: Lipidomics</span>
213215
</div>
214216
</TooltipCard>
215217
</v-col>
@@ -219,6 +221,8 @@ export default defineComponent({
219221

220222
<style scoped>
221223
.upset-legend {
224+
display: flex;
225+
flex-wrap: wrap;
222226
line-height: 0.9em;
223227
}
224228
.upset-legend > span {

web/src/views/Search/SearchLayout.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ export default defineComponent({
356356
v-for="item in props.result.omics_processing_counts"
357357
>
358358
<v-chip
359-
v-if="item.count && (item.type.toLowerCase() !== 'lipidomics')"
359+
v-if="item.count"
360360
:key="item.type"
361361
small
362362
class="mr-2 my-1"
@@ -414,7 +414,7 @@ export default defineComponent({
414414
v-for="item in childProps.result.omics_processing_counts"
415415
>
416416
<v-chip
417-
v-if="item.count && (item.type.toLowerCase() !== 'lipidomics')"
417+
v-if="item.count"
418418
:key="item.type"
419419
small
420420
class="mr-2 my-1"
@@ -535,7 +535,7 @@ export default defineComponent({
535535
v-for="item in props.result.omics_processing_counts"
536536
>
537537
<v-chip
538-
v-if="item.count && (item.type.toLowerCase() !== 'lipidomics')"
538+
v-if="item.count"
539539
:key="item.type"
540540
small
541541
class="mr-2 my-1"
@@ -593,7 +593,7 @@ export default defineComponent({
593593
v-for="item in childProps.result.omics_processing_counts"
594594
>
595595
<v-chip
596-
v-if="item.count && (item.type.toLowerCase() !== 'lipidomics')"
596+
v-if="item.count"
597597
:key="item.type"
598598
small
599599
class="mr-2 my-1"

0 commit comments

Comments
 (0)