zakodium-oss / react-science

React components and tools to build scientific applications.
https://react-science.pages.dev
MIT License
3 stars 6 forks source link

Importation of GC / LC MS #278

Open lpatiny opened 2 years ago

lpatiny commented 2 years ago

We should allow to import GC/MNS or LC/MS data and to visualize them. There will be a lot of open questions and a lot of issues to solve but first step is to import the data.

We had already a discussion on the internal format for a GC / MS here: https://github.com/cheminfo/chromatography/blob/master/examples/format.js however:

We could probably go in the direction in which we have a 'flat' database with filterable annotations and keep our currently MeasurementBase approach

https://github.com/zakodium-oss/analysis-ui-components/blob/b6ace8e14c53d39267ca758f8fc9b58355e7c381/src/app/data/MeasurementBase.ts#L18-L22

So for instance a gc/ms would look like:

{
  "data": [
    {
      "meta": {},
      "info": {
        "time": "Of type 'Value', see cheminfo-types",
        "tic": 123,
        "bpc": 12
      },
      "variables": {
        "x": { "symbol": "x", "label": "m/z", "units": "", "data": [] },
        "y": {
          "symbol": "y",
          "label": "relative intensity",
          "units": "",
          "data": []
        }
      }
    },
    {
      "meta": {},
      "info": {
        "time": { "value": 1, "units": "s" }
      },
      "variables": {
        "x": { "symbol": "x", "label": "m/z", "units": "", "data": [] },
        "y": {
          "symbol": "y",
          "label": "relative intensity",
          "units": "",
          "data": []
        }
      }
    },
    {
      "meta": {},
      "info": {
        "time": { "value": 2, "units": "s" }
      },
      "variables": {
        "x": { "symbol": "x", "label": "m/z", "units": "", "data": [] },
        "y": {
          "symbol": "y",
          "label": "relative intensity",
          "units": "",
          "data": []
        }
      }
    }
  ]
}
josoriom commented 2 years ago

I'm not sure if understood the gc/ms json sketch, in this case it's a point per time step? What about total intensity? @lpatiny