Functions for creating and searching a registry of file types.
registry-utils.RdFunctions for creating and searching a registry of file types based on file extension.
Usage
registerFileType(type, package, regex)
findTypeRegistry(fnames)
makeFileType(fnames, ..., regex=findTypeRegistry(fnames))Arguments
- type
The List class the file is associated with such as BamFileList, BigWigFileList, FaFileList.
- package
The package where the List class (
type) is defined.- regex
A regular expression that uniquely identifies the file extension.
- fnames
A
charactervector of file names.- ...
Additional arguments passed to the List-class constructor (e.g., yieldSize for BamFileList).
Details
registerFileType The
registerFileTypefunction adds entries to the file type register created at load time. The point of the register is for discovery of file type (class) by file extension. These are List-type classes (e.g., BamFileList) that occupy thefileListslot of a GenomicFiles class. Each List class entry in the register is associated with (1) a regular expression that identifies the file extension, (2) a class and (3) the package where the class is defined. At load time the register is populated with classes known to GenomicFiles. New classes / file types can be added to the register withregisterFileTypeby providing these three pieces of information.findTypeRegistry Searches the registry for a match to the extension of
fname. Internal use only.makeFileType Performs a look-up in the file registry based on the supplied regular expression; returns an object of the associated class. Internal use only.