feat: Features Objects

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/feat.R

Description

Create a new features object

Usage

1
2
3
feat(seqname = "default", src = ".", feature = ".", start, end,
  score = NULL, strand = NULL, frame = NULL, attribute = NULL,
  pointer.only = FALSE)

Arguments

seqname

a character vector containing the name of the sequence. If the features correspond to regions of an alignment, then seqname should be the name of the sequence in the alignment that is used as the frame of reference in the features. To use the entire alignment as a frame of reference, set seqname to "MSA".

src

The source of the feature

feature

The feature type name

start

The start of the feature. Sequence numbering begins at 1.

end

The end of the feature. This is the last coordinate included in the feature.

score

The feature score, or NA if there is no score.

strand

A character string which is either "+", "-", or "." (if strand is not available or relevant).

frame

A 0, 1, or 2, which specifies whether the feature is in frame.

attribute

A feature attribute (character string).

pointer.only

Whether to store object as a pointer to an object in C, rather than as a data.frame in R.

Details

See http://www.sanger.ac.uk/resources/software/gff/spec.html for more detailed description of each parameter.

All arguments which are provided should be vectors of equal length.

If pointer.only==FALSE, the new object is a data frame, with columns mirroring the GFF Specification Otherwise, it is a list containing a single element, which is a pointer to an object stored in C.

Value

If pointer.only==FALSE, returns a data.frame whose format mirrors the GFF specification. Otherwise, returns a list with a single object, which is a external pointer to a C structure representing a features object.

Author(s)

Melissa J. Hubisz and Adam Siepel

See Also

read.feat

msa for more details on the pointer.only option.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
seq <- rep("hg18.chr6", 10)
src <- rep("fake_example", 10)
feature <- rep("CDS", 10)
start <- seq(1, 100, by=10)
end <- seq(10, 100, by=10)
f <- feat(seq, src, feature, start, end)
dim(f)
dim.feat(f)
f <- feat(seq, src, feature, start, end, pointer.only=TRUE)
dim.feat(f)

Example output

[1] 10  5
[1] 10  5
[1] 10  9

rphast documentation built on May 1, 2019, 9:26 p.m.