Learn R Programming

genoset (version 1.28.2)

GenoSet: Create a GenoSet object

Description

This function is the preferred method for creating a new GenoSet object. Currently, a GenoSet is simply a RangedSummarizedExperiment with some API changes and extra methods. Therefore, a GenoSet must always have a rowRanges.

Usage

GenoSet(rowRanges, assays, colData, metadata = list())

## S3 method for class 'GenoSet': lengths(x)

locData(object, ...) <- value

locData(object)

Arguments

rowRanges
GenomicRanges, not a GenomicRangesList
assays
list, SimpleList or matrix-like object
colData
a data.frame or DataFrame of sample metadata with rownames matching the colnames of the matrices in assays
metadata
a list of any other data you want to attach to the GenoSet object
x
A GenoSet

Value

  • A GenoSet object

Details

locations. Rownames are required to match featureNames.

Examples

Run this code
test.sample.names = LETTERS[11:13]
probe.names = letters[1:10]
assays=list(matrix(31:60,nrow=10,ncol=3,dimnames=list(probe.names,test.sample.names)))
rowRanges=GRanges(ranges=IRanges(start=1:10,width=1,names=probe.names),seqnames=c(rep("chr1",4),rep("chr3",2),rep("chrX",4)))
colData=data.frame(matrix(LETTERS[1:15],nrow=3,ncol=5,dimnames=list(test.sample.names,letters[1:5])))
rse=SummarizedExperiment(rowRanges=rowRanges,assays=assays,colData=colData,metadata=metadata)
gs = GenoSet(rowRanges, assays, colData)

Run the code above in your browser using DataLab