Last data update: 2014.03.03

R: construct an smlSet instance from existing resources
make_smlSetR Documentation

construct an smlSet instance from existing resources

Description

construct an smlSet instance from existing resources, either using ExpressionSet and SnpMatrix instances, or a suitably structured package

Usage

make_smlSet(es, sml, organism = "Homo sapiens", harmonizeSamples = FALSE)

getSS(packname, chrs, renameChrs, probesToKeep=NULL, exFilter=function(x)x,
   wrapperEndo=NULL, checkValid=TRUE)

Arguments

es

instance of ExpressionSet-class

sml

named list of SnpMatrix-class instances

organism

conventional token for species

harmonizeSamples

logical indicating whether steps should be taken to be sure that the components represent identical sets of samples. can be time consuming so defaults to FALSE, in which case the user must be sure that the genotype and expression components are compatible in terms of sample content

packname

string naming the installed package from which expression and genotype data will be acquired

chrs

character vector naming the prefixes of genotype files to be used in the resulting smlSet instance; see notes below

renameChrs

character vector of same length as chrs specifying one-to-one renaming operation for genotype components in smlSet

probesToKeep

character vector identifying probes to be retained in the constructed smlSet – to be deprecated in favor of exFilter

exFilter

function that should accept and return ExpressionSet, will be executed just after probesToKeep filter if present

wrapperEndo

function that accepts and returns an smlSet instance, allowing any sort of transformation of contents acquired with getSS, executed after all assembly and filtering completed.

checkValid

logical, if TRUE, function will fail if created smlSet instance does not pass validObject()

Details

Packages that work with getSS can be created out of existing smlSet instances using externalize.

Value

Instance of smlSet-class.

Author(s)

VJ Carey <stvjc@channing.harvard.edu>

Examples

if ("GGtools" %in% installed.packages()[,1]) {
 s20 = getSS("GGtools", "20", renameChrs="chr20")
 s20
 make_smlSet( as(s20, "ExpressionSet"), smList(s20) )
}

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(GGBase)
Loading required package: snpStats
Loading required package: survival
Loading required package: Matrix
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/GGBase/make_smlSet.Rd_%03d_medium.png", width=480, height=480)
> ### Name: make_smlSet
> ### Title: construct an smlSet instance from existing resources
> ### Aliases: make_smlSet getSS
> ### Keywords: models
> 
> ### ** Examples
> 
> if ("GGtools" %in% installed.packages()[,1]) {
+  s20 = getSS("GGtools", "20", renameChrs="chr20")
+  s20
+  make_smlSet( as(s20, "ExpressionSet"), smList(s20) )
+ }
SnpMatrix-based genotype set:
number of samples:  90 
number of chromosomes present:  1 
annotation: illuminaHumanv1.db 
Expression data dims: 47293 x 90 
Total number of SNP: 119921 
Phenodata: An object of class 'AnnotatedDataFrame'
  sampleNames: NA06985 NA06991 ... NA12892 (90 total)
  varLabels: famid persid ... male (7 total)
  varMetadata: labelDescription
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>