checkCTSSs {CAGEfightR} | R Documentation

## Helper for checking files containing CTSSs

### Description

Checks whether a file (or GRanges/GPos) contains data formatted in the same manner as CAGE Transcription Start Sites (CTSSs): Each basepair of the genome is associated with a single integer count.

### Usage

    checkCTSSs(object)

    ## S4 method for signature 'ANY'
    checkCTSSs(object)

    ## S4 method for signature 'GRanges'
    checkCTSSs(object)

    ## S4 method for signature 'character'
    checkCTSSs(object)

    ## S4 method for signature 'GPos'
    checkCTSSs(object)

    ## S4 method for signature 'BigWigFile'
    checkCTSSs(object)

### Arguments

`object` | BigWigFile, character, GRanges or GPos: Path to the file storing CTSSs, or an already improted GRanges/GPos.

### Value

TRUE if CTSSs are correctly formatted, otherwise a (hopefully) informative error is thrown.

### Note

In the case that a character is supplied pointing to a file, checkCTSSs will not check any extensions, but simply try to read it using rtracklayer::import. This means that checkCTSSs can technically analyze BED-files, although CAGEfightR can only import CTSSs from BigWig or bedGraph files.

### Examples

    if (.Platform$OS.type != "windows") {
    # Load example data
    data('exampleDesign')
    bw_plus <- system.file('extdata',
                           exampleDesign$BigWigPlus,
                           package = 'CAGEfightR')
    bw_plus <- BigWigFileList(bw_plus)

    # Check raw file
    checkCTSSs(bw_plus[[1]])

    # Import first, then check
    gr  <- import(bw_plus[[1]])
    checkCTSSs(gr)
    }

[Package CAGEfightR version 1.7.5 Index]