Name | fairscape-cli JSON |
Version |
1.0.2
JSON |
| download |
home_page | None |
Summary | A utility for packaging objects and validating metadata for FAIRSCAPE |
upload_time | 2024-10-30 17:25:06 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | Copyright 2023 THE RECTOR AND VISITORS OF THE UNIVERSITY OF VIRGINIA Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
fairscape
reproducibility
fair
b2ai
cli
ro-crate
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# fairscape-cli
A utility for packaging objects and validating metadata for FAIRSCAPE.
---
**Documentation**: [https://fairscape.github.io/fairscape-cli/](https://fairscape.github.io/fairscape-cli/)
---
## Features
fairscape-cli provides a Command Line Interface (CLI) that allows the client side to create:
* [RO-Crate](https://www.researchobject.org/ro-crate/) - a light-weight approach to packaging research data with their metadata. The CLI allows users to:
* Create Research Object Crates (RO-Crates)
* Add (transfer) digital objects to the RO-Crate
* Register metadata of the objects
* Describe the schema of tabular dataset objects as metadata and perform validation.
## Requirements
Python 3.8+
## Installation
```console
$ pip install fairscape-cli
```
## Minimal example
### Basic commands
* Show all commands, arguments, and options
```console
$ fairscape-cli --help
```
* Create an RO-Crate in a specified directory
```console
$ fairscape-cli rocrate create \
--name "test rocrate" \
--description "Example RO Crate for Tests" \
--organization-name "UVA" \
--project-name "B2AI" \
--keywords "b2ai" \
--keywords "cm4ai" \
--keywords "U2OS" \
"./test_rocrate"
```
* Create an RO-Crate in the current working directory
```console
$ fairscape-cli rocrate init \
--name "test rocrate" \
--description "Example RO Crate for Tests" \
--organization-name "UVA" \
--project-name "B2AI" \
--keywords "b2ai" \
--keywords "cm4ai" \
--keywords "U2OS"
```
* Add a dataset to the RO-Crate
```console
$ fairscape-cli rocrate add dataset \
--name "AP-MS embeddings" \
--author "Krogan lab (https://kroganlab.ucsf.edu/krogan-lab)" \
--version "1.0" \
--date-published "2021-04-23" \
--description "Affinity purification mass spectrometer (APMS) embeddings for each protein in the study, generated by node2vec predict." \
--keywords "b2ai" \
--keywords "cm4ai" \
--keywords "U2OS" \
--data-format "CSV" \
--source-filepath "./tests/data/APMS_embedding_MUSIC.csv" \
--destination-filepath "./test_rocrate/APMS_embedding_MUSIC.csv" \
"./test_rocrate"
```
* Add a software to the RO-Crate
```console
$ fairscape-cli rocrate add software \
--name "calibrate pairwise distance" \
--author "Qin, Y." \
--version "1.0" \
--description "script written in python to calibrate pairwise distance." \
--keywords "b2ai" \
--keywords "cm4ai" \
--keywords "U2OS" \
--file-format "py" \
--source-filepath "./tests/data/calibrate_pairwise_distance.py" \
--destination-filepath "./test_rocrate/calibrate_pairwise_distance.py" \
--date-modified "2021-04-23" \
"./test_rocrate"
```
* Register a computation to the RO-Crate
```console
$ fairscape-cli rocrate register computation \
--name "calibrate pairwise distance" \
--run-by "Qin, Y." \
--date-created "2021-05-23" \
--description "Average the predicted proximities" \
--keywords "b2ai" \
--keywords "cm4ai" \
--keywords "U2OS" \
"./test_rocrate"
```
* Create a schema
```console
$ fairscape-cli schema create-tabular \
--name 'APMS Embedding Schema' \
--description 'Tabular format for APMS music embeddings from PPI networks from the music pipeline from the B2AI Cellmaps for AI project' \
--separator ',' \
--header False \
./schema_apms_music_embedding.json
```
* Add a string property
```console
$ fairscape-cli schema add-property string \
--name 'Experiment Identifier' \
--index 0 \
--description 'Identifier for the APMS experiment responsible for generating the raw PPI used to create this embedding vector' \
--pattern '^APMS_[0-9]*$' \
./schema_apms_music_embedding.json
```
* Add annother string property
```console
$ fairscape-cli schema add-property string \
--name 'Gene Symbol' \
--index 1 \
--description 'Gene Symbol for the APMS bait protien' \
--pattern '^[A-Za-z0-9\-]*$' \
--value-url 'http://edamontology.org/data_1026' \
./schema_apms_music_embedding.json
```
* Add an array property
```console
$ fairscape-cli schema add-property array \
--name 'MUSIC APMS Embedding' \
--index '2::' \
--description 'Embedding Vector values for genes determined by running node2vec on APMS PPI networks. Vector has 1024 values for each bait protien' \
--items-datatype 'number' \
--unique-items False \
--min-items 1024 \
--max-items 1024 \
./schema_apms_music_embedding.json
```
* Show a successful validation of the schema against the dataset
```console
$ fairscape-cli schema validate \
--data ./examples/schemas/MUSIC_embedding/APMS_embedding_MUSIC.csv \
--schema ./examples/schemas/MUSIC_embedding/music_apms_embedding_schema.json
```
* Show an unsuccessful validation of the schema against the dataset
```console
$ fairscape-cli schema validate \
--data examples/schemas/MUSIC_embedding/APMS_embedding_corrupted.csv \
--schema examples/schemas/MUSIC_embedding/music_apms_embedding_schema.json
```
* Validate using default schemas
```console
# validate imageloader files
$ fairscape-cli schema validate \
--data "examples/schemas/cm4ai-rocrates/imageloader/samplescopy.csv" \
--schema "ark:59852/schema-cm4ai-imageloader-samplescopy"
$ fairscape-cli schema validate \
--data "examples/schemas/cm4ai-rocrates/imageloader/uniquecopy.csv" \
--schema "ark:59852/schema-cm4ai-imageloader-uniquecopy"
# validate image embedding outputs
$ fairscape-cli schema validate \
--data "examples/schemas/cm4ai-rocrates/image_embedding/image_emd.tsv" \
--schema "ark:59852/schema-cm4ai-image-embedding-image-emd"
$ fairscape-cli schema validate \
--data "examples/schemas/cm4ai-rocrates/image_embedding/labels_prob.tsv" \
--schema "ark:59852/schema-cm4ai-image-embedding-labels-prob"
# validate apsm loader input
$ fairscape-cli schema validate \
--data "examples/schemas/cm4ai-rocrates/apmsloader/ppi_gene_node_attributes.tsv" \
--schema "ark:59852/schema-cm4ai-apmsloader-gene-node-attributes"
$ fairscape-cli schema validate \
--data "examples/schemas/cm4ai-rocrates/apmsloader/ppi_edgelist.tsv" \
--schema "ark:59852/schema-cm4ai-apmsloader-ppi-edgelist"
# validate apms embedding
$ fairscape-cli schema validate \
--data "examples/schemas/cm4ai-rocrates/apms_embedding/ppi_emd.tsv" \
--schema "ark:59852/schema-cm4ai-apms-embedding"
# validate coembedding
$ fairscape-cli schema validate \
--data "examples/schemas/cm4ai-rocrates/coembedding/coembedding_emd.tsv" \
--schema "ark:59852/schema-cm4ai-coembedding"
```
## Contribution
If you'd like to request a feature or report a bug, please create a [GitHub Issue](https://github.com/fairscape/fairscape-cli/issues) using one of the templates provided.
## License
This project is licensed under the terms of the MIT license.
Raw data
{
"_id": null,
"home_page": null,
"name": "fairscape-cli",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "fairscape, reproducibility, FAIR, B2AI, CLI, RO-Crate",
"author": null,
"author_email": "Max Levinson <mal8ch@virginia.edu>, Sadnan Al Manir <sadnanalmanir@gmail.com>, Tim Clark <twc8q@virginia.edu>",
"download_url": "https://files.pythonhosted.org/packages/e3/56/ebb683dd2ceb9f281d8eeec02feb7a964ae0357d11bcb2cb6052d97690d0/fairscape_cli-1.0.2.tar.gz",
"platform": null,
"description": "# fairscape-cli\nA utility for packaging objects and validating metadata for FAIRSCAPE.\n\n---\n**Documentation**: [https://fairscape.github.io/fairscape-cli/](https://fairscape.github.io/fairscape-cli/)\n---\n\n## Features\n\nfairscape-cli provides a Command Line Interface (CLI) that allows the client side to create:\n\n* [RO-Crate](https://www.researchobject.org/ro-crate/) - a light-weight approach to packaging research data with their metadata. The CLI allows users to:\n * Create Research Object Crates (RO-Crates)\n * Add (transfer) digital objects to the RO-Crate\n * Register metadata of the objects\n * Describe the schema of tabular dataset objects as metadata and perform validation.\n\n## Requirements\n\nPython 3.8+\n\n## Installation\n```console\n$ pip install fairscape-cli\n```\n\n## Minimal example \n\n### Basic commands\n\n* Show all commands, arguments, and options\n\n```console\n$ fairscape-cli --help\n```\n\n* Create an RO-Crate in a specified directory\n\n```console\n$ fairscape-cli rocrate create \\\n --name \"test rocrate\" \\\n --description \"Example RO Crate for Tests\" \\\n --organization-name \"UVA\" \\\n --project-name \"B2AI\" \\\n --keywords \"b2ai\" \\\n --keywords \"cm4ai\" \\\n --keywords \"U2OS\" \\\n \"./test_rocrate\"\n```\n\n* Create an RO-Crate in the current working directory\n\n```console\n$ fairscape-cli rocrate init \\\n --name \"test rocrate\" \\\n --description \"Example RO Crate for Tests\" \\\n --organization-name \"UVA\" \\\n --project-name \"B2AI\" \\\n --keywords \"b2ai\" \\\n --keywords \"cm4ai\" \\\n --keywords \"U2OS\"\n```\n\n* Add a dataset to the RO-Crate\n\n```console\n$ fairscape-cli rocrate add dataset \\\n --name \"AP-MS embeddings\" \\\n --author \"Krogan lab (https://kroganlab.ucsf.edu/krogan-lab)\" \\\n --version \"1.0\" \\\n --date-published \"2021-04-23\" \\\n --description \"Affinity purification mass spectrometer (APMS) embeddings for each protein in the study, generated by node2vec predict.\" \\\n --keywords \"b2ai\" \\\n --keywords \"cm4ai\" \\\n --keywords \"U2OS\" \\\n --data-format \"CSV\" \\\n --source-filepath \"./tests/data/APMS_embedding_MUSIC.csv\" \\\n --destination-filepath \"./test_rocrate/APMS_embedding_MUSIC.csv\" \\\n \"./test_rocrate\"\n```\n\n* Add a software to the RO-Crate\n\n```console\n$ fairscape-cli rocrate add software \\\n --name \"calibrate pairwise distance\" \\\n --author \"Qin, Y.\" \\\n --version \"1.0\" \\\n --description \"script written in python to calibrate pairwise distance.\" \\\n --keywords \"b2ai\" \\\n --keywords \"cm4ai\" \\\n --keywords \"U2OS\" \\\n --file-format \"py\" \\\n --source-filepath \"./tests/data/calibrate_pairwise_distance.py\" \\\n --destination-filepath \"./test_rocrate/calibrate_pairwise_distance.py\" \\\n --date-modified \"2021-04-23\" \\\n \"./test_rocrate\"\n```\n\n* Register a computation to the RO-Crate\n\n```console\n$ fairscape-cli rocrate register computation \\\n --name \"calibrate pairwise distance\" \\\n --run-by \"Qin, Y.\" \\\n --date-created \"2021-05-23\" \\\n --description \"Average the predicted proximities\" \\\n --keywords \"b2ai\" \\\n --keywords \"cm4ai\" \\\n --keywords \"U2OS\" \\\n \"./test_rocrate\"\n```\n\n* Create a schema\n\n```console\n$ fairscape-cli schema create-tabular \\\n --name 'APMS Embedding Schema' \\\n --description 'Tabular format for APMS music embeddings from PPI networks from the music pipeline from the B2AI Cellmaps for AI project' \\\n --separator ',' \\\n --header False \\\n ./schema_apms_music_embedding.json\n```\n\n* Add a string property\n\n```console\n$ fairscape-cli schema add-property string \\\n --name 'Experiment Identifier' \\\n --index 0 \\\n --description 'Identifier for the APMS experiment responsible for generating the raw PPI used to create this embedding vector' \\\n --pattern '^APMS_[0-9]*$' \\\n ./schema_apms_music_embedding.json\n```\n\n* Add annother string property\n\n```console\n$ fairscape-cli schema add-property string \\\n --name 'Gene Symbol' \\\n --index 1 \\\n --description 'Gene Symbol for the APMS bait protien' \\\n --pattern '^[A-Za-z0-9\\-]*$' \\\n --value-url 'http://edamontology.org/data_1026' \\\n ./schema_apms_music_embedding.json\n```\n\n* Add an array property\n\n```console\n$ fairscape-cli schema add-property array \\\n --name 'MUSIC APMS Embedding' \\\n --index '2::' \\\n --description 'Embedding Vector values for genes determined by running node2vec on APMS PPI networks. Vector has 1024 values for each bait protien' \\\n --items-datatype 'number' \\\n --unique-items False \\\n --min-items 1024 \\\n --max-items 1024 \\\n ./schema_apms_music_embedding.json\n```\n\n* Show a successful validation of the schema against the dataset\n\n```console\n$ fairscape-cli schema validate \\\n --data ./examples/schemas/MUSIC_embedding/APMS_embedding_MUSIC.csv \\\n --schema ./examples/schemas/MUSIC_embedding/music_apms_embedding_schema.json\n```\n\n* Show an unsuccessful validation of the schema against the dataset\n\n```console\n$ fairscape-cli schema validate \\\n --data examples/schemas/MUSIC_embedding/APMS_embedding_corrupted.csv \\\n --schema examples/schemas/MUSIC_embedding/music_apms_embedding_schema.json\n```\n\n* Validate using default schemas\n\n```console\n# validate imageloader files\n$ fairscape-cli schema validate \\\n --data \"examples/schemas/cm4ai-rocrates/imageloader/samplescopy.csv\" \\\n --schema \"ark:59852/schema-cm4ai-imageloader-samplescopy\" \n \n$ fairscape-cli schema validate \\\n --data \"examples/schemas/cm4ai-rocrates/imageloader/uniquecopy.csv\" \\\n --schema \"ark:59852/schema-cm4ai-imageloader-uniquecopy\"\n \n# validate image embedding outputs\n$ fairscape-cli schema validate \\\n --data \"examples/schemas/cm4ai-rocrates/image_embedding/image_emd.tsv\" \\\n --schema \"ark:59852/schema-cm4ai-image-embedding-image-emd\"\n \n$ fairscape-cli schema validate \\\n --data \"examples/schemas/cm4ai-rocrates/image_embedding/labels_prob.tsv\" \\\n --schema \"ark:59852/schema-cm4ai-image-embedding-labels-prob\"\n\n# validate apsm loader input\n$ fairscape-cli schema validate \\\n --data \"examples/schemas/cm4ai-rocrates/apmsloader/ppi_gene_node_attributes.tsv\" \\\n --schema \"ark:59852/schema-cm4ai-apmsloader-gene-node-attributes\"\n\n$ fairscape-cli schema validate \\\n --data \"examples/schemas/cm4ai-rocrates/apmsloader/ppi_edgelist.tsv\" \\\n --schema \"ark:59852/schema-cm4ai-apmsloader-ppi-edgelist\"\n\n# validate apms embedding \n$ fairscape-cli schema validate \\\n --data \"examples/schemas/cm4ai-rocrates/apms_embedding/ppi_emd.tsv\" \\\n --schema \"ark:59852/schema-cm4ai-apms-embedding\" \n\n# validate coembedding \n$ fairscape-cli schema validate \\\n --data \"examples/schemas/cm4ai-rocrates/coembedding/coembedding_emd.tsv\" \\\n --schema \"ark:59852/schema-cm4ai-coembedding\"\n```\n\n## Contribution\n\nIf you'd like to request a feature or report a bug, please create a [GitHub Issue](https://github.com/fairscape/fairscape-cli/issues) using one of the templates provided.\n\n\n## License\n\nThis project is licensed under the terms of the MIT license.\n",
"bugtrack_url": null,
"license": "Copyright 2023 THE RECTOR AND VISITORS OF THE UNIVERSITY OF VIRGINIA Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u201cSoftware\u201d), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \u201cAS IS\u201d, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"summary": "A utility for packaging objects and validating metadata for FAIRSCAPE",
"version": "1.0.2",
"project_urls": {
"Changelog": "https://github.com/fairscape/fairscape-cli/blob/main/CHANGELOG.md",
"Citation": "https://github.com/fairscape/fairscape-cli/blob/main/CITATION.cff",
"Documentation": "https://fairscape.github.io/fairscape-cli/",
"Homepage": "https://github.com/fairscape/fairscape-cli",
"Issues": "https://github.com/fairscape/fairscape-cli/issues",
"Repository": "https://github.com/fairscape/fairscape-cli.git"
},
"split_keywords": [
"fairscape",
" reproducibility",
" fair",
" b2ai",
" cli",
" ro-crate"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "38831c6eb81a5fe9c729fb401bbdb3ca647b94a6883840d5815549d3e6074a17",
"md5": "a1444fe84f102688cf8ee64c10313b3f",
"sha256": "8ee278ced78a18007628777df4de1ab9e08249dcd4b39b1dbf1076038521492d"
},
"downloads": -1,
"filename": "fairscape_cli-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a1444fe84f102688cf8ee64c10313b3f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 38837,
"upload_time": "2024-10-30T17:25:04",
"upload_time_iso_8601": "2024-10-30T17:25:04.964740Z",
"url": "https://files.pythonhosted.org/packages/38/83/1c6eb81a5fe9c729fb401bbdb3ca647b94a6883840d5815549d3e6074a17/fairscape_cli-1.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e356ebb683dd2ceb9f281d8eeec02feb7a964ae0357d11bcb2cb6052d97690d0",
"md5": "393d67eb714df59253044a8dfa0bf380",
"sha256": "8c091e279d7299cf2f73f656e4385a46a780db96eb05ce036c5e63a0a995a24b"
},
"downloads": -1,
"filename": "fairscape_cli-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "393d67eb714df59253044a8dfa0bf380",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 34583,
"upload_time": "2024-10-30T17:25:06",
"upload_time_iso_8601": "2024-10-30T17:25:06.509156Z",
"url": "https://files.pythonhosted.org/packages/e3/56/ebb683dd2ceb9f281d8eeec02feb7a964ae0357d11bcb2cb6052d97690d0/fairscape_cli-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-30 17:25:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "fairscape",
"github_project": "fairscape-cli",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "fairscape-cli"
}