https://github.com/Sage-Bionetworks/synapsegenie
This package can deploy a AACR GENIE like project on Synapse and perform validation and processing of files.
https://github.com/Sage-Bionetworks/synapsegenie
python synapse
Last synced: 24 days ago
JSON representation
This package can deploy a AACR GENIE like project on Synapse and perform validation and processing of files.
- Host: GitHub
- URL: https://github.com/Sage-Bionetworks/synapsegenie
- Owner: Sage-Bionetworks
- License: mit
- Created: 2020-08-31T17:12:06.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2022-11-13T00:05:54.000Z (over 2 years ago)
- Last Synced: 2025-04-24T02:41:37.444Z (about 1 month ago)
- Topics: python, synapse
- Language: Python
- Homepage:
- Size: 2.25 MB
- Stars: 2
- Watchers: 6
- Forks: 1
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-synapse - synapsegenie - Crawl through Synapse files to validate and process them given a plugin file format registry. (Python / Shiny)
README
# Synapse Genie
## Introduction
This package can deploy a AACR GENIE like project on Synapse and perform validation and processing of files.
## Installation
Dependencies:
- Python 3.7 or higher
- [synapseclient](http://python-docs.synapse.org) (`pip install synapseclient`)
- Python [pandas](http://pandas.pydata.org) (`pip install pandas`)```
pip install synapsegenie
synapsegenie -v
```## Usage
### Creating your own registry
Please view the [example registry](example_registry) to learn how to utilize `synapsegenie`. `synapsegenie` allows a user to create a registry package with a list of file formats. Each of these file format classes should extend `synapsegenie.example_filetype_format.FileTypeFormat`. Learn more about creating Python packages [here](https://packaging.python.org/tutorials/packaging-projects/). Once you have installed your registry package, you can now use the `synapsegenie` command line client.### synapsegenie Synapse project
A `synapsegenie` Synapse project must exist for you to fully utilize this package. There is now a command to create this infrastructure in Synapse. If you already have an existing Synapse Project you would like to use, please use the `--project_id` parameter, otherwise please use the `--project_name` parameter to create a new Synapse project.```
synapsegenie bootstrap-infra --format_registry_packages example_registry \
--project_name "My Project Name"
--centers AAA BBB CCC
```If you decide to add centers at a later date, you can re-run this command and the center will be added
```
synapsegenie bootstrap-infra --format_registry_packages example_registry \
--project_id syn12345
--centers AAA BBB CCC DDD
```### File Validator
The `synapsegenie` package also has a function to run the validator locally on all of your files. Please view the help to see how to run to validator.```
synapsegenie validate-single-file -hsynapsegenie /path/to/file center_name \
--format_registry_packages example_registry \
--project_id syn12345 \ # Run bootstrap-infra to create a Synapse project
```### Validation/Processing
`synapsegenie` will validate and process all the files uploaded by centers. Every valid file will be processed and uploaded into Synapse tables. [syn22337078](https://www.synapse.org/#!Synapse:syn22337078) is a test project.```
synapsegenie process -h# only validate
synapsegenie process --format_registry_packages example_registry \
--project_id syn22337078 \
--only_validate# Don't download the files, only get the entity for validation
# Sometimes there may be large files in your project which you don't
# want to download
synapsegenie process --format_registry_packages example_registry \
--project_id syn22337078 \
--only_validate \
--only_get_entity
# validate + process
synapsegenie process --format_registry_packages example_registry \
--project_id syn22337078
```## Contributing
To learn how to contribute, please read the [contributing guide](CONTRIBUTING.md)