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
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)
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
Argument | Description |
---|---|
object | SnpQSet , 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
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
Argument | Description |
---|---|
storage.mode | See assayDataNew . |
list() | Named lists of matrices |
Value
environment
Seealso
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)
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
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, ]
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
BeadStudioSet_class()
Class "BeadStudioSet"
Description
A container for log R ratios and B allele frequencies from SNP arrays.
Author
R. Scharpf
Examples
new("BeadStudioSet")
CNSet_class()
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")
ClassesNotExported()
eSetList class
Description
Initialization method for eSetList virtual class.
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))
CopyNumberSet_methods()
Methods for class CopyNumberSet.
Description
Accessors and CopyNumberSet
Usage
copyNumber(object, ...)
cnConfidence(object)
copyNumber(object) <- value
cnConfidence(object) <- value
Arguments
Argument | Description |
---|---|
object | CopyNumberSet object or derived class |
list() | Ignored for CopyNumberSet and oligoSnpSet . |
value | matrix |
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)
DBPDInfo_class()
Class "DBPDInfo"
Description
A class for Platform Design Information objects, stored using a database approach
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)
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)
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)
}
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")
}
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")
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
Argument | Description |
---|---|
object | A SnpSet object. |
transform | Logical. Whether to transform the integer representation of the confidence score (for memory efficiency) to a probability. See details. |
value | A 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
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)
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
Argument | Description |
---|---|
object | A 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
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()
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
assayDataList_methods()
Accessor for slot assayDataList in Package oligoClasses
Description
Accessor for slot assayDataList in Package oligoClasses
batch()
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
Argument | Description |
---|---|
object | An object of class CNSet . |
value | For '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
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)
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
Argument | Description |
---|---|
object | An object of class CNSet |
value | An 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
celfileDate()
Cel file dates
Description
Parses cel file dates from the header of .CEL files for the Affymetrix platform
Usage
celfileDate(filename)
Arguments
Argument | Description |
---|---|
filename | Name 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)
celfileName()
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
Argument | Description |
---|---|
object | An 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)
}
checkExists()
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
Argument | Description |
---|---|
.name | Character string giving name of object in global environment |
.path | Path to where the object is saved. |
.FUN | Function to be executed if |
.FUN2 | Not currently used. |
.save.it | Logical. 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.it | Logical. 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)
checkOrder()
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
Argument | Description |
---|---|
object | A SnpSet or CopyNumberSet . |
verbose | Logical. |
list() | additional arguments to order |
Details
Checks whether the object is ordered by chromosome and physical position.
Value
Logical
Seealso
Author
R. Scharpf
Examples
data(oligoSetExample)
if(!checkOrder(oligoSet)){
oligoSet <- chromosomePositionOrder(oligoSet)
}
checkOrder(oligoSet)
chromosome2integer()
Converts chromosome to integer
Description
Coerces character string for chromosome in the pd. annotation packages to integers
Usage
chromosome2integer(chrom)
integer2chromosome(intChrom)
Arguments
Argument | Description |
---|---|
chrom | A one or 2 letter character string (e.g, "1", "X", "Y", "MT", "XY") |
intChrom | An 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")))
chromosome_methods()
Methods for function chromosome in package oligoClasses
Description
Methods for function chromosome
in package oligoClasses ~~
Seealso
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"))
clusterOpts()
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
Argument | Description |
---|---|
n | integer 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()
}
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
Argument | Description |
---|---|
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
createFF()
Create ff objects.
Description
Creates ff objects (array-like) using settings (path) defined by oligoClasses.
Usage
createFF(name, dim, vmode = "double", initdata = NULL)
Arguments
Argument | Description |
---|---|
name | Prefix for filename. |
dim | Dimensions. |
vmode | Mode. |
initdata | NULL. |
Value
ff object.
Seealso
ff
Note
This function is meant to be used by developers.
data_efsExample()
ExpressionFeatureSet Object
Description
Example of ExpressionFeatureSet Object.
Format
Object belongs to ExpressionFeatureSet class.
Usage
data(efsExample)
Examples
data(efsExample)
class(efsExample)
data_scqsExample()
SnpCnvQSet Example
Description
Example of SnpCnvQSet object.
Format
Object belongs to SnpCnvQSet class.
Usage
data(scqsExample)
Examples
data(scqsExample)
class(scqsExample)
data_sfsExample()
SnpFeatureSet Example
Description
Example of SnpFeatureSet object.
Format
Object belongs to SnpFeatureSet class
Usage
data(sfsExample)
Examples
data(sfsExample)
class(sfsExample)
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
Argument | Description |
---|---|
object | Object of valid class. See methods. |
Value
SQLite connection.
Author
Benilton Carvalho
Examples
## db(object)
defunct()
oligoClasses Deprecated
Description
The function, class, or data object you asked for has been deprecated.
exprs_methods()
Accessor for the 'exprs' slot
Description
Accessor for the 'exprs'/'se.exprs' slot of FeatureSet-like objects
featureDataList_methods()
Accessor for slot featureDataList
in Package oligoClasses ~~
Description
Accessor for slot featureDataList
in Package oligoClasses ~~
ff_matrix()
Class "ff_matrix"
Description
~~ A concise (1-5 lines) description of what the class is. ~~
Examples
showClass("ff_matrix")
ff_or_matrix_class()
Class "ff_or_matrix"
Description
A class union of 'ffdf', 'ff_matrix', and 'matrix'
Seealso
Author
R. Scharpf
Examples
showClass("ff_or_matrix")
ffdf()
Class "ffdf"
Description
Extended package ff's class definitions for ff to S4.
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
Argument | Description |
---|---|
con | matrix or vector |
object | A CNSet object. |
list() | Ignored |
Value
not applicable
Author
R. Scharpf
Examples
open(rnorm(15))
open(matrix(rnorm(15), 5,3))
flags()
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
Argument | Description |
---|---|
object | An object of class CNSet |
Value
A matrix
or ff_matrix
object with rows
corresponding to markers and columns corresponding to batch.
Seealso
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))
gSetList_class()
Virtual Class for Lists of eSets
Description
Virtual Class for Lists of eSets.
Seealso
oligoSetList , BeadStudioSetList
Author
R. Scharpf
Examples
showClass("gSetList")
gSet_class()
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")
generics()
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
Argument | Description |
---|---|
object | A eSet -derived class. |
Author
R. Scharpf
genomeBuild()
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
Argument | Description |
---|---|
object | Supported 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")
geometry_methods()
Array Geometry Information
Description
For a given array, geometry
returns the physical geometry of it.
Usage
geometry(object)
Arguments
Argument | Description |
---|---|
object | PDInfo or FeatureSet object |
Examples
if (require(pd.mapping50k.xba240))
geometry(pd.mapping50k.xba240)
getBar()
Gets a bar of a given length.
Description
Gets a bar of a given length.
Usage
getBar(width = getOption("width"))
Arguments
Argument | Description |
---|---|
width | desired length of the bar. |
Value
character string.
Author
Benilton S Carvalho
Examples
message(getBar())
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
Argument | Description |
---|---|
build | character 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)
}
i2p_p2i()
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
Argument | Description |
---|---|
i | A matrix or vector of integers. |
p | A 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
Examples
i2p(693)
p2i(0.5)
i2p(p2i(0.5))
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
Argument | Description |
---|---|
x | a matrix or array |
scale | scalar (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)
isPackageLoaded()
Check if package is loaded.
Description
Checks if package is loaded.
Usage
isPackageLoaded(pkg)
Arguments
Argument | Description |
---|---|
pkg | Package to be checked. |
Details
Checks if package name is in the search path.
Value
Logical.
Seealso
search
Examples
isPackageLoaded("oligoClasses")
isPackageLoaded("ff")
isPackageLoaded("snow")
isSnp_methods()
Methods for Function isSnp in package oligoClasses~~
Description
~~ Methods for function isSnp
in package oligoClasses ~~
isffmatrix()
Check if object is an ff-matrix object.
Description
Check if object is an ff-matrix object.
Usage
is.ffmatrix(object)
Arguments
Argument | Description |
---|---|
object | object 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)
kind()
Array type
Description
Retrieves the array type.
Usage
kind(object)
Arguments
Argument | Description |
---|---|
object | FeatureSet 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)
}
largeObjects()
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
Argument | Description |
---|---|
name | prefix to be used for file stored on disk |
nr | number of rows |
nc | number of columns |
n | length of the vector |
vmode | mode - "integer", "double" |
initdata | Default is NA |
dim | Integer 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))
ldOpts()
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
Argument | Description |
---|---|
nsamples | number of samples to be processed at once. |
nprobesets | number of probesets to be processed at once. |
path | path where to store large dataset objects. |
verbose | verbosity (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)
length_methods()
Number of samples for FeatureSet-like objects.
Description
Number of samples for FeatureSet-like objects.
library2()
Supress package startup messages when loading a library
Description
Supress package startup messages when loading a library
Usage
library2(...)
Arguments
Argument | Description |
---|---|
list() | arguments to library |
Seealso
Author
R. Scharpf
Examples
library2("Biobase")
listcelfiles()
List CEL files.
Description
Function used to get a list of CEL files.
Usage
list.celfiles(..., listGzipped=FALSE)
Arguments
Argument | Description |
---|---|
list() | Passed to list.files |
listGzipped | Logical. List .CEL.gz files? |
Value
Character vector with filenames.
Seealso
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())
}
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:
a mapping of platform identifiers to chromosome and physical position
(optional) a matrix of copy number estimates
(optional) a matrix of confidence scores for the copy number estimates (e.g., inverse standard deviations)
(optional) a matrix of genotype calls
(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)
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
Argument | Description |
---|---|
object | A 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)
manufacturer_methods()
Manufacturer ID for FeatureSet-like objects.
Description
Manufacturer ID for FeatureSet-like and DBPDInfo-like objects.
ocLapply()
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
Argument | Description |
---|---|
X | first argument to FUN. |
FUN | function to be executed. |
list() | additional arguments to FUN. |
neededPkgs | packages 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
oligoSetExample()
An example instance of oligoSnpSet class
Description
An example instance of the oligoSnpSet
class
Usage
data(oligoSetExample)
Seealso
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
oligoSnpSet_methods()
Methods for oligoSnpSet class
Description
Methods for oligoSnpSet class
parStatus()
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
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
Argument | Description |
---|---|
pkgname | character. Name of the package to be installed. |
lib | character. Path where to install the package at. |
verbose | logical. 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")
platform_methods()
Platform Information
Description
Platform Information
pmFragmentLength_methods()
Information on Fragment Length
Description
This method will return the fragment length for PM probes.
position_methods()
Methods for function position in Package oligoClasses
Description
Methods for function position
in package oligoClasses
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
Argument | Description |
---|---|
pkgname | character. Package name (usually an annotation package). |
lib | character. Path where to install packages at. |
verbose | logical. 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")
requireClusterPkgSetDeprecated()
DEPRECATED FUNCTIONS. Package loaders for clusters.
Description
Package loaders for clusters.
Usage
requireClusterPkgSet(packages)
requireClusterPkg(pkg, character.only)
Arguments
Argument | Description |
---|---|
packages | character vector with the names of the packages to be loaded on the compute nodes. |
pkg | name of a package given as a name or literal character string |
character.only | a 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
sampleNames_methods()
Sample names for FeatureSet-like objects
Description
Returns sample names for FeatureSet-like objects.
splitVec()
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
Argument | Description |
---|---|
x | object to be split |
lg | length |
balance | logical. 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)