loadBED12: loadBED12

Description Usage Arguments Details Value See Also Examples

Description

Load CAGE data from a file in BED12 format.

Usage

1
loadBED12(file, samplename)

Arguments

file

Name of the BED12 file or full path to it. If multiple names are priovided, multiple files will be loaded, but in that case sample names can not be provided with the samplename argument (see below).

samplename

Optional. Name of the sample represented by the file.

Details

Loads a BED12-formatted file in a data.table, and adds an extra column holding the sample name (same for each row). If no sample name is provided, it is created from the file name by removing the .bed and compression extensions.

We use the BED12 format to represent data related to the CAGE and CAGEscan methods. In brief, in a file repesents ‘CAGEscan pairs’, then each line is one read count and the score is the sum of the mapping qualities of both reads. In files representing ‘CAGEscan fragments’, each line is one RNA molecule and the score is the number of CAGEscan pairs that were used to build the fragment. For ‘CAGEscan clusters’, each line is one transcript model and the score is the number of molecules used to build the model.

Value

When the file is found, loadBED12 always returns a data.table, so that it can safely be used in a accumulator loop. It will check if the file is empty, because in our current pipeline produces such files when a sample contains no properly paired reads. In that case, it will return an empty data.table. If the file is not found, it aborts with an error. The columns chrom and library are factors. The other columns are numeric or character according to their contents.

See Also

bedFieldNames, data.table

Examples

1
2
3
4
5
6
7
fileA <- system.file("extdata", "BED12_A.bed", package="smallCAGEqc")
fileB <- system.file("extdata", "BED12_B.bed", package="smallCAGEqc")
fileC <- system.file("extdata", "BED12_C.bed", package="smallCAGEqc")

loadBED12(fileA, "A")
loadBED12(c(fileA, fileB, fileC))
  

charles-plessy/smallCAGEqc documentation built on May 13, 2019, 3:31 p.m.