Tools

Command line interface (CLI)

Compile from source code

RAMANMETRIX CLI comes with two options that can be used, a flow based(ramanmetrixCLI.py) version for a guided user experience, or a argument based(ramanmetrixArgCLI.py) verison for a more minimal use case or to be used programatically.

Opition 1:

  1. Clone the repository to a local directory.

        git clone https://git.photonicdata.science/ramanmetrix-project/ramanmetrix-arg-cli.git 
    
    1
  2. Create and activate your virtual environment.

        virtualenv your-env-name-here
    
        your-env-name-here\Scripts\activate
    
    1
    2
    3
  3. Run:

        pip install -r requirements.txt
    
    1
  4. If the ramanmetrix_backend.exe is not installed in a default location, please take note of the installation pathway to lauch it manually through the CLI prompts. If you are unable to find it, the ramanmetrixArgCLI comes with a search command named exeFinder that can be run to find it.

  5. Run:

        python ramanmetrixCLI.py
                or
        python ramanmetrixArgCLI.py
    
    1
    2
    3

Option 2:

  1. git clone the repository to a local directory (*see optition 1)
  2. Create and activate your virtual environment (*see optition 1)
  3. If ramanmetrix_backend.exe is not installed in default location, please take note of installation pathway to lauch it manually through the CLI prompts.
  4. Run: python setup.py and build the package to a local directory. The program can then be called globally with the following namespace.
    python setup.py

    ramanmetrixCLI or ramanmetrixArgCLI
1
2
3

Usage

RAMANMETRIX Argument CLI

  1. The user must choose whether to use the offline or online client. If the user would like to use the online client they must call the login command before any other chained commands. The user must provide their username as argument using --username or -u. Example of login call is seen below:

    # connection to online client
    
    ramanmetrixArgCLI login -u Demouser
    
    1
    2
    3
  2. The user can then choose between 4 different analysis pathway commands:

    1. Train models
      1. --online/--offline (-on/-off): chooses which backend client to connect to.
      2. --params/--noparams (-p/-np): to be set if user wants to upload parameter file.
      3. --export/--noexport (-x/-nx): to be set if user wants to export model file.
    2. Preprocess
      1. --online/--offline (-on/-off): chooses which backend client to connect to.
      2. --export/--noexport (-x/-nx): to be set if user wants to export model file.
    3. Predict
      1. --online/--offline (-on/-off): chooses which backend client to connect to.
      2. --export/--noexport (-x/-nx): to be set if user wants to export model file.
    4. apiCall
      1. --online/--offline (-on/-off): chooses which backend client to connect to.
      2. --apicall (-a): argument keyword of apicall to make. These pathways are called by keyword and if the online client is chosen by chaining the command after the login command. Every command asks for boolean flags with the most important being --online/--offline(-on/-off) indicating which client to use.
#example train model call for online clients

ramanmetrixArgCLI login -u Demouser trainmodel -on -p -x 
1
2
3

RAMANMETRIX Flow CLI

The flow based CLI guides the user through a series of prompts that makes similar calls that the argument CLI does but is more user friendly. The user will first be asked if they would like to use the online or offline client. After which the same 4 analysis pathways may be selected for further analysis. After the analysis pathway is finished, the user is asked if they would like to restart the analysis and process more data. An example of the Flow CLI is depicted below:

Image from alias

Metadata loader

Download and run Metaloader

The metaloader app allows the user to automatically load folder/file structures into a data table for creating the necessary metadata table needed for use with the RAMANMETRIX client. The program can be run locally or built to a specific operating system as an executbale using rust cargo crate manager. For convience purposes, the most recent pre-built versions for x86_64_windows and linux versions are available for download from the releases section of the gitlab repository Metaloader releasesopen in new window.

Compile from source code

If the operating system of the user is not prebuilt, the user can easily build the application locally using the following instructions:

Build locally using rust:

  1. Clone the repository to a local directory

    git clone https://git.photonicdata.science/Timothy.holbrook/ramanmetrix-metaloader.git
    cd ramanmetrix-metaloader
    
    1
    2
  2. Install rust

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    
    1
  3. Rust trys to configure the PATH automatically during installation, however if it is not this must be added to enviroment variable path manually. The user can test if rust has been added to the PATH via:

    rustc --version
    
    1
  4. The binary can then be built using the following command:

    cargo build --release
    
    1
  5. The OS specifc binary will then be present and ready for use in the ./your-metaloader-dir/target/release

Usage

  1. Place the binary file where you would like the resulting metatables to be exported, then run the binary via the filebrowser or command line. This will then prompt the user to select the top directory where the metadata folder structure is located and a directory for exporting the resulting metatables. After completion the program will export two versions of the metatable one for folder only structure and one for file-based batch structure.
  2. The user can learn more about the correct folder structure to use in the following documentation section defined from folder structureopen in new window