bioconductor v3.9.0 OligoClasses

This package contains class definitions, validity checks, and initialization methods for classes used by the oligo and crlmm packages.

Link to this section Summary

Functions

Class "AlleleSet"

Compute average log-intensities / log-ratios

Create a list of assay data elements

Methods for class AssayData in the oligoClasses package

List classes with assay data listed by chromosome

Class "BeadStudioSet"

Class "CNSet"

eSetList class

Class "CopyNumberSet"

Methods for class CopyNumberSet.

Class "DBPDInfo"

"FeatureSet" and "FeatureSet" Extensions

Methods for GRanges objects

Methods for Function GenomeAnnotatedDataFrameFrom in Package oligoClasses

Class "GenomeAnnotatedDataFrame"

Class "SnpSet2"

Accessors and methods for SnpSet objects

Class "SnpSuperSet"

Methods for RangedSummarizedExperiment objects

Available Affymetrix platforms for SNP arrays

Annotation Packages

Accessor for slot assayDataList in Package oligoClasses

The batch variable for the samples.

Accessor for batch statistics uses for copy number estimation and storage of model parameters

Cel file dates

Extracts complete cel file name from a CNSet object

Checks to see whether an object exists and, if not, executes the appropriate function.

Checks whether a eSet-derived class is ordered by chromosome and physical position

Converts chromosome to integer

Methods for function chromosome in package oligoClasses

Cluster and large dataset management utilities.

DEPRECATED FUNCTIONS. Cluster and large dataset management utilities.

Create ff objects.

ExpressionFeatureSet Object

SnpCnvQSet Example

SnpFeatureSet Example

SnpQSet Example

Get the connection to the SQLite Database

oligoClasses Deprecated

Accessor for the 'exprs' slot

Accessor for slot featureDataList in Package oligoClasses ~~

Class "ff_matrix"

Class "ff_or_matrix"

Class "ffdf"

Open and close methods for matrices and numeric vectors

Batch-level summary of SNP flags.

Virtual Class for Lists of eSets

Container for objects with genomic annotation on SNPs

Miscellaneous generics. Methods defined in packages that depend on oligoClasses

Genome Build Information

Array Geometry Information

Gets a bar of a given length.

Load chromosome sequence lengths for UCSC genome build hg18 or hg19

Functions to convert probabilities to integers, or integers to probabilities.

Coerce numeric matrix (or array) to a matrix (array) of integers, retaining dimnames.

Check if package is loaded.

Methods for Function isSnp in package oligoClasses~~

Check if object is an ff-matrix object.

Array type

Initialize big matrices/vectors.

Set/check large dataset options.

Number of samples for FeatureSet-like objects.

Supress package startup messages when loading a library

List CEL files.

Basic data elements required for the HMM

Construct a GRanges object from several possible feature-level classes

Manufacturer ID for FeatureSet-like objects.

lapply-like function that parallelizes code when possible.

An example instance of oligoSnpSet class

Methods for oligoSnpSet class

Checks if oligo/crlmm can use parallel resources.

Get packages from BioConductor.

Platform Information

Information on Fragment Length

Methods for function position in Package oligoClasses

Helper function to load packages.

DEPRECATED FUNCTIONS. Package loaders for clusters.

Sample names for FeatureSet-like objects

Tools to distribute objects across nodes or by length.

Link to this section Functions

Link to this function

AlleleSet_class()

Class "AlleleSet"

Description

A class for storing the locus-level summaries of the normalized intensities

Seealso

SnpSuperSet , CNSet

Author

R. Scharpf

Examples

showClass("AlleleSet")
## an empty AlleleSet
x <- new("matrix")
new("AlleleSet", senseAlleleA=x, senseAlleleB=x, antisenseAlleleA=x, antisenseAlleleB=x)
##or
new("AlleleSet", alleleA=x, alleleB=x)
Link to this function

AlleleSet_methods()

Compute average log-intensities / log-ratios

Description

Methods to compute average log-intensities and log-ratios across alleles, within strand.

Usage

getA(object)
getM(object)
A(object, ...)
B(object, ...)

Arguments

ArgumentDescription
objectSnpQSet , SnpCnvQSet or TilingFeatureSet2 object.
...arguments to be passed to allele - 'sense' and 'antisense' are valid values if the array is pre-SNP_5.0

Details

For SNP data, SNPRMA summarizes the SNP information into 4 quantities (log2-scale):

  • antisenseThetaA antisense allele A. (Not applicable for Affymetrix 5.0 and 6.0 platforms.)

  • antisenseThetaB antisense allele B. (Not applicable for Affymetrix 5.0 and 6.0 platforms.)

  • senseThetaA sense allele A. (Not applicable for Affymetrix 5.0 and 6.0 platforms.)

  • senseThataB sense allele B. (Not applicable for Affymetrix 5.0 and 6.0 platforms.)

  • alleleA Affymetrix 5.0 and 6.0 platforms

  • alleleB Affymetrix 5.0 and 6.0 platforms

The average log-intensities are given by: (antisenseThetaA+antisenseThetaB)/2 and (senseThetaA+senseThetaB)/2 .

The average log-ratios are given by: antisenseThetaA-antisenseThetaB and senseThetaA-senseThetaB .

For Tiling data, getM and getA return the log-ratio and average log-intensities computed across channels: M = log2(channel1)-log2(channel2) A = (log2(channel1)+log2(channel2))/2

When large data support is enabled with the ff package, the AssayData elements of an AlleleSet object can be ff_matrix or ffdf , in which case pointers to the ff object are stored in the assay data. The functions open and close can be used to open or close the connection, respectively.

Value

A 3-dimensional array (SNP's x Samples x Strand) with the requested measure, when the input SNP data (50K, 250K).

A 2-dimensional array (SNP's x Samples), when the input is from SNP 5.0 and SNP 6.0 arrays.

A 2-dimensional array if the input is from Tiling arrays.

Seealso

snprma

Link to this function

AssayDataList()

Create a list of assay data elements

Description

The eSetList-derived classes have an assayDataList slot instead of an assayData slot.

Usage

AssayDataList(storage.mode = c("lockedEnvironment", "environment", "list"), ...)

Arguments

ArgumentDescription
storage.modeSee assayDataNew .
list()Named lists of matrices

Value

environment

Seealso

assayDataNew

Author

R.Scharpf

Examples

r <- replicate(5, matrix(rnorm(25),5,5), simplify=FALSE)
r <- lapply(r, function(x,dns) {dimnames(x) <- dns; return(x)}, dns=list(letters[1:5], LETTERS[1:5]))
ad <- AssayDataList(r=r)
ls(ad)
Link to this function

AssayData_methods()

Methods for class AssayData in the oligoClasses package

Description

Batch statistics used for estimating copy number are stored as AssayData in the 'batchStatistics' slot of the CNSet class. Each element in the AssayData must have the same number of rows and columns. Rows correspond to features and columns correspond to batch.

Seealso

CNSet-class

Examples

library(crlmm)
library(Biobase)
data(cnSetExample, package="crlmm")
cnSet <- cnSetExample
isCurrent(cnSet)
assayDataElementNames(batchStatistics(cnSet))
## Accessors for linear model parameters
## -- Included here primarily as a check that accessors are working
## -- Values are all NA until CN estimation is performed using the crlmm package
##
## subsetting
cnSet[1:10, ]
## names of elements in the object
## accessors for parameters
nu(cnSet, "A")[1:10, ]
nu(cnSet, "B")[1:10, ]
phi(cnSet, "A")[1:10, ]
phi(cnSet, "B")[1:10, ]
Link to this function

BeadStudioSetList_class()

List classes with assay data listed by chromosome

Description

Container for log R ratios and B allele frequencies stored by chromosome.

Seealso

See supporting packages for methods defined for the class.

Author

R. Scharpf

Link to this function

BeadStudioSet_class()

Class "BeadStudioSet"

Description

A container for log R ratios and B allele frequencies from SNP arrays.

Author

R. Scharpf

Examples

new("BeadStudioSet")

Class "CNSet"

Description

CNSet is a container for intermediate data and parameters pertaining to allele-specific copy number estimation. Methods for CNSet objects, including accessors for linear model parameters and allele-specific copy number are included here.

Author

R. Scharpf

Examples

new("CNSet")
Link to this function

ClassesNotExported()

eSetList class

Description

Initialization method for eSetList virtual class.

Link to this function

CopyNumberSet_class()

Class "CopyNumberSet"

Description

Container for storing total copy number estimates and confidence scores of the copy number estimates.

Seealso

For genotyping platforms, total copy number estimates and genotype calls can be stored in the oligoSnpSet class.

Note

This container is primarily for platforms for which genotypes are unavailable. As oligoSnpSet extends this class, methods related to total copy number that do not depend on genotypes can be defined at this level.

Author

R. Scharpf

Examples

showClass("CopyNumberSet")
cnset <- new("CopyNumberSet")
ls(Biobase::assayData(cnset))
Link to this function

CopyNumberSet_methods()

Methods for class CopyNumberSet.

Description

Accessors and CopyNumberSet

Usage

copyNumber(object, ...)
cnConfidence(object)
copyNumber(object) <- value
cnConfidence(object) <- value

Arguments

ArgumentDescription
objectCopyNumberSet object or derived class
list()Ignored for CopyNumberSet and oligoSnpSet .
valuematrix

Value

copyNumber returns a matrix of copy number estimates or relative copy number estimates. Since the copy number estimates are stored as integers (copy number * 100), the matrix returned by the copyNumber accessor will need to be divided by a factor of 100 to transform the measurements back to the original copy number scale.

cnConfidence returns a matrix of confidence scores for the copy number estimates. These are also represented as integers and will require a back-transformation to the original scale.

Examples

library(Biobase)
data(locusLevelData)
path <- system.file("extdata", package="oligoClasses")
fd <- readRDS(file.path(path, "genomeAnnotatedDataFrameExample.rds"))
## the following command creates an 'oligoSnpSet' object, storing
## an integer representation of the log2 copy number in the 'copyNumber' element
## of the assayData.  Genotype calls and genotype confidence scores are also stored
## in the assayData.
oligoSet <- new("oligoSnpSet",
copyNumber=integerMatrix(log2(locusLevelData[["copynumber"]]/100), 100),
call=locusLevelData[["genotypes"]],
callProbability=integerMatrix(locusLevelData[["crlmmConfidence"]], 1),
annotation=locusLevelData[["platform"]],
featureData=fd,
genome="hg19")

## There are several accessors for the oligoSnpSet class.
icn <- copyNumber(oligoSet)
range(icn) ## integer scale
lcn <- icn/100
range(lcn) ## log2 copy number

## confidence scores for the genotypes are also represented on an integer scale
ipr <- snpCallProbability(oligoSet)
range(ipr) ## integer scale

## for genotype confidence scores, the helper function i2p
## converts back to a probability scale
pr <- i2p(ipr)
range(pr)

## The helper function confs is a shortcut, extracting the
## integer-based confidence scores and transforming to the
## probability scale
pr2 <- confs(oligoSet)
all.equal(pr, pr2)

## To extract information on the annotation of the SNPs, one can use
position(oligoSet)
chromosome(oligoSet)
## the position and chromosome coordinates were extracted from build hg19
genomeBuild(oligoSet)
Link to this function

DBPDInfo_class()

Class "DBPDInfo"

Description

A class for Platform Design Information objects, stored using a database approach

Link to this function

FeatureSetExtensions_class()

"FeatureSet" and "FeatureSet" Extensions

Description

Classes to store data from Expression/Exon/SNP/Tiling arrays at the feature level.

Seealso

eSet , VersionedBiobase , Versioned

Author

Benilton Carvalho

Examples

set.seed(1)
tmp <- 2^matrix(rnorm(100), ncol=4)
rownames(tmp) <- 1:25
colnames(tmp) <- paste("sample", 1:4, sep="")
efs <- new("ExpressionFeatureSet", exprs=tmp)
Link to this function

GRanges_methods()

Methods for GRanges objects

Description

Methods for GRanges objects

Seealso

GRanges

Examples

library(IRanges)
library(GenomicRanges)
gr1 <- GRanges(seqnames = "chr2", ranges = IRanges(3, 6),
state=3L, numberProbes=100L)
## convenience functions
state(gr1)
numberProbes(gr1)

gr2 <- GRanges(seqnames = c("chr1", "chr1"),
ranges = IRanges(c(7,13), width = 3),
state=c(2L, 2L), numberProbes=c(200L, 250L))
gr3 <- GRanges(seqnames = c("chr1", "chr2"),
ranges = IRanges(c(1, 4), c(3, 9)),
state=c(1L, 4L), numberProbes=c(300L, 350L))
## Ranges organized by sample
grl <- GRangesList("sample1" = gr1, "sample2" = gr2, "sample3" = gr3)
sampleNames(grl) ## same as names(grl)
numberProbes(grl)
chromosome(grl)
state(grl)
gr <- stack(grl)
sampleNames(gr)
chromosome(gr)
state(gr)
Link to this function

GenomeAnnotatedDataFrameFrom_methods()

Methods for Function GenomeAnnotatedDataFrameFrom in Package oligoClasses

Description

GenomeAnnotatedDataFrameFrom is a convenience for creating GenomeAnnotatedDataFrame objects.

Author

R Scharpf

Examples

require(Biobase)
minReqVersion <- "1.0.2"
require(human370v1cCrlmm)
if (packageDescription("human370v1cCrlmm", fields='Version') >= minReqVersion){
x <- matrix(1:25, 5, 5,
dimnames=list(c("rs10000092","rs1000055", "rs100016", "rs10003241", "rs10004197"), NULL))
gd <- GenomeAnnotatedDataFrameFrom(x, annotationPkg="human370v1cCrlmm",
genome="hg18")
pData(gd)
chromosome(gd)
position(gd)
}
Link to this function

GenomeAnnotatedDataFrame_class()

Class "GenomeAnnotatedDataFrame"

Description

AnnotatedDataFrame with genomic coordinates (chromosome, position)

Seealso

AnnotatedDataFrame

Author

R. Scharpf

Examples

new("GenomeAnnotatedDataFrame")
if(require("pd.mapping50k.hind240") && require("pd.mapping50k.xba240") && require("SNPchip")){
data(locusLevelData)
gd <- GenomeAnnotatedDataFrameFrom(locusLevelData[["genotypes"]],
annotationPkg=locusLevelData[["platform"]],
genome="hg19")
arm <- getArm(gd, "hg19")
}
Link to this function

SnpSet2_class()

Class "SnpSet2"

Description

A container for genotype calls and confidence scores. Similar to the SnpSet class in Biobase , but SnpSet2 extends gSet directly whereas SnpSet extends eSet . Useful properties of gSet include the genome slot and the GenomeAnnotatedDataFrame .

Seealso

SnpSet

Author

R. Scharpf

Examples

showClass("SnpSet2")
new("SnpSet2")
Link to this function

SnpSet_methods()

Accessors and methods for SnpSet objects

Description

Utility functions for accessing data in SnpSet objects.

Usage

calls(object)
calls(object) <- value
confs(object, transform=TRUE)
confs(object) <- value

Arguments

ArgumentDescription
objectA SnpSet object.
transformLogical. Whether to transform the integer representation of the confidence score (for memory efficiency) to a probability. See details.
valueA matrix.

Details

calls returns the genotype calls. CRLMM stores genotype calls as integers (1 - AA; 2 - AB; 3 - BB).

confs returns the confidences associated with the genotype calls. The current implementation of CRLMM stores the confidences as integers to save memory on disk by using the transformation:

round(-1000*log2(1-p)),

where 'p' is the posterior probability of the call. confs is a convenience function that transforms the integer representation back to a probability. Note that if the assayData elements of the SnpSet objects are ff_matrix or ffdf , the confs function will return a warning. For such objects, one should first subset the ff object and coerce to a matrix, then apply the above conversion. The function snpCallProbability for the callProbability slot of SnpSet objects. See the examples below.

checkOrder checks whether the object is ordered by chromosome and physical position, evaluating to TRUE or FALSE.

Seealso

The helper functions p2i converts probabilities to integers and i2p converts integers to probabilities.

See order and checkOrder .

Note

Note that the replacement method for confs<- expects a matrix of probabilities and will automatically convert the probabilities to an integer representation. See details for the conversion.

The accessor snpCallProbability is an accessor for the 'callProbability' element of the assayData . The name can be misleading, however, as the accessor will not return a probability if the call probabilities are represented as integers.

Examples

theCalls <- matrix(sample(1:3, 20, rep=TRUE), nc=2)
p <- matrix(runif(20), nc=2)
integerRepresentation <- matrix(as.integer(round(-1000*log(1-p))), 10, 2)
obj <- new("SnpSet2", call=theCalls, callProbability=integerRepresentation)
calls(obj)
confs(obj)  ## coerces to probability scale
int <- Biobase::snpCallProbability(obj) ## not necessarily a probability
p3 <- i2p(int)  ## to convert back to a probability
Link to this function

SnpSuperSet_class()

Class "SnpSuperSet"

Description

A class to store locus-level summaries of the quantile normalized intensities, genotype calls, and genotype confidence scores

Seealso

AlleleSet

Author

R. Scharpf

Examples

showClass("SnpSuperSet")
## empty object from the class
x <- new("matrix")
new("SnpSuperSet", alleleA=x, alleleB=x, call=x, callProbability=x)
Link to this function

SummarizedExperiment_methods()

Methods for RangedSummarizedExperiment objects

Description

Methods for RangedSummarizedExperiment .

Usage

list(list("baf"), list("RangedSummarizedExperiment"))(object)
list(list("chromosome"), list("RangedSummarizedExperiment"))(object,...)
list(list("isSnp"), list("RangedSummarizedExperiment"))(object, ...)
list(list("lrr"), list("RangedSummarizedExperiment"))(object)

Arguments

ArgumentDescription
objectA RangedSummarizedExperiment object.
...ignored

Details

baf and lrr are accessors for the B allele frequencies and log R ratio assays (matrices or arrays), respectively,

chromosome returns the seqnames of the rowRanges .

isSnp returns a logical vector for each marker in rowRanges indicating whether the marker targets a SNP (nonpolymorphic regions are FALSE).

Seealso

RangedSummarizedExperiment

Link to this function

affyPlatforms()

Available Affymetrix platforms for SNP arrays

Description

Provides a listing of available Affymetrix platforms currently supported by the R package oligo

Usage

affyPlatforms()

Value

A vector of class character.

Author

R. Scharpf

Examples

affyPlatforms()
Link to this function

annotationPackages()

Annotation Packages

Description

annotationPackages will return a character vector of the names of annotation packages.

Usage

annotationPackages()

Value

a character vector of the names of annotation packages

Link to this function

assayDataList_methods()

Accessor for slot assayDataList in Package oligoClasses

Description

Accessor for slot assayDataList in Package oligoClasses

The batch variable for the samples.

Description

Copy number estimates are susceptible to systematic differences between groups of samples that were processed at different times or by different labs. While 'batch' is often unknown, a useful surrogates is often the scan date of the arrays (e.g., the month of the calendar year) or the 96 well chemistry plate on which the samples were arrayed during lab processing.

Usage

batch(object)
batchNames(object)
batchNames(object) <- value

Arguments

ArgumentDescription
objectAn object of class CNSet .
valueFor 'batchNames', the value must be a character string corresponding of the unique batch names.

Value

The method 'batch' returns a character vector that has the same length as the number of samples in the CNSet object.

Seealso

CNSet-class

Author

R. Scharpf

Examples

a <- matrix(1:25, 5, 5)
colnames(a) <- letters[1:5]
object <- new("CNSet", alleleA=a, batch=rep("batch1", 5))
batch(object)
batchNames(object)
Link to this function

batchStatistics()

Accessor for batch statistics uses for copy number estimation and storage of model parameters

Description

The batchStatistics slot contains statistics estimated from each batch that are used to derive copy number estimates.

Usage

batchStatistics(object)
batchStatistics(object) <- value

Arguments

ArgumentDescription
objectAn object of class CNSet
valueAn object of class AssayData

Details

An object of class AssayData for slot batchStatistics is initialized automatically when creating a new CNSet instance. Required in the call to new is a factor called batch whose unique values determine the number of columns for each assay data element.

Value

batchStatics is an accessor for the slot batchStatistics that returns an object of class AssayData .

Seealso

CNSet-class , batchNames , batch

Cel file dates

Description

Parses cel file dates from the header of .CEL files for the Affymetrix platform

Usage

celfileDate(filename)

Arguments

ArgumentDescription
filenameName of cel file

Value

character string

Author

H. Jaffee

Examples

require(hapmapsnp6)
path <- system.file("celFiles", package="hapmapsnp6")
celfiles <- list.celfiles(path, full.names=TRUE)
dts <- sapply(celfiles, celfileDate)

Extracts complete cel file name from a CNSet object

Description

Returns the complete cel file (including path) for a CNSet object

Usage

celfileName(object)

Arguments

ArgumentDescription
objectAn object of class CNSet

Value

Character string vector.

Note

If the CEL files for an experiment are relocated, the datadir should be updated accordingly. See examples.

Author

R. Scharpf

Examples

if(require(crlmm)){
data(cnSetExample, package="crlmm")
celfileName(cnSetExample)
}

Checks to see whether an object exists and, if not, executes the appropriate function.

Description

Only loads an object if the object name is not in the global environment. If not in the global environment and the file exists, the object is loaded (by default). If the file does not exist, the function FUN is run.

Usage

checkExists(.name, .path = ".", .FUN, .FUN2, .save.it=TRUE, .load.it, ...)

Arguments

ArgumentDescription
.nameCharacter string giving name of object in global environment
.pathPath to where the object is saved.
.FUNFunction to be executed if is not in the global environment and the file does not exist.
.FUN2Not currently used.
.save.itLogical. Whether to save the object to the directory indicaged by path . This argument is ignored if the object was loaded from file or already exists in the .GlobalEnv.
.load.itLogical. If load.it is TRUE, we try to load the object from the indicated path . The returned object will replace the object in the .GlobalEnv unless the object is bound to a different name (symbol) when the function is executed.
list()Additional arguments passed to FUN.

Value

Could be anything -- depends on what FUN, FUN2 perform.

Future versions could return a 0 or 1 indicating whether the function performed as expected.

Author

R. Scharpf

Examples

path <- tempdir()
dir.create(path)
x <- 3+6
x <- checkExists("x", .path=path, .FUN=function(y, z) y+z, y=3, z=6)
rm(x)
x <- checkExists("x", .path=path, .FUN=function(y, z) y+z, y=3, z=6)
rm(x)
x <- checkExists("x", .path=path, .FUN=function(y, z) y+z, y=3, z=6)
rm(x)
##now there is a file called x.rda in tempdir().  The file will be loaded
x <- checkExists("x", .path=path, .FUN=function(y, z) y+z, y=3, z=6)
rm(x)
unlink(path, recursive=TRUE)

Checks whether a eSet-derived class is ordered by chromosome and physical position

Description

Checks whether a eSet -derived class (e.g., a SnpSet or CNSet object) is ordered by chromosome and physical position

Usage

checkOrder(object, verbose = FALSE)
chromosomePositionOrder(object, ...)

Arguments

ArgumentDescription
objectA SnpSet or CopyNumberSet .
verboseLogical.
list()additional arguments to order

Details

Checks whether the object is ordered by chromosome and physical position.

Value

Logical

Seealso

order

Author

R. Scharpf

Examples

data(oligoSetExample)
if(!checkOrder(oligoSet)){
oligoSet <- chromosomePositionOrder(oligoSet)
}
checkOrder(oligoSet)
Link to this function

chromosome2integer()

Converts chromosome to integer

Description

Coerces character string for chromosome in the pd. annotation packages to integers

Usage

chromosome2integer(chrom)
        integer2chromosome(intChrom)

Arguments

ArgumentDescription
chromA one or 2 letter character string (e.g, "1", "X", "Y", "MT", "XY")
intChromAn integer vector with values 1-25 possible

Details

This is useful when sorting SNPs in an object by chromosome and physical position -- ensures that the sorting is done in the same way for different objects.

Value

integer2chromosome returns a vector of character string indicating the chromosome the same length as intChrom . chromosome2integer returns a vector of integers the same length as the number of elements in the chrom vector.

Author

R. Scharpf

Examples

chromosome2integer(c(1:22, "X", "Y", "XY", "M"))
integer2chromosome(chromosome2integer(c(1:22, "X", "Y", "XY", "M")))
Link to this function

chromosome_methods()

Methods for function chromosome in package oligoClasses

Description

Methods for function chromosome in package oligoClasses ~~

Seealso

chromosome2integer

Note

Integer representation: chr X = 23, chr Y = 24, chr XY = 25. Symbols M, Mt, and MT are coded as 26.

Examples

chromosome2integer(c(1:22, "X", "Y", "XY", "M"))

Cluster and large dataset management utilities.

Description

Tools to simplify management of clusters via 'snow' package and large dataset handling through the 'bigmemory' package.

Usage

ocSamples(n)
ocProbesets(n)

Arguments

ArgumentDescription
ninteger representing the maximum number of samples/probesets to be processed simultaneously on a compute node.

Details

Some methods in the oligo/crlmm packages, like backgroundCorrect , normalize , summarize and rma can use a cluster (set through the 'foreach' package). The use of cluster features is conditioned on the availability of the 'ff' (used to provide shared objects across compute nodes) and 'foreach' packages.

To use a cluster, 'oligo/crlmm' checks for three requirements: 1) 'ff' is loaded; 2) an adaptor for the parallel backend (like 'doMPI', 'doSNOW', 'doMC') is loaded and registered.

If only the 'ff' package is available and loaded (in addition to the caller package - 'oligo' or 'crlmm'), these methods will allow the user to analyze datasets that would not fit in RAM at the expense of performance.

In the situations above (large datasets and cluster), oligo/crlmm uses the options ocSamples and ocProbesets to limit the amount of RAM used by the machine(s). For example, if ocSamples is set to 100, steps like background correction and normalization process (in RAM) 100 samples simultaneously on each compute node. If ocProbesets is set to 10K, then summarization processes 10K probesets at a time on each machine.

Author

Benilton Carvalho

Examples

if(require(doMC)) {
registerDoMC()
## tasks like summarize()
}
Link to this function

clusterOptsDeprecated()

DEPRECATED FUNCTIONS. Cluster and large dataset management utilities.

Description

Tools to simplify management of clusters via 'snow' package and large dataset handling through the 'bigmemory' package.

Usage

setCluster(...)
getCluster()
delCluster()

Arguments

ArgumentDescription
list()arguments to be passed to makeCluster in the 'snow' package.

Details

Some methods in the oligo/crlmm packages, like backgroundCorrect , normalize , summarize and rma can use a cluster (set through 'snow' package). The use of cluster features is conditioned on the availability of the 'bigmemory' (used to provide shared objects across compute nodes) and 'snow' packages.

To use a cluster, 'oligo/crlmm' checks for three requirements: 1) 'ff' is loaded; 2) 'snow' is loaded; and 3) the 'cluster' option is set (e.g., via options(cluster=makeCluster(...)) or setCluster(...)).

If only the 'ff' package is available and loaded (in addition to the caller package - 'oligo' or 'crlmm'), these methods will allow the user to analyze datasets that would not fit in RAM at the expense of performance.

In the situations above (large datasets and cluster), oligo/crlmm uses the options ocSamples and ocProbesets to limit the amount of RAM used by the machine(s). For example, if ocSamples is set to 100, steps like background correction and normalization process (in RAM) 100 samples simultaneously on each compute node. If ocProbesets is set to 10K, then summarization processes 10K probesets at a time on each machine.

Author

Benilton Carvalho

Create ff objects.

Description

Creates ff objects (array-like) using settings (path) defined by oligoClasses.

Usage

createFF(name, dim, vmode = "double", initdata = NULL)

Arguments

ArgumentDescription
namePrefix for filename.
dimDimensions.
vmodeMode.
initdataNULL.

Value

ff object.

Seealso

ff

Note

This function is meant to be used by developers.

Link to this function

data_efsExample()

ExpressionFeatureSet Object

Description

Example of ExpressionFeatureSet Object.

Format

Object belongs to ExpressionFeatureSet class.

Usage

data(efsExample)

Examples

data(efsExample)
class(efsExample)
Link to this function

data_scqsExample()

SnpCnvQSet Example

Description

Example of SnpCnvQSet object.

Format

Object belongs to SnpCnvQSet class.

Usage

data(scqsExample)

Examples

data(scqsExample)
class(scqsExample)
Link to this function

data_sfsExample()

SnpFeatureSet Example

Description

Example of SnpFeatureSet object.

Format

Object belongs to SnpFeatureSet class

Usage

data(sfsExample)

Examples

data(sfsExample)
class(sfsExample)
Link to this function

data_sqsExample()

SnpQSet Example

Description

Example of SnpQSet instance.

Format

Belongs to SnpQSet class.

Usage

data(sqsExample)

Examples

data(sqsExample)
class(sqsExample)

Get the connection to the SQLite Database

Description

This function will return the SQLite connection to the database associated to objects used in oligo.

Usage

db(object)

Arguments

ArgumentDescription
objectObject of valid class. See methods.

Value

SQLite connection.

Author

Benilton Carvalho

Examples

## db(object)

oligoClasses Deprecated

Description

The function, class, or data object you asked for has been deprecated.

Link to this function

exprs_methods()

Accessor for the 'exprs' slot

Description

Accessor for the 'exprs'/'se.exprs' slot of FeatureSet-like objects

Link to this function

featureDataList_methods()

Accessor for slot featureDataList in Package oligoClasses ~~

Description

Accessor for slot featureDataList in Package oligoClasses ~~

Class "ff_matrix"

Description

~~ A concise (1-5 lines) description of what the class is. ~~

Examples

showClass("ff_matrix")
Link to this function

ff_or_matrix_class()

Class "ff_or_matrix"

Description

A class union of 'ffdf', 'ff_matrix', and 'matrix'

Seealso

ff , ffdf

Author

R. Scharpf

Examples

showClass("ff_or_matrix")

Class "ffdf"

Description

Extended package ff's class definitions for ff to S4.

Link to this function

fileConnections()

Open and close methods for matrices and numeric vectors

Description

CNSet objects can contain ff -derived objects that contain pointers to files on disk, or ordinary matrices. Here we define open and close methods for ordinary matrices and vectors that that simply pass back the original matrix/vector.

Usage

open(con, ...)
openff(object)
closeff(object)

Arguments

ArgumentDescription
conmatrix or vector
objectA CNSet object.
list()Ignored

Value

not applicable

Author

R. Scharpf

Examples

open(rnorm(15))
open(matrix(rnorm(15), 5,3))

Batch-level summary of SNP flags.

Description

Used to flag SNPs with low minor allele frequencies, or for possible problems during the CN estimation step. Currently, this is primarily more for internal use.

Usage

flags(object)

Arguments

ArgumentDescription
objectAn object of class CNSet

Value

A matrix or ff_matrix object with rows corresponding to markers and columns corresponding to batch.

Seealso

batchStatistics

Examples

x <- matrix(runif(250*96*2, 0, 2), 250, 96*2)
test1 <- new("CNSet", alleleA=x, alleleB=x, call=x, callProbability=x,
batch=as.character(rep(letters[1:2], each=96)))
dim(flags(test1))
Link to this function

gSetList_class()

Virtual Class for Lists of eSets

Description

Virtual Class for Lists of eSets.

Seealso

oligoSetList , BeadStudioSetList

Author

R. Scharpf

Examples

showClass("gSetList")

Container for objects with genomic annotation on SNPs

Description

Container for objects with genomic annotation on SNPs

Seealso

chromosome , position , isSnp

Author

R. Scharpf

Examples

showClass("gSet")

Miscellaneous generics. Methods defined in packages that depend on oligoClasses

Description

Miscellaneous generics. Methods defined in packages that depend on oligoClasses

Usage

baf(object)
lrr(object)

Arguments

ArgumentDescription
objectA eSet -derived class.

Author

R. Scharpf

Genome Build Information

Description

Returns the genome build. This information comes from the annotation package and is given as an argument during the package creation process.

Usage

genomeBuild(object)

Arguments

ArgumentDescription
objectSupported objects include PDInfo , FeatureSet , and any gSet -derived or eSetList -derived object.

Value

character string

Note

Supported builds are UCSC genome builds are 'hg18' and 'hg19'.

Examples

showMethods("genomeBuild", where="package:oligoClasses")
Link to this function

geometry_methods()

Array Geometry Information

Description

For a given array, geometry returns the physical geometry of it.

Usage

geometry(object)

Arguments

ArgumentDescription
objectPDInfo or FeatureSet object

Examples

if (require(pd.mapping50k.xba240))
geometry(pd.mapping50k.xba240)

Gets a bar of a given length.

Description

Gets a bar of a given length.

Usage

getBar(width = getOption("width"))

Arguments

ArgumentDescription
widthdesired length of the bar.

Value

character string.

Author

Benilton S Carvalho

Examples

message(getBar())
Link to this function

getSequenceLengths()

Load chromosome sequence lengths for UCSC genome build hg18 or hg19

Description

Load chromosome sequence lengths for UCSC genome build hg18 or hg19

Usage

getSequenceLengths(build)
%setSequenceLengths(build, names)

Arguments

ArgumentDescription
buildcharacter string: "hg18" or "hg19"

Details

The chromosome sequence lengths for UCSC builds hg18 and hg19 were extracted from the packages BSgenome.Hsapiens.UCSC.hg18 and BSgenome.Hsapiens.UCSC.hg19, respectively.

Value

Names integer vector of chromosome lengths.

Author

R. Scharpf

Examples

getSequenceLengths("hg18")
getSequenceLengths("hg19")

if(require("GenomicRanges")){
## from GenomicRanges
sl <- getSequenceLengths("hg18")[c("chr1", "chr2", "chr3")]
gr <-
GRanges(seqnames =
Rle(c("chr1", "chr2", "chr1", "chr3"), c(1, 3, 2, 4)),
ranges =
IRanges(1:10, width = 10:1, names = head(letters,10)),
strand =
Rle(strand(c("-", "+", "*", "+", "-")),
c(1, 2, 2, 3, 2)),
score = 1:10,
GC = seq(1, 0, length=10),
seqlengths=sl)
metadata(gr) <- list(genome="hg18")
gr
metadata(gr)
}

Functions to convert probabilities to integers, or integers to probabilities.

Description

Probabilities estimated in the crlmm package are often stored as integers to save memory. We provide a few utility functions to go back and forth between the probability and integer representations.

Usage

i2p(i)
p2i(p)

Arguments

ArgumentDescription
iA matrix or vector of integers.
pA matrix or vector of probabilities.

Value

The value returned by i2p is

1 - exp(-i/1000)

The value returned by 2pi is

as.integer(-1000*log(1-p))

Seealso

confs

Examples

i2p(693)
p2i(0.5)
i2p(p2i(0.5))
Link to this function

integerMatrix()

Coerce numeric matrix (or array) to a matrix (array) of integers, retaining dimnames.

Description

Coerce numeric matrix to matrix of integers, retaining dimnames.

Usage

integerMatrix(x, scale = 100)
integerArray(x, scale=100)

Arguments

ArgumentDescription
xa matrix or array
scalescalar (numeric). If not 1, x is multiplied by scale prior to coercing to a matrix of integers.

Value

A matrix or array of integers.

Author

R. Scharpf

Examples

x <- matrix(rnorm(10), 5, 2)
rownames(x) = letters[1:5]
i <- integerMatrix(x, scale=100)
Link to this function

isPackageLoaded()

Check if package is loaded.

Description

Checks if package is loaded.

Usage

isPackageLoaded(pkg)

Arguments

ArgumentDescription
pkgPackage to be checked.

Details

Checks if package name is in the search path.

Value

Logical.

Seealso

search

Examples

isPackageLoaded("oligoClasses")
isPackageLoaded("ff")
isPackageLoaded("snow")
Link to this function

isSnp_methods()

Methods for Function isSnp in package oligoClasses~~

Description

~~ Methods for function isSnp in package oligoClasses ~~

Check if object is an ff-matrix object.

Description

Check if object is an ff-matrix object.

Usage

is.ffmatrix(object)

Arguments

ArgumentDescription
objectobject to be checked

Value

Logical.

Note

This function is meant to be used by developers.

Examples

if (isPackageLoaded("ff")){
x1 <- ff(vmode="double", dim=c(10, 2))
is.ffmatrix(x1)
}
x1 <- matrix(0, nr=10, nc=2)
is.ffmatrix(x1)

Array type

Description

Retrieves the array type.

Usage

kind(object)

Arguments

ArgumentDescription
objectFeatureSet or DBPDInfo object

Value

String: "Expression", "Exon", "SNP" or "Tiling"

Examples

if (require(pd.mapping50k.xba240)){
data(sfsExample)
Biobase::annotation(sfsExample) <- "pd.mapping50k.xba240"
kind(sfsExample)
}

Initialize big matrices/vectors.

Description

Initialize big matrices or vectors appropriately (conditioned on the status of support for large datasets - see Details).

Usage

initializeBigMatrix(name=basename(tempfile()), nr=0L, nc=0L, vmode = "integer", initdata = NA)
initializeBigVector(name=basename(tempfile()), n=0L, vmode = "integer",
  initdata = NA)
initializeBigArray(name=basename(tempfile()), dim=c(0L,0L,0L),
  vmode="integer", initdata=NA)

Arguments

ArgumentDescription
nameprefix to be used for file stored on disk
nrnumber of rows
ncnumber of columns
nlength of the vector
vmodemode - "integer", "double"
initdataDefault is NA
dimInteger vector indicating the dimensions of the array to initialize

Details

These functions are meant to be used by developers. They provide means to appropriately create big vectors or matrices for packages like oligo and crlmm (and friends). These objects are created conditioned on the status of support for large datasets.

Value

If the 'ff' package is loaded (in the search path), then an 'ff' object is returned. A regular R vector or array is returned otherwise.

Examples

x <- initializeBigVector("test", 10)
class(x)
x
if (isPackageLoaded("ff"))
finalizer(x) <- "delete"
rm(x)
initializeBigMatrix(nr=5L, nc=5L)
initializeBigArray(dim=c(10, 5, 3))

Set/check large dataset options.

Description

Set/check large dataset options.

Usage

ldSetOptions(nsamples=100, nprobesets=20000, path=getwd(), verbose=FALSE)
ldStatus(verbose=FALSE)
ldPath(path)

Arguments

ArgumentDescription
nsamplesnumber of samples to be processed at once.
nprobesetsnumber of probesets to be processed at once.
pathpath where to store large dataset objects.
verboseverbosity (logical).

Details

Some functions in oligo/crlmm can process data in batches to minimize memory footprint. When using this feature, the 'ff' package resources are used (and possibly combined with cluster resources set in options() via 'snow' package).

Methods that are executed on a sample-by-sample manner can use ocSamples() to automatically define how many samples are processed at once (on a compute node). Similarly, methods applied to probesets can use ocProbesets(). Users should set these options appropriately.

ldStatus checks the support for large datasets.

ldPath checks where ff files are stored.

Seealso

ocSamples, ocProbesets

Author

Benilton S Carvalho

Examples

ldStatus(TRUE)
Link to this function

length_methods()

Number of samples for FeatureSet-like objects.

Description

Number of samples for FeatureSet-like objects.

Supress package startup messages when loading a library

Description

Supress package startup messages when loading a library

Usage

library2(...)

Arguments

ArgumentDescription
list()arguments to library

Seealso

library

Author

R. Scharpf

Examples

library2("Biobase")

List CEL files.

Description

Function used to get a list of CEL files.

Usage

list.celfiles(..., listGzipped=FALSE)

Arguments

ArgumentDescription
list()Passed to list.files
listGzippedLogical. List .CEL.gz files?

Value

Character vector with filenames.

Seealso

list.files

Note

Quite often users want to use this function to pass filenames to other methods. In this situations, it is safer to use the argument 'full.names=TRUE'.

Examples

if (require(hapmapsnp5)){
path <- system.file("celFiles", package="hapmapsnp5")

## only the filenames
list.celfiles(path)

## the filenames with full path...
## very useful when genotyping samples not in the working directory
list.celfiles(path, full.names=TRUE)
}else{
## this won't return anything
## if in the working directory there isn't any CEL
list.celfiles(getwd())
}
Link to this function

locusLevelData()

Basic data elements required for the HMM

Description

This object is a list containing the basic data elements required for the HMM

Format

A list

Usage

data(locusLevelData)

Details

The basic assay data elements that can be used for fitting the HMM are:

  1. a mapping of platform identifiers to chromosome and physical position

  2. (optional) a matrix of copy number estimates

  3. (optional) a matrix of confidence scores for the copy number estimates (e.g., inverse standard deviations)

  4. (optional) a matrix of genotype calls

  5. (optional) CRLMM confidence scores for the genotype calls

At least (2) or (4) is required. The locusLevelData is a list that contains (1), (2), (4), and (5).

Examples

data(locusLevelData)
str(locusLevelData)
Link to this function

makeFeatureGRanges()

Construct a GRanges object from several possible feature-level classes

Description

Construct a GRanges object from several possible feature-level classes. The conversion is useful for subsequent ranged-data queries, such as findOverlaps , countOverlaps , etc.

Usage

makeFeatureGRanges(object, ...)

Arguments

ArgumentDescription
objectA gSet -derived object containing chromosome and physical position for the markers on the array.
list()See the makeFeatureGRanges method for GenomeAnnotatedDataFrame .

Value

A GRanges object.

Seealso

findOverlaps , GRanges , GenomeAnnotatedDataFrame

Author

R. Scharpf

Examples

library(oligoClasses)
library(GenomicRanges)
library(Biobase)
library(foreach)
registerDoSEQ()
data(oligoSetExample, package="oligoClasses")
oligoSet <- oligoSet[chromosome(oligoSet) == 1, ]
makeFeatureGRanges(oligoSet)
Link to this function

manufacturer_methods()

Manufacturer ID for FeatureSet-like objects.

Description

Manufacturer ID for FeatureSet-like and DBPDInfo-like objects.

lapply-like function that parallelizes code when possible.

Description

ocLapply is an lapply-like function that checks if ff/snow are loaded and if the cluster variable is set to execute FUN on a cluster. If these requirements are not available, then lapply is used.

Usage

ocLapply(X, FUN, ..., neededPkgs)

Arguments

ArgumentDescription
Xfirst argument to FUN.
FUNfunction to be executed.
list()additional arguments to FUN.
neededPkgspackages needed to execute FUN on the compute nodes.

Details

neededPkgs is needed when parallel computing is expected to be used. These packages are loaded on the compute nodes before the execution of FUN.

Value

A list of length length(X).

Seealso

lapply, parStatus

Author

Benilton S Carvalho

Link to this function

oligoSetExample()

An example instance of oligoSnpSet class

Description

An example instance of the oligoSnpSet class

Usage

data(oligoSetExample)

Seealso

locusLevelData

Examples

## 'oligoSetExample' created by the following
data(locusLevelData)
oligoSet <- new("oligoSnpSet",
copyNumber=integerMatrix(log2(locusLevelData[["copynumber"]]/100), 100),
call=locusLevelData[["genotypes"]],
callProbability=locusLevelData[["crlmmConfidence"]],
annotation=locusLevelData[["platform"]],
genome="hg19")
oligoSet <- oligoSet[!is.na(chromosome(oligoSet)), ]
oligoSet <- oligoSet[chromosome(oligoSet) < 3, ]
data(oligoSetExample)
oligoSet
Link to this function

oligoSnpSet_methods()

Methods for oligoSnpSet class

Description

Methods for oligoSnpSet class

Checks if oligo/crlmm can use parallel resources.

Description

Checks if oligo/crlmm can use parallel resources (needs ff and snow package, in addition to options(cluster=makeCluster(...)).

Usage

parStatus()

Value

logical

Author

Benilton S Carvalho

Link to this function

pdPkgFromBioC()

Get packages from BioConductor.

Description

This function checks if a given package is available on BioConductor and installs it, in case it is.

Usage

pdPkgFromBioC(pkgname, lib = .libPaths()[1], verbose = TRUE)

Arguments

ArgumentDescription
pkgnamecharacter. Name of the package to be installed.
libcharacter. Path where to install the package at.
verboselogical. Verbosity flag.

Details

Internet connection required.

Value

Logical: TRUE if package was found, downloaded and installed; FALSE otherwise.

Seealso

download.packages

Author

Benilton Carvalho

Examples

pdPkgFromBioC("pd.mapping50k.xba240")
Link to this function

platform_methods()

Platform Information

Description

Platform Information

Link to this function

pmFragmentLength_methods()

Information on Fragment Length

Description

This method will return the fragment length for PM probes.

Link to this function

position_methods()

Methods for function position in Package oligoClasses

Description

Methods for function position in package oligoClasses

Link to this function

requireAnnotation()

Helper function to load packages.

Description

This function checkes the existence of a given package and loads it if available. If the package is not available, the function checks its availability on BioConductor, downloads it and installs it.

Usage

requireAnnotation(pkgname, lib=.libPaths()[1], verbose = TRUE)

Arguments

ArgumentDescription
pkgnamecharacter. Package name (usually an annotation package).
libcharacter. Path where to install packages at.
verboselogical. Verbosity flag.

Value

Logical: TRUE if package is available or FALSE if package unavailable for download.

Seealso

install.packages

Author

Benilton Carvalho

Examples

requirePackage("pd.mapping50k.xba240")
Link to this function

requireClusterPkgSetDeprecated()

DEPRECATED FUNCTIONS. Package loaders for clusters.

Description

Package loaders for clusters.

Usage

requireClusterPkgSet(packages)
requireClusterPkg(pkg, character.only)

Arguments

ArgumentDescription
packagescharacter vector with the names of the packages to be loaded on the compute nodes.
pkgname of a package given as a name or literal character string
character.onlya logical indicating whether `pkg' can be assumed to be a character string

Details

requireClusterPkgSet applies require for a set of packages on the cluster nodes.

requireClusterPkg applies require for ONE package on the cluster nodes and accepts every argument taken by require .

Value

Logical.

Seealso

require

Author

Benilton S Carvalho

Link to this function

sampleNames_methods()

Sample names for FeatureSet-like objects

Description

Returns sample names for FeatureSet-like objects.

Tools to distribute objects across nodes or by length.

Description

Tools to distribute objects across nodes or by length.

Usage

splitIndicesByLength(x, lg, balance=FALSE)
splitIndicesByNode(x)

Arguments

ArgumentDescription
xobject to be split
lglength
balancelogical. Currently ignored

Details

splitIndicesByLength splits x in groups of length lg .

splitIndicesByNode splits x in N groups (where N is the number of compute nodes available).

Value

List.

Seealso

split

Author

Benilton S Carvalho

Examples

x <- 1:100
splitIndicesByLength(x, 8)
splitIndicesByLength(x, 8, balance=TRUE)
splitIndicesByNode(x)