WorkFiles: Functions for working with WorkFiles

WorkFilesR Documentation

Functions for working with WorkFiles

Description

These functions attempt to add or retrieve a single WorkFile, to list WorkFile records, to add a set of WorkFiles (specified via a set of filenames or in an archive), to pass data between R objects and WorkFiles, or to test whether a character string represents a valid WorkFile identifier.

Usage

addWorkFile(
  filename,
  fileType = file_ext(sub("\\.gz$", "", filename)),
  compress = TRUE,
  group,
  storage,
  token,
  permissions = getOption("GeneHive.permissions"),
  con = hiveConnection(),
  verbose = getOption("GeneHive.verbose")
)

getWorkFile(
  id,
  filename,
  con = hiveConnection(),
  verbose = getOption("GeneHive.verbose")
)

getWorkFileAsObject(
  id,
  con = hiveConnection(),
  verbose = getOption("GeneHive.verbose")
)

importWorkFiles(
  filenames,
  ...,
  permissions = getOption("GeneHive.permissions"),
  con = hiveConnection(),
  verbose = getOption("GeneHive.verbose")
)

importWorkFileArchive(
  filename,
  ...,
  permissions = getOption("GeneHive.permissions"),
  con = hiveConnection(),
  verbose = getOption("GeneHive.verbose")
)

storeObjectAsWorkFile(
  x,
  permissions = getOption("GeneHive.permissions"),
  con = hiveConnection(),
  verbose = getOption("GeneHive.verbose")
)

validWorkFileId(id, con = hiveConnection())

Arguments

filename

A character string specifying the full path to a file; for importWorkFileArchive, this must be a .tar, .tgz, .tar.gz or .zip file

fileType

A character string specifying the file type (e.g., extension) of the WorkFile

compress

A logical value specifying whether to gzip-compress the WorkFile on upload; if the contents of the WorkFile are already gzipped, this is ignored

group

A character string specifying the name of the Group associated with the WorkFile. If missing, the group belonging to the user uploading the WorkFile is automatically used by the system.

storage

A character string specifying the location in which the WorkFile is stored.

token

A character string specifying a token that can be used for password-free authentication. Automatically populated when a WorkFile is uploaded.

permissions

A hivePermissions object specifying the permissions to be used when creating the record

con

A hiveConnection object; if not provided, a new connection will be established

verbose

A logical value specifying whether messages should be printed

id

A hiveWorkFileID object (or coercible to one) specifying the unique identifier of a WorkFileProperties record. Automatically populated when a WorkFile is uploaded.

filenames

A character vector specifying the full path to one or more files

...

Additional arguments specifying WorkFileProperties fields on which to limit a listing

x

An R object to be uploaded as a WorkFile

Value

addWorkFile

If a WorkFile exists with the same hash as the input file, it is assumed that they are identical; the existing record will be returned invisibly as a linkS4class{hiveWorkFileProperties} object, and a warning message will be issued. If a WorkFile does not exist with the same MD5 hash as the input file, the file is uploaded and the resulting WorkFile is returned invisibly as a linkS4class{hiveWorkFileProperties} object.

getWorkFile

No value is returned.

importWorkFiles, importWorkFileArchive

If the operation is successful, a hiveWorkFileIDList object is returned invisibly; otherwise, the function terminates with an error message.

storeObjectAsWorkFile

If the operation is successful, a hiveWorkFileProperties object is invisibly returned.

getWorkFileAsObject

If the operation is successful, an R object is invisibly returned: either the R object encoded in the file (if the WorkFile is an RDS file) or the contents of the WorkFile (as a raw vector).

listWorkFiles

A data frame containing one row per record and one column per field.

validWorkFileId

A logical value specifying whether the string corresponds to a WorkFile identifier.

All functions

If an error is encountered, the function terminates with a message.

Author(s)

Adam C. Gower agower@bu.edu


agower/GeneHive documentation built on April 14, 2022, 5:08 a.m.