HUB
Sign inSign up

tetrascience/ts-file-converter

By tetrascience

•Updated about 4 years ago

TS file converter for IDS-JSON and ADF-compatible HDF5.

Image
0

984

tetrascience/ts-file-converter repository overview

⁠TetraScience File Converter

This docker repository contains the image for the TetraScience File Converter. It can be used to transform cell counter IDS-JSON files into ADF-compatible hdf5 files (with adf file extension) or to extract IDS-JSONs from a TS-produced ADF file. For more notes on the file converter, please see our docs⁠

⁠Usage

⁠1. Download docker and sign in

To use this converter, you will first need to download and install docker (available here⁠). You will then need to sign in to your account so that you can access this private repo.

⁠2. Log in in the command line

To pull this repo, you will need to log in to docker in the command line:

docker login

⁠3. Pull this image

You will next need to pull this image:

docker pull tetrascience/ts-file-converter

⁠4. Run the container

This docker container runs main.py to do file conversion. In the sections below, you can find the commands to run the ids-to-hdf5 or hdf5-to-ids. Both of these converters use shared arguments:

Positional arguments:
  converter             Specify converter: 'ids-to-hdf5' or 'hdf5-to-ids'

Required arguments:
  
  -i INPUT, --input INPUT
                        Input IDS-JSON filepath
  -o OUTPUT, --output OUTPUT
                        Output directory

Optional arguments:
  -h, --help            show this help message and exit
  -s SCHEMA, --schema SCHEMA
                        Schema type. Default: 'cell-counter'.
                        Only needed for ids-to-hdf5.

For each command, you will also have to mount a local directory. This is captured in the -v <insert /path/to/file>:/app/tmp argument, and will allow you to convert local files and save the output locally. For more information on mounting in docker, see docker's docs⁠.

⁠ids-to-hdf5

To convert from ids to ADF-compatible hdf5, use the following command:

docker run --rm -v <insert /path/to/file>:/app/tmp tetrascience/ts-file-converter ids-to-hdf5 -i /app/tmp/<input.json> -o /app/tmp/<insert local output-folder>

This command will convert the file at path/to/file/input.json to an ADF-compatible hdf5 at path/to/file/output. Additionally, flattened IDS-JSON and a triple store will be stored at this location.

Notes:

  • This currently only supports the "cell counter" IDS and ADF model. The input IDS is currently validated on the cell-counter v3 IDS. If this validation fails, the parser will fail. Other models may be incorporated in the future.
  • Currenlty, usage of the Allotrope Java libraries for writing datacubes and data packages yields the following error pattern. This is expected, and the ADF-compatible HDF5 is still produced.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by de.osthus.ambeth.repackaged.com.esotericsoftware.reflectasm.AccessClassLoader (file:/app/src/adf_util/ts-lib-allotrope-1.0-SNAPSHOT-jar-with-dependencies.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of de.osthus.ambeth.repackaged.com.esotericsoftware.reflectasm.AccessClassLoader
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
⁠hdf5-to-ids

To extract an ids from a TS-produced ADF-compatible hdf5, use the following command:

docker run --rm -v <insert /path/to/file>:/app/tmp tetrascience/ts-file-converter hdf5-to-ids -i /app/tmp/<input.adf> -o /app/tmp/<insert local output-folder>

This command will convert the file at path/to/file/input.adf to an IDS-JSON at path/to/file/output.

Tag summary

Content type

Image

Digest

sha256:489c7b4cd…

Size

760.8 MB

Last updated

about 4 years ago

docker pull tetrascience/ts-file-converter