Skip to contents

This function allows you to validate AI classifications in Agouti by downloading a datapackage from Google Drive, filtering observations based on the specified AI model and species, and opening the relevant sequence IDs in Agouti for manual validation.

Usage

agouti_validate_ai(
  gfileID,
  ai_model = "Europe",
  species = NULL,
  ask = TRUE,
  download_again = FALSE,
  skip_tracking = TRUE,
  email
)

Arguments

gfileID

The Google Drive file ID of the datapackage to be downloaded.

ai_model

The name of the AI model used for classification (e.g., "Europe"). Default is "Europe".

species

Optional. A vector of species (scientific names) to filter the observations for validation. If NULL, the user will be prompted to select species from the available options.

ask

Optional. Boolean whether the user should be prompted to download the datapackage again when it exists in the temporary directory. Default is TRUE.

download_again

Optional. Boolean whether should be downloaded again even if the datapackage exists in the temporary directory. Default is FALSE.

skip_tracking

Optional. Boolean value indicating whether to skip tracking processed sequences. Defaults to TRUE.

email

Optional. The email address used for authentication when downloading the datapackage from Google Drive. If not provided, the function will attempt to retrieve it from system environment variables or prompt the user for input.

Value

None. The function opens URLs in the default web browser for validation.

Details

The function performs the following steps:

  1. Checks for the required parameters and prompts the user if necessary.

  2. Downloads the specified datapackage from Google Drive using the provided file ID.

  3. Unzips the downloaded datapackage and reads it using the camtraptor package.

  4. Filters the observations based on the specified AI model and species.

  5. Extracts the unique sequence IDs from the filtered observations and opens them in Agouti for manual validation using the agouti_imager function.

  6. The user can validate the classifications in Agouti NOTE: As a default, this function doesn't track which sequences have been validated!

Filtering occurs using base::grepl() on the classifiedBy field. This means that when ai_model = "Europe", the sequences with classifiedBy %in% c("Europe v1", "Europe v1.2", "Europe v2", ...) are withheld to be manually validated using agouti_imager.

Author

Sander Devisscher

Examples

if (FALSE) { # \dontrun{
agouti_validate_ai(gfileID = "your_google_drive_file_id",
                   ai_model = "Europe",
                   species = c("Lynx lynx", "Canis lupus"))
} # }