Skip to main content

Minerva Command Line Interface

Project description

Minerva CLI

Introduction

Minerva Command Line Interface allows uploading and importing microscopy images into Minerva Cloud. Images can also be exported out of Minerva Cloud and saved to local disk in OME-TIFF format.

Configuration

Minerva will by default look for a file named .minerva in the user's home directory and load configuration from that file. Minerva needs the configuration to be able to connect to the correct Minerva service.

Arguments given in command line will override values set in the config file. Config file location may be overridden with argument --config [PATH]

Minerva CLI can be setup by running the command minerva configure Minerva CLI will then prompt you for the following pieces of information:

Parameter name Description
MINERVA_REGION us-east-1 (aws region where Minerva is installed)
MINERVA_USERNAME Minerva Username (can be left empty)
MINERVA_PASSWORD Minerva Password (can be left empty)
MINERVA_ENDPOINT API Gateway stage URL, e.g. https://xxxxxxxxxx.execute-api.us-east-1.amazonaws.com/dev
MINERVA_CLIENT_ID Cognito App client id for the user pool

There is also an example config file provided in case it's easier to edit the file. Copy .minerva.example as $HOME/.minerva, and open the file with a text editor to edit values. All the parameter values can also be set with environment variables.

Show help

python minerva.py

Import a directory of images into Minerva Cloud

Replace REPOSITORY_NAME with a repository name, and PATH_TO_DIRECTORY with a path to a directory. All images from the directory and its subdirectories will be imported.

python minerva.py import -r REPOSITORY_NAME -d PATH_TO_DIRECTORY

Import a single file.

python minerva.py import -r REPOSITORY_NAME -f PATH_TO_FILE```

When importing OME-TIFFs, the parameter --local will process the image locally, and in general will make the import faster with only one or few images.

python minerva.py import -r REPOSITORY_NAME -f PATH_TO_FILE --local```

Export OME-TIFF from Minerva Cloud to local disk

The following command will export and save the image by its default name, and save only the highest pyramid level.

python minerva.py export --id IMAGE_UUID

Running on O2

Installation

# Log in O2 with SSH
# Clone the minerva-cli repository
git clone https://github.com/labsyspharm/minerva-cli.git

# Load necessary modules (you may need to restart bash shell after running this the first time)
module load conda2

# Create conda environment
conda create --name minerva python=3.6
conda activate minerva
pip install -r requirements.txt

# Configure minerva.config
cp .minerva.example ~/.minerva
# Edit the values in config file
nano minerva.config
# It's a good idea to prevent other users from reading your configuration file
chmod 700 ~/.minerva

Import images from ImStor into Minerva Cloud

# Log in O2 transfer node with SSH (replace ecommonsid with your eCommons user id)
ssh ecommonsid@transfer.rc.hms.harvard.edu
# Copy images from ImStor to scratch space, e.g.
mkdir -p /n/scratch3/$USER/dataset
cp /n/files/ImStor/.../image.ome.tif /n/scratch3/$USER/dataset

# Log in O2 with SSH
ssh ecommons@o2.hms.harvard.edu
# Start interactive O2 session
srun --pty -p interactive --mem 500M -t 0-06:00 /bin/bash

# Activate conda environment
conda activate minerva

# Run Minerva import
# (replace [REPOSITORY] with a repository name)
# All the images from the given directory will be imported
python $HOME/minerva-cli/minerva.py import -r [REPOSITORY] -d /n/scratch3/$USER/dataset

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

minerva-cli-0.0.3.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

minerva_cli-0.0.3-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file minerva-cli-0.0.3.tar.gz.

File metadata

  • Download URL: minerva-cli-0.0.3.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for minerva-cli-0.0.3.tar.gz
Algorithm Hash digest
SHA256 8c29913aa7d69bd8b79252187fc777d5b99bd021c62d2bc880740e3c9b9a288c
MD5 9943b1861566d20ae2a53429d6d80fe6
BLAKE2b-256 522466a65da985e81a3c6cb930101c5a582cb6c64e10d27dc254e8f05eb22883

See more details on using hashes here.

File details

Details for the file minerva_cli-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: minerva_cli-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for minerva_cli-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4c8258f9a3e03361c662ea109c7cafb060d7b07b0b566e9770d3edd0cbaa3030
MD5 41e1a370da09cdf86f68521c3537a4e1
BLAKE2b-256 f95c2d896347d8dfec9cb38e2453e81da9f3d6ad6559fe98321f5c236342c342

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page