Learn R Programming

imageHTS (version 1.22.0)

fileHTS: Get access to screen data files

Description

fileHTS builds the path or URL pointing to a screen data file. readHTS reads the file pointed by fileHTS.

Usage

fileHTS(x, type, ..., createPath=FALSE, access='cache') readHTS(x, type, ..., access='cache', format=NULL)

Arguments

x
An imageHTS object.
type
A character vector, indicating the requested file type. See Details.
...
Optional arguments. See Details.
createPath
A logical value specifying if the directories along the path should be created. Default is FALSE.
access
A character string indicating how to access the data. Valid values are cache (the default), local and server. See Details.
format
An optional character string indicating the format of the designated file. Valid formats are tab, a tab-separated file with headers; rda, a R data file; dcf, an imageHTS DCF configuration file.

Value

fileHTS returns a character vector containing the path or URL of the requested file. readHTS returns the content of the requested file.

Details

In imageHTS, all screen data files are accessed through the function fileHTS. Screen data can be accessed at two locations: the localPath, which is local writable directory, and serverURL, which is a server URL. localPath and serverURL are set during the instantiation of the imageHTS object with parseImageConf. If access equals local, fileHTS returns a local path pointing to the requested file. If server, fileHTS returns a server URL pointing to the requested file. If cache (the default), fileHTS tests if the file is present at the local path. If not, fileHTS tries to download the file from the server and copies it in the local path. fileHTS always returns a local path if access equals cache.

A file is designated by its type and optional arguments. Known file types are:

  • file: general-purpose file. The character string filename indicates its path, relative to the project directory. File format is unspecified.
  • source: source image, designated by the character string uname and the numeric channel. File format is unspecified.
  • cal: calibrated image, designated by the character string uname. The file is a R data file which contains an EBImage image object.
  • seg: segmentation data, designated by the character string uname. The file is a R data file which contains a list of two EBImage image objects: cseg containing the cell mask and nseg the nucleus mask.
  • ftrs: cell features, designated by the character string uname. The file is a tab-separated file which contains the cell features.
  • clabels: cell labels, designated by the character string uname. The file is a tab-separated file which contains the cell labels.
  • viewfull: calibrated JPEG image, designated by the character string uname. The file is a JPEG image.
  • viewunmonted: spot-untiled calibrated JPEG image, designated by the character string uname and the spot number spot. The file is a JPEG image.
  • viewseg: segmented JPEG image, designated by the character string uname. The file is a JPEG image.
  • viewthumb: thumbnail JPEG image, designated by the character string uname. The file is a JPEG image.

readHTS reads and returns the corresponding file. format must be specified if type is file or source.

See Also

parseImageConf, getUnames

Examples

Run this code
## initialize imageHTS object using the local submorph screen
local = tempdir()
server = system.file('submorph', package='imageHTS')
x = parseImageConf('conf/imageconf.txt', localPath=local, serverURL=server)

## fileHTS and readHTS examples
fileHTS(x, 'file', filename='conf/imageconf.txt')
fileHTS(x, 'source', uname='001-01-C05', channel=1)
readHTS(x, 'file', filename='conf/featurepar.txt', format='dcf')

## initialize imageHTS object using the remote kimorph screen
local = tempdir()
server = 'http://www.ebi.ac.uk/huber-srv/cellmorph/kimorph/'
x = parseImageConf('conf/imageconf.txt', localPath=local, serverURL=server)

## get cell features for well '002-02-D06'
f = readHTS(x, 'ftrs', uname='002-02-D06')
cat('nb cells=', nrow(f), '\n')

Run the code above in your browser using DataLab