# `ndx-odor-metadata`
[![pipeline status](https://img.shields.io/gitlab/pipeline-status/fleischmann-lab/ndx/ndx-odor-metadata?branch=main&label=pipeline&style=flat-square)](https://gitlab.com/fleischmann-lab/ndx/ndx-odor-metadata/-/commits/main)
[![license](https://img.shields.io/gitlab/license/fleischmann-lab/ndx/ndx-odor-metadata?color=yellow&label=license&style=flat-square)](LICENSE.txt)
![python version](https://img.shields.io/pypi/pyversions/ndx-odor-metadata?style=flat-square)
[![release](https://img.shields.io/gitlab/v/release/fleischmann-lab/ndx/ndx-odor-metadata?label=release&sort=date&style=flat-square)](https://gitlab.com/fleischmann-lab/ndx/ndx-odor-metadata/-/releases)
[![pypi package](https://img.shields.io/pypi/v/ndx-odor-metadata?label=pypi%20package&style=flat-square&color=blue)](https://pypi.org/pypi/ndx-odor-metadata)
[![conda package](https://img.shields.io/conda/v/fleischmannlab/ndx-odor-metadata?color=green&style=flat-square)](https://anaconda.org/FleischmannLab/ndx-odor-metadata)
NWB extension to store odor stimulus metadata with `DynamicTable` format. Entries that have a PubChem and `stim_types` indicate odor/chemical will also be queried with `pubchempy` for more information.
This is in alpha development stages **WITHOUT** any appropriate tests yet. Please use with discretion.
## Requirement
The requirements and additional development requirements can be seen in [`pyproject.toml`](pyproject.toml) file.
Here are the minimum requirements:
- `python >=3.8`
- `pynwb>=1.5.0,<3`
- `hdmf>=3.4.7,<4`
- `pubchempy>=1.0.4`
- `pyyaml>=5.0`
## Installation
You can install via `pip`:
```bash
pip install ndx-odor-metadata
```
Or `conda`:
```bash
conda install -c fleischmannlab ndx-odor-metadata
```
Or directly from the `git` repository:
```bash
pip install git+https://gitlab.com/fleischmann-lab/ndx/ndx-odor-metadata
```
## Usage
### Main usage
```python
from ndx_odor_metadata import OdorMetaData
odor_table = OdorMetaData(name='odor_table', description='an odor table')
odor_table.add_stimulus(
pubchem_id = 7662.0,
stim_name = "3-Phenylpropyl isobutyrate",
raw_id = 3,
stim_id = 1,
stim_types = "odor",
chemical_dilution_type='vaporized',
chemical_concentration = 0.01,
chemical_concentration_unit='%',
chemical_solvent = "Mineral Oil",
chemical_provider = "Sigma",
stim_description = "Legit odor stimulus #1",
)
nwbfile.add_acquisition(odor_table)
```
### Details on arguments
| | name | dtype | doc | default_value | quantity |
|---:|:----------------------------|:--------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------|:-----------|
| 0 | stim_name | text | Stimulus name, e.g. "hexanal" or "sound" | nan | nan |
| 1 | pubchem_id | float | PubChem ID, `NaN` indicates non-(standard)-odor stimulus | nan | ? |
| 2 | raw_id | text | Raw acquisition stimulus ID. Will be converted to `str`. | nan | nan |
| 3 | raw_id_dtype | text | The actual dtype of `raw_id` value. Useful for (re)casting. | N/A | ? |
| 4 | stim_id | text | Preferred stimulus ID, which can be used to remap acquisition stimulus id `raw_id`. Will be converted to `str`. If not explicitly given, will copy from `raw_id` | nan | ? |
| 5 | stim_id_dtype | text | The actual dtype of `stim_id` value. Useful for (re)casting. | N/A | ? |
| 6 | stim_types | text | Type(s) of stimulus, e.g. 'odor', 'sound', 'control', 'CS', 'US', ... | nan | nan |
| 7 | stim_types_index | nan | Index for `stim_types` | nan | nan |
| 8 | stim_description | text | Human-readable description, notes, comments of each stimulus | N/A | ? |
| 9 | chemical_dilution_type | text | Type of dilution, e.g. 'volume/volume', 'vaporized' | N/A | ? |
| 10 | chemical_concentration | float | Concentration of chemical | nan | ? |
| 11 | chemical_concentration_unit | text | Unit of concentration, e.g. "%" or "M" | N/A | ? |
| 12 | chemical_solvent | text | Solvent to dilute the chemicals in, e.g. 'mineral oil' | N/A | ? |
| 13 | chemical_provider | text | Provider of the chemicals, e.g. 'Sigma' | N/A | ? |
| 14 | nonchemical_details | text | Information about non-chemical/odor stimulus, e.g. 'sound' frequencies | N/A | ? |
| 15 | is_validated | bool | Whether the stimulus, if chemical/odor, is validated against PubChem (or other sources listed in `validation_info`.If does not have a valid PubChem ID, this assumes to default `False` value | False | ? |
| 16 | validation_details | text | Additional information/details/notes about stimulus validation, e.g. source, software used & version, validation date, ... | N/A | ? |
| 17 | pubchem_cid | float | PubChem CID, `NaN` indicates non-(standard)-odor stimulus | nan | ? |
| 18 | chemical_IUPAC | text | Official chemical IUPAC name | N/A | ? |
| 19 | chemical_SMILES | text | Canonical SMILES | N/A | ? |
| 20 | chemical_synonyms | text | List of chemical synonyms | | ? |
| 21 | chemical_synonyms_index | nan | Index for `chemical_synonyms` | nan | ? |
| 22 | chemical_molecular_formula | text | Molecular formula of chemical used | N/A | ? |
| 23 | chemical_molecular_weight | float | Molecular weight of chemical used | nan | ? |
### Demonstration
For more detailed demonstration, please visit the [`demo`](demo/demo.ipynb) folder.
## TODOs
- [ ] Create test
- [ ] Update documentation for `sphinx` (also update style)
- [x] Publish on `conda`
- [x] Publish on `pypi`
- [x] Fetch pubchem data using `pubchempy`
- [x] Use `pyproject.toml` instead of `setup.py`
---
This extension was created using [ndx-template](https://github.com/nwb-extensions/ndx-template).
Raw data
{
"_id": null,
"home_page": "",
"name": "ndx-odor-metadata",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "Tuan Pham <tuanhpham@brown.edu>",
"keywords": "NeurodataWithoutBorders,NWB,nwb-extension,ndx-extension",
"author": "",
"author_email": "Tuan Pham <tuanhpham@brown.edu>",
"download_url": "https://files.pythonhosted.org/packages/8d/0a/f5c8d707028accc01baf2b6e80546b250189d9462c9b6a0810763c6270e4/ndx-odor-metadata-0.1.1.tar.gz",
"platform": null,
"description": "# `ndx-odor-metadata`\n\n[![pipeline status](https://img.shields.io/gitlab/pipeline-status/fleischmann-lab/ndx/ndx-odor-metadata?branch=main&label=pipeline&style=flat-square)](https://gitlab.com/fleischmann-lab/ndx/ndx-odor-metadata/-/commits/main)\n[![license](https://img.shields.io/gitlab/license/fleischmann-lab/ndx/ndx-odor-metadata?color=yellow&label=license&style=flat-square)](LICENSE.txt)\n\n\n![python version](https://img.shields.io/pypi/pyversions/ndx-odor-metadata?style=flat-square)\n[![release](https://img.shields.io/gitlab/v/release/fleischmann-lab/ndx/ndx-odor-metadata?label=release&sort=date&style=flat-square)](https://gitlab.com/fleischmann-lab/ndx/ndx-odor-metadata/-/releases)\n[![pypi package](https://img.shields.io/pypi/v/ndx-odor-metadata?label=pypi%20package&style=flat-square&color=blue)](https://pypi.org/pypi/ndx-odor-metadata)\n[![conda package](https://img.shields.io/conda/v/fleischmannlab/ndx-odor-metadata?color=green&style=flat-square)](https://anaconda.org/FleischmannLab/ndx-odor-metadata)\n\nNWB extension to store odor stimulus metadata with `DynamicTable` format. Entries that have a PubChem and `stim_types` indicate odor/chemical will also be queried with `pubchempy` for more information.\n\nThis is in alpha development stages **WITHOUT** any appropriate tests yet. Please use with discretion.\n\n## Requirement\n\nThe requirements and additional development requirements can be seen in [`pyproject.toml`](pyproject.toml) file.\n\nHere are the minimum requirements:\n\n- `python >=3.8`\n- `pynwb>=1.5.0,<3`\n- `hdmf>=3.4.7,<4`\n- `pubchempy>=1.0.4`\n- `pyyaml>=5.0`\n\n## Installation\n\nYou can install via `pip`:\n\n```bash\npip install ndx-odor-metadata\n```\n\nOr `conda`:\n\n```bash\nconda install -c fleischmannlab ndx-odor-metadata\n```\n\nOr directly from the `git` repository:\n\n```bash\npip install git+https://gitlab.com/fleischmann-lab/ndx/ndx-odor-metadata\n```\n\n## Usage\n\n### Main usage\n\n```python\nfrom ndx_odor_metadata import OdorMetaData\n\nodor_table = OdorMetaData(name='odor_table', description='an odor table')\n\nodor_table.add_stimulus(\n pubchem_id = 7662.0,\n stim_name = \"3-Phenylpropyl isobutyrate\",\n raw_id = 3,\n stim_id = 1,\n stim_types = \"odor\",\n chemical_dilution_type='vaporized',\n chemical_concentration = 0.01,\n chemical_concentration_unit='%',\n chemical_solvent = \"Mineral Oil\",\n chemical_provider = \"Sigma\",\n stim_description = \"Legit odor stimulus #1\",\n)\n\nnwbfile.add_acquisition(odor_table)\n```\n### Details on arguments\n\n| | name | dtype | doc | default_value | quantity |\n|---:|:----------------------------|:--------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------|:-----------|\n| 0 | stim_name | text | Stimulus name, e.g. \"hexanal\" or \"sound\" | nan | nan |\n| 1 | pubchem_id | float | PubChem ID, `NaN` indicates non-(standard)-odor stimulus | nan | ? |\n| 2 | raw_id | text | Raw acquisition stimulus ID. Will be converted to `str`. | nan | nan |\n| 3 | raw_id_dtype | text | The actual dtype of `raw_id` value. Useful for (re)casting. | N/A | ? |\n| 4 | stim_id | text | Preferred stimulus ID, which can be used to remap acquisition stimulus id `raw_id`. Will be converted to `str`. If not explicitly given, will copy from `raw_id` | nan | ? |\n| 5 | stim_id_dtype | text | The actual dtype of `stim_id` value. Useful for (re)casting. | N/A | ? |\n| 6 | stim_types | text | Type(s) of stimulus, e.g. 'odor', 'sound', 'control', 'CS', 'US', ... | nan | nan |\n| 7 | stim_types_index | nan | Index for `stim_types` | nan | nan |\n| 8 | stim_description | text | Human-readable description, notes, comments of each stimulus | N/A | ? |\n| 9 | chemical_dilution_type | text | Type of dilution, e.g. 'volume/volume', 'vaporized' | N/A | ? |\n| 10 | chemical_concentration | float | Concentration of chemical | nan | ? |\n| 11 | chemical_concentration_unit | text | Unit of concentration, e.g. \"%\" or \"M\" | N/A | ? |\n| 12 | chemical_solvent | text | Solvent to dilute the chemicals in, e.g. 'mineral oil' | N/A | ? |\n| 13 | chemical_provider | text | Provider of the chemicals, e.g. 'Sigma' | N/A | ? |\n| 14 | nonchemical_details | text | Information about non-chemical/odor stimulus, e.g. 'sound' frequencies | N/A | ? |\n| 15 | is_validated | bool | Whether the stimulus, if chemical/odor, is validated against PubChem (or other sources listed in `validation_info`.If does not have a valid PubChem ID, this assumes to default `False` value | False | ? |\n| 16 | validation_details | text | Additional information/details/notes about stimulus validation, e.g. source, software used & version, validation date, ... | N/A | ? |\n| 17 | pubchem_cid | float | PubChem CID, `NaN` indicates non-(standard)-odor stimulus | nan | ? |\n| 18 | chemical_IUPAC | text | Official chemical IUPAC name | N/A | ? |\n| 19 | chemical_SMILES | text | Canonical SMILES | N/A | ? |\n| 20 | chemical_synonyms | text | List of chemical synonyms | | ? |\n| 21 | chemical_synonyms_index | nan | Index for `chemical_synonyms` | nan | ? |\n| 22 | chemical_molecular_formula | text | Molecular formula of chemical used | N/A | ? |\n| 23 | chemical_molecular_weight | float | Molecular weight of chemical used | nan | ? |\n\n### Demonstration\n\nFor more detailed demonstration, please visit the [`demo`](demo/demo.ipynb) folder.\n\n## TODOs\n\n- [ ] Create test\n- [ ] Update documentation for `sphinx` (also update style)\n- [x] Publish on `conda`\n- [x] Publish on `pypi`\n- [x] Fetch pubchem data using `pubchempy`\n- [x] Use `pyproject.toml` instead of `setup.py`\n\n---\nThis extension was created using [ndx-template](https://github.com/nwb-extensions/ndx-template).\n",
"bugtrack_url": null,
"license": "BSD-3",
"summary": "NWB Extension for documenting odor stimulus metadata",
"version": "0.1.1",
"split_keywords": [
"neurodatawithoutborders",
"nwb",
"nwb-extension",
"ndx-extension"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5fb913cac8e6823f356f8b0e3daac48d941766ca7dd1156a1053dbae41f3cf2f",
"md5": "dd86531f05f95e4e994561271fc87da0",
"sha256": "80ee1d4403af9d11ece87f9bb05ee07c1b02252d86e943145b65ffd55ac34368"
},
"downloads": -1,
"filename": "ndx_odor_metadata-0.1.1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "dd86531f05f95e4e994561271fc87da0",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.8",
"size": 14000,
"upload_time": "2023-04-25T21:16:52",
"upload_time_iso_8601": "2023-04-25T21:16:52.482285Z",
"url": "https://files.pythonhosted.org/packages/5f/b9/13cac8e6823f356f8b0e3daac48d941766ca7dd1156a1053dbae41f3cf2f/ndx_odor_metadata-0.1.1-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8d0af5c8d707028accc01baf2b6e80546b250189d9462c9b6a0810763c6270e4",
"md5": "e867950643de2cbff33550de35cb28bc",
"sha256": "7de42b883f49e1c964d17437087b85ce95af5bb8c948ac7b13858570de8a3048"
},
"downloads": -1,
"filename": "ndx-odor-metadata-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "e867950643de2cbff33550de35cb28bc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 23536,
"upload_time": "2023-04-25T21:16:54",
"upload_time_iso_8601": "2023-04-25T21:16:54.831468Z",
"url": "https://files.pythonhosted.org/packages/8d/0a/f5c8d707028accc01baf2b6e80546b250189d9462c9b6a0810763c6270e4/ndx-odor-metadata-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-25 21:16:54",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "ndx-odor-metadata"
}