Package: minerva-cli
Minerva CLIIntroductionMinerva 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.ConfigurationMinerva 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 commandminerva configureMinerva CLI will then prompt you for the following pieces of information:Parameter nameDescriptionMINERVA_REGIONus-east-1 (aws region where Minerva is installed)MINERVA_USERNAMEMinerva Username (can be left empty)MINERVA_PASSWORDMinerva Password (can be left empty)MINERVA_ENDPOINTAPI Gateway stage URL, e.g.https://xxxxxxxxxx.execute-api.us-east-1.amazonaws.com/devMINERVA_CLIENT_IDCognito App client id for the user poolThere 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 helppython minerva.pyImport a directory of images into Minerva CloudReplace 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.pythonminerva.pyimport-rREPOSITORY_NAME-dPATH_TO_DIRECTORYImport a single file.pythonminerva.pyimport-rREPOSITORY_NAME-fPATH_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.pythonminerva.pyimport-rREPOSITORY_NAME-fPATH_TO_FILE--local```Export OME-TIFF from Minerva Cloud to local diskThe following command will export and save the image by its default name, and save only
the highest pyramid level.pythonminerva.pyexport--idIMAGE_UUIDRunning on O2Installation# Log in O2 with SSH# Clone the minerva-cli repositorygitclonehttps://github.com/labsyspharm/minerva-cli.git# Load necessary modules (you may need to restart bash shell after running this the first time)moduleloadconda2# Create conda environmentcondacreate--nameminervapython=3.6
condaactivateminerva
pipinstall-rrequirements.txt# Configure minerva.configcp.minerva.example~/.minerva# Edit the values in config filenanominerva.config# It's a good idea to prevent other users from reading your configuration filechmod700~/.minervaImport images from ImStor into Minerva Cloud# Log in O2 transfer node with SSH (replace ecommonsid with your eCommons user id)sshecommonsid@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 SSHsshecommons@o2.hms.harvard.edu# Start interactive O2 sessionsrun--pty-pinteractive--mem500M-t0-06:00/bin/bash# Activate conda environmentcondaactivateminerva# Run Minerva import# (replace [REPOSITORY] with a repository name)# All the images from the given directory will be importedpython$HOME/minerva-cli/minerva.pyimport-r[REPOSITORY]-d/n/scratch3/$USER/dataset