as.helix: Coerce to a Helix Data Frame

Description Usage Arguments Details Value Author(s) Examples

View source: R/misc.R

Description

Functions to coerce a structure into a helix data frame, and to check whether a structure is a valid helix data frame. A helix data frame is a data frame, so any structure coercible into a data.frame can become a helix data frame.

Usage

1
2

Arguments

x

Structure to coerce. Should be a structure coercible into a standard R data.frame structure for as.helix. Should be a string for parseBracket. May be anything for is.helix.

length

The length of the RNA sequence containing the helices.

Details

as.helix takes in a data.frame and coerces it into a helix data frame acceptable by other R4RNA functions. This mainly involves setting specific column names and casting to specific types.

Value

is.helix returns a boolean.

as.helix returns helix data frame with valid input.

Author(s)

Daniel Lai

Examples

1
2
3
4
5
6
7
8
    # Not a valid helix data frame
    helix <- data.frame(c(1, 2, 3), seq(10, 20, length.out = 3), 5, runif(3))
    is.helix(helix)
    warnings()
    
    # Formatted into a helix data frame
    helix <- as.helix(helix)
    is.helix(helix)

Example output

Loading required package: Biostrings
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package:BiocGenericsThe following objects are masked frompackage:parallel:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked frompackage:stats:

    IQR, mad, sd, var, xtabs

The following objects are masked frompackage:base:

    anyDuplicated, append, as.data.frame, basename, cbind, colnames,
    dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
    grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
    rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which.max, which.min

Loading required package: S4Vectors
Loading required package: stats4

Attaching package:S4VectorsThe following object is masked frompackage:base:

    expand.grid

Loading required package: IRanges
Loading required package: XVector

Attaching package:BiostringsThe following object is masked frompackage:base:

    strsplit

[1] FALSE
Warning messages:
1: In is.helix(helix) : No length attribute
2: In is.helix(helix) : Columns of invalid class
3: In is.helix(helix) : Invalid column names
Warning messages:
1: In is.helix(helix) : No length attribute
2: In is.helix(helix) : Columns of invalid class
3: In is.helix(helix) : Invalid column names
[1] TRUE

R4RNA documentation built on Nov. 8, 2020, 5:15 p.m.