Learn R Programming

genoset (version 1.24.0)

initGenoSet: Create a GenoSet or derivative object

Description

This function is the preferred method for creating a new GenoSet object. Users are generally discouraged from calling "new" directly. The "..." argument is for any number of matrices of matching size that will become part of the assayData slot of the resulting object. This function passes control to the "genoSet" object which performs argument checking including dimname matching among relevant slots and sets everything to genome order. Genome order can be disrupted by "[" calls and will be checked by methods that require it.

Usage

initGenoSet(type, locData, pData = NULL, annotation = "", assayData = NULL, ...)

Arguments

type
character, the type of object (e.g. GenoSet, BAFSet, CNSet) to be created
locData
A GRanges specifying feature chromosome locations. rownames are required to match assayData.
pData
A data frame with rownames matching colnames of all assays
annotation
character, string to specify chip/platform type
assayData
assayData, usually an environment
...
More matrix or DataFrame objects to include in assayData

Value

A GenoSet object or derivative as specified by "type" arg

Examples

Run this code
save.image("genoset.image.rda")
  genoset.session.info = sessionInfo()
  save(genoset.session.info,file="genoset.session.info.rda")
  test.sample.names = LETTERS[11:13]
  probe.names = letters[1:10]
  gs = GenoSet(
     locData=GRanges(ranges=IRanges(start=1:10,width=1,names=probe.names),seqnames=c(rep("chr1",4),rep("chr3",2),rep("chrX",4))),
     cn=matrix(31:60,nrow=10,ncol=3,dimnames=list(probe.names,test.sample.names)),
     pData=data.frame(matrix(LETTERS[1:15],nrow=3,ncol=5,dimnames=list(test.sample.names,letters[1:5]))),
     annotation="SNP6" )

Run the code above in your browser using DataLab