HUPO-PSI / proxi-schemas

ProXI: Schema definitions for the Proteomics eXpression Interface
3 stars 3 forks source link

Spectra attributes. Verbose or compact? #44

Closed edeutsch closed 4 years ago

edeutsch commented 4 years ago

According to the current schema, a Spectrum from /spectra has something like this:

{ "attributes": [ { "accession": "MS:1000744", "cv_param_group": null, "name": "selected ion m/z", "value": "473.1234" }, { "accession": "MS:1000041", "cv_param_group": null, "name": "charge state", "value": "2" }, ... }

This is nice, but quite verbose. And what if the value is another CV term? Over in PSI Spectra libraries format land: http://proteomecentral.proteomexchange.org/cgi/spectra?usi=mzspec:PXL000001:05-29-2014:index:5001&output_format=json I started using a more compact notation, e.g.:

{ "attributes": [ [ "MS:1000041|charge state", "2" ], [ "MS:1000744|selected ion m/z", "847.417" ], [ "MS:1009030|representative spectrum type", "MS:1009032|consensus spectrum" ], [ "MS:1009040|number of enzymatic termini", 2, "1" ], [ "MS:1001045|cleavage agent name", "MS:1001251|Trypsin", "1" ],

The first item in each sublist is the key (accession|name), the second item is the value, and the third optional item is the cv_param_group

More cryptic for sure. But a lot less verbose and a bit more graceful when the value is the cvParam.

What thinks we?

RalfG commented 4 years ago

Different options discussed in call:

Option 1

{
"attributes": [
{
"accession": "MS:1009030",
"cv_param_group": null,
"name": "representative spectrum type",
"value": "MS:1009032|consensus spectrum"
},

Option 2

"attributes": [
{
"accession": "MS:1009030",
"cv_param_group": null,
"name": "representative spectrum type",
"value": {
    “accession”: "MS:1009032”,
    “value”: ”consensus spectrum"
},

Option 2 (when there’s no accession for value)

{
"accession": "MS:1009030",
"cv_param_group": null,
"name": "representative spectrum type",
"value": {
    “value”: 2
},

option 3

"attributes": [
{
“accession": "MS:1009030",
"name": "representative spectrum type",
"cv_param_group": null,
"value_accession”: "MS:1009032”, (Optional)
“value”: ”consensus spectrum”
},

OR if value is not CV term
...
“value”: 2,
...

Option 3 was favored by call attendees.

edeutsch commented 4 years ago

We have agreed to implement option 3.