ffTrack: ffTrack

View source: R/ffTrack.R

ffTrackR Documentation

ffTrack

Description

Constructs new ffTrack for offline storage of genomic data. Allocates memory to store one of several data "modes" (e.g. numeric, byte, character) data types across a fixed interval set (GRanges). Useful for numeric (e.g. conservation track) or character (e.g. human genome sequence) data. Physical instantiation will result in the creation of one or more "heavy" *.ffData files and a lightweight *.rds pointer which is the ffTrack object that is returned by this function. That object can be read or written to using GRanges indices.

Initialization requires (1) a filename (2) a set of GRanges corresponding to the "space" (3) a vmode (one of the following:

  • boolean (1 bit logical)

  • logical (2 bit logical + NA)

  • quad (2 bit unsigned integer without NA) (NOTE: quad' allows efficient storage of genomic data as an 'A','T','G','C' factor. See 'ff' documentation.)

  • nibble (4 bit unsigned integer without NA)

  • byte (8 bit signed integer with NA)

  • ubyte (8 bit unsigned integer without NA)

  • short (16 bit signed integer with NA)

  • ushort (16 bit unsigned integer without NA)

  • integer (32 bit signed integer with NA)

  • single (32 bit float)

  • double (64 bit float)

  • raw (8 bit unsigned char)

Initialization will create two files (1) an .rds object meta data (2) *.ffdata binary ff object These files should have static paths (i.e. should not be moved outside of R) - otherwise will break. However the object will still be functional if the .rds file is moved to another location and loaded from there.

optional argument "levels" will (by default) convert stored values to levels prior to accessing, and populated values to integers prior to storing. In the file, levels will be indexed with 0-based indices (i.e. 0 will refer to the the first level item)

Usage

ffTrack(gr, file.name, default.val = NA, overwrite = FALSE, levels = NULL,
  verbose = FALSE, vmode = "double", ...)

Arguments

gr

GRanges of input ranges

file.name

Filename to store the genomic data

default.val

default val

overwrite

boolean Flag whether to overwrite existing in the filename

levels

Optional argument to specify unique levels for storage of factors,

verbose

Set verbosity

vmode

vmode

Value

ffTrack object

Author(s)

Marcin Imielinski


mskilab/ffTrack documentation built on Feb. 6, 2023, 2:47 a.m.