Title: | A Package for De Novo CNV Detection in Case-Parent Trios |
---|---|
Description: | Analysis of de novo copy number variants in trios from high-dimensional genotyping platforms. |
Authors: | Robert B Scharpf and Ingo Ruczinski |
Maintainer: | Robert Scharpf <[email protected]> |
License: | Artistic-2.0 |
Version: | 1.51.0 |
Built: | 2024-12-14 03:54:18 UTC |
Source: | https://github.com/bioc/MinimumDistance |
By default, this function returns the lag-10 autocorrelations of a numeric vector and omits missing values.
acf2( x, lag.max = 10, type = c("correlation", "covariance", "partial"), plot = FALSE, na.action = na.omit, demean = TRUE, ... )
acf2( x, lag.max = 10, type = c("correlation", "covariance", "partial"), plot = FALSE, na.action = na.omit, demean = TRUE, ... )
x |
a numeric vector |
lag.max |
see |
type |
see |
plot |
logical, as in |
na.action |
ignored. Missing values are automattically omitted. |
demean |
logical, as in |
... |
additional arguments passed to |
x <- rnorm(100) x[5] <- NA acf2(x)
x <- rnorm(100) x[5] <- NA acf2(x)
The 'minimum distance' is the minimum signed absolute difference of the parental log R ratios and the offspring log R ratios. Specifically, let |O-F| denote the absolute difference in the log R ratios comparing offspring to father and |O-M| the absolute difference in the log R ratios comparing offspring to mother. The minimum distance at a marker is the signed minimum of |O-M| and |O-F|. After segmentation of the minimum distance, non-zero segments can indicate a de novo difference in the log R ratio of the offspring and either parent. For example, a positive minimum distance suggests that the log R ratio from the offspring is greater than the log R ratio of either parent.
calculateMindist(object, ...) ## S4 method for signature 'TrioSet' calculateMindist(object, verbose = TRUE, ...) ## S4 method for signature 'TrioSetList' calculateMindist(object) ## S4 method for signature 'list' calculateMindist(object, outdir = ldPath(), ...) ## S4 method for signature 'arrayORff_array' calculateMindist(object, outdir, center, ...) ## S4 method for signature 'matrix' calculateMindist(object, ...)
calculateMindist(object, ...) ## S4 method for signature 'TrioSet' calculateMindist(object, verbose = TRUE, ...) ## S4 method for signature 'TrioSetList' calculateMindist(object) ## S4 method for signature 'list' calculateMindist(object, outdir = ldPath(), ...) ## S4 method for signature 'arrayORff_array' calculateMindist(object, outdir, center, ...) ## S4 method for signature 'matrix' calculateMindist(object, ...)
object |
see |
... |
Ignored |
verbose |
logical. Whether to display messages indicating progress. |
outdir |
character string indicating path to save output |
center |
ignored |
Coercion methods in MinimumDistance package
Coerces a TrioSetList to a TrioSet
as(from, to) ## S4 method for signature 'TrioSetList' stack(x, ...)
as(from, to) ## S4 method for signature 'TrioSetList' stack(x, ...)
x |
a |
... |
ignored |
from |
see |
to |
see |
a TrioSet
This function filters the genomic intervals for denovo events.
denovoHemizygous(object, filters = FilterParamMD(state = "221")) denovoHomozygous(object, filters = FilterParamMD(state = "220")) denovo(object, filters = FilterParamMD(state = c("220", "221", "224"))) denovoDuplication(object, filters = FilterParamMD(state = "224")) ## S4 method for signature 'MinDistPosterior' denovoHemizygous(object, filters = FilterParamMD(state = "221")) ## S4 method for signature 'MinDistPosterior' denovoHomozygous(object, filters = FilterParamMD(state = "220")) ## S4 method for signature 'MinDistPosterior' denovoDuplication(object, filters = FilterParamMD(state = "224")) ## S4 method for signature 'MinDistPosterior' denovo(object, filters = FilterParamMD(state = c("220", "221", "224")))
denovoHemizygous(object, filters = FilterParamMD(state = "221")) denovoHomozygous(object, filters = FilterParamMD(state = "220")) denovo(object, filters = FilterParamMD(state = c("220", "221", "224"))) denovoDuplication(object, filters = FilterParamMD(state = "224")) ## S4 method for signature 'MinDistPosterior' denovoHemizygous(object, filters = FilterParamMD(state = "221")) ## S4 method for signature 'MinDistPosterior' denovoHomozygous(object, filters = FilterParamMD(state = "220")) ## S4 method for signature 'MinDistPosterior' denovoDuplication(object, filters = FilterParamMD(state = "224")) ## S4 method for signature 'MinDistPosterior' denovo(object, filters = FilterParamMD(state = c("220", "221", "224")))
object |
see |
filters |
an object of class |
The function denovo
filters genomic intervals for states
'220', '221', and '224', corresponding to denovo homozygous
deletion, denovo hemizygous deletion, and denovo duplication,
respectively.
denovoHemizygous
filters genomic intervals for state '221'.
denovoHomozygous
filters genomic intervals for state '220'
FilterParamMD-class
Creates an instance of a parameter class for circular binary
segmentation of the minimum distance and the log R ratios.
Parameters in this object are passed to the segment
function
in the package DNAcopy.
DNAcopyParam( alpha = 0.01, min.width = 2L, undo.splits = c("none", "prune", "sdundo"), undo.SD = 3 )
DNAcopyParam( alpha = 0.01, min.width = 2L, undo.splits = c("none", "prune", "sdundo"), undo.SD = 3 )
alpha |
see |
min.width |
see |
undo.splits |
see |
undo.SD |
see |
segment_params <- DNAcopyParam(alpha=0.01) params <- MinDistParam(dnacopy=segment_params)
segment_params <- DNAcopyParam(alpha=0.01) params <- MinDistParam(dnacopy=segment_params)
TrioSetList
objectA dataset containing log R ratios and B allele frequencies for two
chromosomes, organized as a TrioSetList
. Each element in
the list class is a TrioSet
object. Both TrioSetList
and TrioSet
classes are deprecated; the example data will be
removed in a future release.
a TrioSetList
Filter a MinDistExperiment object to exclude markers with missing
values in the low-level summaries, exclude markers that lie in
segments (granges
argument) with small minimum distance
values (unlikely to be de novo)
filterExperiment(object, granges, param) ## S4 method for signature 'MinDistExperiment,GRanges' filterExperiment(object, granges, param) ## S4 method for signature 'MinDistExperiment,GRangesList' filterExperiment(object, granges, param) ## S4 method for signature 'MinDistExperiment,MinDistGRanges' filterExperiment(object, granges, param)
filterExperiment(object, granges, param) ## S4 method for signature 'MinDistExperiment,GRanges' filterExperiment(object, granges, param) ## S4 method for signature 'MinDistExperiment,GRangesList' filterExperiment(object, granges, param) ## S4 method for signature 'MinDistExperiment,MinDistGRanges' filterExperiment(object, granges, param)
object |
A |
granges |
A |
param |
a |
a MinDistExperiment
A container for criteria used to filter the segmentation results post-hoc. Options including filtering on the posterior call, the posterior probability of the posterior call, the minimum number of markers spanned by the segment, the minimum width of the segment, and chromosome. Convenience functions are available for commonly used filters.
FilterParamMD(state = trioStateNames(), seqnames = paste0("chr", 1:22), ...)
FilterParamMD(state = trioStateNames(), seqnames = paste0("chr", 1:22), ...)
state |
trio copy number states to select |
seqnames |
chromosome names to select |
... |
additional arguments passed to |
library(VanillaICE) data(md_gr) data(md_exp) mdparam <- MinDistParam() fit <- MAP2(md_exp, md_gr, mdparam) ## return all segments segs(fit) ## Default filters param <- FilterParamMD() param cnvFilter(fit, param) param2 <- FilterParamMD(seqnames="chr22", probability=0.9, numberFeatures=10) cnvFilter(fit, param2) denovoHemizygous(fit)
library(VanillaICE) data(md_gr) data(md_exp) mdparam <- MinDistParam() fit <- MAP2(md_exp, md_gr, mdparam) ## return all segments segs(fit) ## Default filters param <- FilterParamMD() param cnvFilter(fit, param) param2 <- FilterParamMD(seqnames="chr22", probability=0.9, numberFeatures=10) cnvFilter(fit, param2) denovoHemizygous(fit)
Options for filtering include the number of markers spanned by a segment, the posterior probability of the maximum a posteriori estimate of the trio copy number state, and the trio copy number state.
## S4 method for signature 'FilterParamMD' show(object)
## S4 method for signature 'FilterParamMD' show(object)
object |
a |
denovo
Deprecated wrapper for computing the median absolute deviation of low-level summaries
mad2(object, byrow = FALSE, ...) ## S4 method for signature 'list' mad2(object, byrow, pedigree, ...) ## S4 method for signature 'TrioSetList' mad2(object, byrow = FALSE, ...) ## S4 method for signature 'matrix' mad2(object, byrow, pedigree, ...) ## S4 method for signature 'array' mad2(object, byrow, pedigree, ...)
mad2(object, byrow = FALSE, ...) ## S4 method for signature 'list' mad2(object, byrow, pedigree, ...) ## S4 method for signature 'TrioSetList' mad2(object, byrow = FALSE, ...) ## S4 method for signature 'matrix' mad2(object, byrow, pedigree, ...) ## S4 method for signature 'array' mad2(object, byrow, pedigree, ...)
object |
see |
byrow |
logical if TRUE, compute the median absolute deviation of the rows of a matrix |
... |
additional arguments to |
pedigree |
an object of class |
This functions is deprecated and will be defunct in a future release. The replacement function is MAP2.
MAP( object, ranges, id, TAUP = 1e+10, tauMAX = 1 - 5e-08, cnStates = c(-2, -0.4, 0, 0, 0.4, 1), pr.nonmendelian = 1.5e-06, mdThr = 0.9, ... )
MAP( object, ranges, id, TAUP = 1e+10, tauMAX = 1 - 5e-08, cnStates = c(-2, -0.4, 0, 0, 0.4, 1), pr.nonmendelian = 1.5e-06, mdThr = 0.9, ... )
object |
see |
ranges |
A |
id |
character string for sample identifier |
TAUP |
scalar for transition probabilities |
tauMAX |
the maximum probability that the current state is the same as the previous state |
cnStates |
character vector for hidden Markov model state labels |
pr.nonmendelian |
numeric: the a priori probability of a non-Mendelian copy number alteration |
mdThr |
a length-one numeric vector. A minimum distance below this threshold in absolute value will not be evaluated for copy number alterations. |
... |
Ignored. |
Computes maximum a posteriori estimate for the trio copy number state
MAP2(object, mdgr, param = MinDistParam(), ...) ## S4 method for signature 'MinDistExperiment,MinDistGRanges' MAP2(object, mdgr, param = MinDistParam(), ...) ## S4 method for signature 'MinDistExperiment,GRangesList' MAP2(object, mdgr, param = MinDistParam(), ...) ## S4 method for signature 'MinDistExperiment,GRanges' MAP2(object, mdgr, param = MinDistParam(), ...)
MAP2(object, mdgr, param = MinDistParam(), ...) ## S4 method for signature 'MinDistExperiment,MinDistGRanges' MAP2(object, mdgr, param = MinDistParam(), ...) ## S4 method for signature 'MinDistExperiment,GRangesList' MAP2(object, mdgr, param = MinDistParam(), ...) ## S4 method for signature 'MinDistExperiment,GRanges' MAP2(object, mdgr, param = MinDistParam(), ...)
object |
An object of class |
mdgr |
An object of class |
param |
An object of class |
... |
ignored |
An object of class MinDistPosterior
library(oligoClasses) library(VanillaICE) ## A MinDistExperiment object: data(md_exp) ## Segmented data data(md_gr) e_param <- EmissionParam(temper=1, p_outlier=1/100) param <- MinDistParam(thin=1L, emission=e_param) ## Not run: md_g <- MAP2(md_exp, md_gr, param) ## End(Not run)
library(oligoClasses) library(VanillaICE) ## A MinDistExperiment object: data(md_exp) ## Segmented data data(md_gr) e_param <- EmissionParam(temper=1, p_outlier=1/100) param <- MinDistParam(thin=1L, emission=e_param) ## Not run: md_g <- MAP2(md_exp, md_gr, param) ## End(Not run)
MinDistExperiment
This dataset contains log R ratios and B allele frequencies from a
parent-offspring trio (three individuals). Only markers from
chromosomes 7 and 22 are included in this object. The
MinDistExperiment
class extends RangedSummarizedExperiment
,
and so many of the methods defined for RangedSummarizedExperiment
such as findOverlaps
are available through inheritance.
a MinDistExperiment
## Not run: library(oligoClasses) library(VanillaICE) library(data.table) library(BSgenome.Hsapiens.UCSC.hg18) extdir <- system.file("extdata", package="VanillaICE") features <- suppressWarnings(fread(file.path(extdir, "SNP_info.csv"))) fgr <- GRanges(paste0("chr", features$Chr), IRanges(features$Position, width=1), isSnp=features[["Intensity Only"]]==0) fgr <- SnpGRanges(fgr) names(fgr) <- features[["Name"]] sl <- seqlevels(BSgenome.Hsapiens.UCSC.hg18) seqlevels(fgr) <- sl[sl %in% seqlevels(fgr)] seqinfo(fgr) <- seqinfo(BSgenome.Hsapiens.UCSC.hg18)[seqlevels(fgr),] fgr <- sort(fgr) files <- list.files(extdir, full.names=TRUE, recursive=TRUE, pattern="FinalReport") ## parse files parsedDir <- "ParsedFiles" if(!file.exists(parsedDir)) dir.create(parsedDir) views <- ArrayViews(rowRanges=fgr, sourcePaths=files, parsedPath=parsedDir) dat <- fread(files[1]) select_columns <- match(c("SNP Name", "Allele1 - AB", "Allele2 - AB", "Log R Ratio", "B Allele Freq"), names(dat)) index_genome <- match(names(fgr), dat[["SNP Name"]]) scan_params <- CopyNumScanParams(index_genome=index_genome, select=select_columns, cnvar="Log R Ratio", bafvar="B Allele Freq", gtvar=c("Allele1 - AB", "Allele2 - AB")) invisible(sapply(views, parseSourceFile, param=scan_params)) ped_hapmap <- ParentOffspring(id = "hapmap", father="12287_03", mother="12287_02", offspring="12287_01", parsedPath=parsedPath(views)) ped_list <- ParentOffspringList(pedigrees=list( ParentOffspring(id = "hapmap", father="12287_03", mother="12287_02", offspring="12287_01", parsedPath=parsedPath(views)), ParentOffspring(id = "cleft", father="22169_03", mother="22169_02", offspring="22169_01", parsedPath=parsedPath(views)))) sample_info <- read.csv(file.path(extdir, "sample_data.csv"), stringsAsFactors=FALSE) ind_id <- setNames(gsub(" ", "", sample_info$IndividualID), sample_info$File) colnames(views) <- ind_id[gsub(".csv", "", colnames(views))] md_exp <- MinDistExperiment(views, pedigree=ped_list[[2]]) seqlevels(md_exp, pruning.mode="coarse") <- "chr22" params <- MinDistParam() md_gr <- segment2(md_exp, params) save(md_exp, file="~/Software/bridge/MinimumDistance/data/md_exp.rda") save(md_gr, file="~/Software/bridge/MinimumDistance/data/md_gr.rda") ## End(Not run)
## Not run: library(oligoClasses) library(VanillaICE) library(data.table) library(BSgenome.Hsapiens.UCSC.hg18) extdir <- system.file("extdata", package="VanillaICE") features <- suppressWarnings(fread(file.path(extdir, "SNP_info.csv"))) fgr <- GRanges(paste0("chr", features$Chr), IRanges(features$Position, width=1), isSnp=features[["Intensity Only"]]==0) fgr <- SnpGRanges(fgr) names(fgr) <- features[["Name"]] sl <- seqlevels(BSgenome.Hsapiens.UCSC.hg18) seqlevels(fgr) <- sl[sl %in% seqlevels(fgr)] seqinfo(fgr) <- seqinfo(BSgenome.Hsapiens.UCSC.hg18)[seqlevels(fgr),] fgr <- sort(fgr) files <- list.files(extdir, full.names=TRUE, recursive=TRUE, pattern="FinalReport") ## parse files parsedDir <- "ParsedFiles" if(!file.exists(parsedDir)) dir.create(parsedDir) views <- ArrayViews(rowRanges=fgr, sourcePaths=files, parsedPath=parsedDir) dat <- fread(files[1]) select_columns <- match(c("SNP Name", "Allele1 - AB", "Allele2 - AB", "Log R Ratio", "B Allele Freq"), names(dat)) index_genome <- match(names(fgr), dat[["SNP Name"]]) scan_params <- CopyNumScanParams(index_genome=index_genome, select=select_columns, cnvar="Log R Ratio", bafvar="B Allele Freq", gtvar=c("Allele1 - AB", "Allele2 - AB")) invisible(sapply(views, parseSourceFile, param=scan_params)) ped_hapmap <- ParentOffspring(id = "hapmap", father="12287_03", mother="12287_02", offspring="12287_01", parsedPath=parsedPath(views)) ped_list <- ParentOffspringList(pedigrees=list( ParentOffspring(id = "hapmap", father="12287_03", mother="12287_02", offspring="12287_01", parsedPath=parsedPath(views)), ParentOffspring(id = "cleft", father="22169_03", mother="22169_02", offspring="22169_01", parsedPath=parsedPath(views)))) sample_info <- read.csv(file.path(extdir, "sample_data.csv"), stringsAsFactors=FALSE) ind_id <- setNames(gsub(" ", "", sample_info$IndividualID), sample_info$File) colnames(views) <- ind_id[gsub(".csv", "", colnames(views))] md_exp <- MinDistExperiment(views, pedigree=ped_list[[2]]) seqlevels(md_exp, pruning.mode="coarse") <- "chr22" params <- MinDistParam() md_gr <- segment2(md_exp, params) save(md_exp, file="~/Software/bridge/MinimumDistance/data/md_exp.rda") save(md_gr, file="~/Software/bridge/MinimumDistance/data/md_gr.rda") ## End(Not run)
MinDistGRanges
objectPrior to inferring de novo trio copy number states, the log R
ratios are segmented independently for each individual in a
ParentOffsping
class. The segmentation results are recorded
in separate GRanges
objects for the parents. For
segmentation of the offspring log R ratios and the minimum
distance, the segments are stored in separate GRangesList
objects. For convenience, these GRanges
,
GRangesList
, and pedigree information are bound in a single
container referred to as a MinDistGRanges
object. The
example MinDistGRanges
object provided in this package was
obtained from the segmentation of the data stored in the example
MinDistExperiment
object.
a MinDistGRanges
object
Text summary of information encapculated in a MDRanges object for a particular interval
mdLegend(g)
mdLegend(g)
g |
a |
GRanges
-derived classContains maximum a posteriori estimates for each genomic interval
MDRanges(..., posteriors)
MDRanges(..., posteriors)
... |
additional arguments to |
posteriors |
a |
MDRanges()
MDRanges()
Getter and setter for the minimum distance statistic
mindist(object) mindist(object) <- value
mindist(object) mindist(object) <- value
object |
see |
value |
a matrix of the minimum distance |
MinDistExperiment
classConstructor for MinDistExperiment
class
MinDistExperiment(object = ArrayViews(), pedigree = ParentOffspring(), ...) ## S4 method for signature 'ArrayViews,ParentOffspring' MinDistExperiment(object = ArrayViews(), pedigree = ParentOffspring(), ...)
MinDistExperiment(object = ArrayViews(), pedigree = ParentOffspring(), ...) ## S4 method for signature 'ArrayViews,ParentOffspring' MinDistExperiment(object = ArrayViews(), pedigree = ParentOffspring(), ...)
object |
see |
pedigree |
a |
... |
ignored |
an object of class MinDistExperiment
Class and methods for MinDistExperiment
## S4 method for signature 'MinDistExperiment' show(object) ## S4 method for signature 'MinDistExperiment' pedigree(object) ## S4 replacement method for signature 'MinDistExperiment' pedigree(object) <- value ## S4 method for signature 'MinDistExperiment' mindist(object) ## S4 replacement method for signature 'MinDistExperiment,ANY' mindist(object) <- value ## S4 method for signature 'MinDistExperiment,ANY,ANY,ANY' x[i, j, ..., drop = FALSE] ## S4 method for signature 'MinDistExperiment' offspring(object) ## S4 method for signature 'MinDistExperiment' father(object) ## S4 method for signature 'MinDistExperiment' mother(object) ## S4 method for signature 'MinDistExperiment' segment2(object, param = MinDistParam()) ## S4 method for signature 'RangedSummarizedExperiment' father(object) ## S4 method for signature 'RangedSummarizedExperiment' mother(object) ## S4 method for signature 'RangedSummarizedExperiment' offspring(object)
## S4 method for signature 'MinDistExperiment' show(object) ## S4 method for signature 'MinDistExperiment' pedigree(object) ## S4 replacement method for signature 'MinDistExperiment' pedigree(object) <- value ## S4 method for signature 'MinDistExperiment' mindist(object) ## S4 replacement method for signature 'MinDistExperiment,ANY' mindist(object) <- value ## S4 method for signature 'MinDistExperiment,ANY,ANY,ANY' x[i, j, ..., drop = FALSE] ## S4 method for signature 'MinDistExperiment' offspring(object) ## S4 method for signature 'MinDistExperiment' father(object) ## S4 method for signature 'MinDistExperiment' mother(object) ## S4 method for signature 'MinDistExperiment' segment2(object, param = MinDistParam()) ## S4 method for signature 'RangedSummarizedExperiment' father(object) ## S4 method for signature 'RangedSummarizedExperiment' mother(object) ## S4 method for signature 'RangedSummarizedExperiment' offspring(object)
object |
a |
value |
a |
x |
a |
i |
a numeric-vector for indexing the rows (optional) |
j |
a numeric-vector for indexing the columns (optional) |
... |
additional arguments propogated to subsetting methods for |
drop |
logical. Whether to simplify a one-row or one-column matrix to a vector. In most cases, this should always be FALSE. |
param |
a |
mindist
a matrix
pedigree
a ParentOffspring
object
MinDistGRanges
classThe MinDistGRanges
class contains the segmentation of the
father, mother, offspring, and the minimum distance for each
possible parent-offspring trio. For the parents, the segmentation
results are expected to be in GRanges
format. To accomodate
multiple-offspring families, both the offspring segments and
minimum distance segments should be of class GRangesList
where the length of the list corresponds to the number of
offspring.
MinDistGRanges( mindist = GRangesList(), offspring = GRangesList(), father = GRanges(), mother = GRanges(), pedigree = ParentOffspring() )
MinDistGRanges( mindist = GRangesList(), offspring = GRangesList(), father = GRanges(), mother = GRanges(), pedigree = ParentOffspring() )
mindist |
a |
offspring |
a |
father |
a |
mother |
a |
pedigree |
a |
MinDistGRanges()
MinDistGRanges()
ParentOffspring
familyA container for storing segmentation data for members in a
ParentOffspring
family
## S4 method for signature 'MinDistGRanges' names(x) ## S4 method for signature 'MinDistGRanges' mindist(object) ## S4 replacement method for signature 'MinDistGRanges,GRangesList' mindist(object) <- value ## S4 method for signature 'MinDistGRanges' offspring(object) ## S4 method for signature 'MinDistGRanges' mother(object) ## S4 method for signature 'MinDistGRanges' father(object) ## S4 method for signature 'MinDistGRanges' pedigree(object) ## S4 method for signature 'MinDistGRanges' show(object) ## S4 method for signature 'GRangesList' offspring(object)
## S4 method for signature 'MinDistGRanges' names(x) ## S4 method for signature 'MinDistGRanges' mindist(object) ## S4 replacement method for signature 'MinDistGRanges,GRangesList' mindist(object) <- value ## S4 method for signature 'MinDistGRanges' offspring(object) ## S4 method for signature 'MinDistGRanges' mother(object) ## S4 method for signature 'MinDistGRanges' father(object) ## S4 method for signature 'MinDistGRanges' pedigree(object) ## S4 method for signature 'MinDistGRanges' show(object) ## S4 method for signature 'GRangesList' offspring(object)
x |
a |
object |
a |
value |
a |
mindist
a GRangesList
object
offspring
a GRangesList
object
father
a GRanges
object
mother
a GRanges
object
pedigree
a ParentOffspring
object
data(md_gr) offspring(md_gr) father(md_gr) mother(md_gr) mindist(md_gr)
data(md_gr) offspring(md_gr) father(md_gr) mother(md_gr) mindist(md_gr)
MinDistParam
classThe MinDistParam
class contains parameters used for the
segmentation implemented in the DNAcopy
package, parameters
extracted from the PennCNV
HMM such as parent-offspring
transmission parobabilities (see citation below), and initial
values / parameters for computing emission probabilities.
MinDistParam( nMAD = 0.75, dnacopy = DNAcopyParam(), penncnv = PennParam(), emission = EmissionParam(), thin = 10L )
MinDistParam( nMAD = 0.75, dnacopy = DNAcopyParam(), penncnv = PennParam(), emission = EmissionParam(), thin = 10L )
nMAD |
a length-one numeric vector indicating the minimal number of median absolute deviations of the mean segmented minimum distance from zero. For non-zero segments (# median absolute deviations > nMAD), maximum a posteriori estimates of the parent-offspring copy number states are computed. Segments with minimum distance values near zero are not called as they are less likely to correspond to regions with de novo copy number alterations. |
dnacopy |
an object of class |
penncnv |
probabilities/parameters of the PennCNV hidden Markov model |
emission |
an object of class |
thin |
a length-one vector indicating whether to thin the
data. This is primarily for internal use in conjunction with the
|
Contains parameters used for circular binary segmentation (package DNAcopy), parameters in the PennCNV hidden Markov model, and parameters used for computing emission probabilities.
## S4 method for signature 'MinDistParam' nMAD(object) ## S4 replacement method for signature 'MinDistParam,numeric' nMAD(object) <- value ## S4 method for signature 'MinDistParam' show(object) ## S4 method for signature 'DNAcopyParam' show(object)
## S4 method for signature 'MinDistParam' nMAD(object) ## S4 replacement method for signature 'MinDistParam,numeric' nMAD(object) <- value ## S4 method for signature 'MinDistParam' show(object) ## S4 method for signature 'DNAcopyParam' show(object)
object |
a |
value |
a length-one numeric vector. |
nMAD
a length-one numeric vector
dnacopy
an object of class DNAcopyParam
penncnv
an object of class PennParam
emission
an object of class EmissionParam
thin
a length-one non-negative integer
MinDistPosterior is a GRangesList
-derived container for the
segmentation and maximum a posteriori trio copy number states.
## S4 method for signature 'MinDistPosterior,ANY,ANY,ANY' x[i, j, ..., drop = FALSE] ## S4 method for signature 'MinDistPosterior' show(object)
## S4 method for signature 'MinDistPosterior,ANY,ANY,ANY' x[i, j, ..., drop = FALSE] ## S4 method for signature 'MinDistPosterior' show(object)
x |
a |
i |
an index for subsetting rows |
j |
an index for subsetting columns |
... |
additional arguments passed to subsetting matrices |
drop |
logical – whether to coerce single-row matrices to vectors |
object |
a |
Setter and getter for number of median absolute deviations the mean minimum distance of a genomic interval is from zero
nMAD(object) nMAD(object) <- value
nMAD(object) nMAD(object) <- value
object |
see |
value |
a length-one numeric vector |
These functions will be defunct in a future release.
offspringNames(object) offspringNames(object) <- value trios(object) pedigree(object) pedigree(object) <- value
offspringNames(object) offspringNames(object) <- value trios(object) pedigree(object) pedigree(object) <- value
object |
see |
value |
a character vector of offspring identifiers |
Container for registering sample identifiers with membership in a
pedigree. For representing multiple pedigrees, see
ParentOffspringList
.
Accessor for the sample identifiers for the members in a pedigree
offspring(object) mother(object) father(object) ParentOffspring( id = character(), father = character(), mother = character(), offspring = character(), parsedPath = character() ) ## S4 method for signature 'ParentOffspring' pedigreeName(object) ## S4 method for signature 'ParentOffspring' father(object) ## S4 method for signature 'ParentOffspring' mother(object) ## S4 method for signature 'ParentOffspring' offspring(object) ## S4 method for signature 'ParentOffspring' show(object) ## S4 method for signature 'ParentOffspring' names(x)
offspring(object) mother(object) father(object) ParentOffspring( id = character(), father = character(), mother = character(), offspring = character(), parsedPath = character() ) ## S4 method for signature 'ParentOffspring' pedigreeName(object) ## S4 method for signature 'ParentOffspring' father(object) ## S4 method for signature 'ParentOffspring' mother(object) ## S4 method for signature 'ParentOffspring' offspring(object) ## S4 method for signature 'ParentOffspring' show(object) ## S4 method for signature 'ParentOffspring' names(x)
object |
a |
id |
length-one character vector providing a family-level id |
father |
length-one character vector providing sample ids for father |
mother |
length-one character vector providing sample ids for mother |
offspring |
character vector providing sample ids for offspring (can have length greater than one if there is more than one offspring) |
parsedPath |
character vector providing path to low-level data |
x |
a |
id
length-one character vector providing a family-level id
father
length-one character vector providing sample ids for father
mother
length-one character vector providing sample ids for mother
offspring
character vector providing sample ids for offspring (can have length greater than one if there is more than one offspring)
parsedPath
character vector providing path to parsed files of the marker-level summaries
ParentOffspringList-class
ParentOffspring()
ParentOffspring()
ParentOffspring
objectsEach element of the list is an element of class
ParentOffspring
.
ParentOffspringList(pedigrees = list(), id) ## S4 method for signature 'ParentOffspringList' pedigreeName(object) ## S4 method for signature 'ParentOffspringList' show(object) ## S4 method for signature 'ParentOffspringList,ANY,ANY' x[[i, j, ..., drop = FALSE]] ## S4 method for signature 'ParentOffspringList,ANY,ANY,ANY' x[i, j, ..., drop = FALSE] ## S4 method for signature 'ParentOffspringList' length(x)
ParentOffspringList(pedigrees = list(), id) ## S4 method for signature 'ParentOffspringList' pedigreeName(object) ## S4 method for signature 'ParentOffspringList' show(object) ## S4 method for signature 'ParentOffspringList,ANY,ANY' x[[i, j, ..., drop = FALSE]] ## S4 method for signature 'ParentOffspringList,ANY,ANY,ANY' x[i, j, ..., drop = FALSE] ## S4 method for signature 'ParentOffspringList' length(x)
pedigrees |
a list of |
id |
identifier for a pedigree |
object |
a |
x |
a |
i |
a numeric vector for subsetting the list (optional) |
j |
ignored |
... |
ignored |
drop |
ignored |
id
a character vector of identifiers for the
pedigrees. id
must have the same length as pedigrees
pedigrees
A list of ParentOffspring objects.
ParentOffspringList()
ParentOffspringList()
This function is deprecated and will be removed in a future release.
Pedigree( pedigreeInfo, fatherIds = character(), motherIds = character(), offspringIds = character() )
Pedigree( pedigreeInfo, fatherIds = character(), motherIds = character(), offspringIds = character() )
pedigreeInfo |
a |
fatherIds |
character vector of identifiers for the father |
motherIds |
character vector of identifiers for the mother |
offspringIds |
character vector of identifiers for the offspring |
Pedigree()
Pedigree()
Deprecated class for storing pedigree data
## S4 method for signature 'Pedigree' trios(object) ## S4 method for signature 'Pedigree' offspringNames(object) ## S4 method for signature 'Pedigree' show(object) ## S4 method for signature 'Pedigree,ANY,ANY,ANY' x[i, j, ..., drop = FALSE] ## S4 method for signature 'Pedigree' dim(x)
## S4 method for signature 'Pedigree' trios(object) ## S4 method for signature 'Pedigree' offspringNames(object) ## S4 method for signature 'Pedigree' show(object) ## S4 method for signature 'Pedigree,ANY,ANY,ANY' x[i, j, ..., drop = FALSE] ## S4 method for signature 'Pedigree' dim(x)
object |
a |
x |
a |
i |
a numeric vector for subsetting (optional) |
j |
ignored |
... |
ignored |
drop |
ignored |
trios
a data.frame
with colnames 'F', 'M', and 'O'
containing sample identifiers for the father (F), mother (M), and
offspring (O).
trioIndex
a data.frame
Plot the log R ratios and BAFs on a grid given by precomputed viewports
pedigreeGrid(g, vps, figs)
pedigreeGrid(g, vps, figs)
g |
a |
vps |
a list of viewports. See |
figs |
a list of trellis objects created by the function |
library(VanillaICE) require(grid) ##marker-level summaries data(md_exp) seqlevels(md_exp, pruning.mode="coarse") <- "chr22" ## segmentation results data(md_gr) posteriorCalls <- MAP2(md_exp, md_gr, MinDistParam()) g <- denovoHemizygous(posteriorCalls) g vps <- MinimumDistance:::pedigreeViewports() param <- HmmTrellisParam() p <- plotDenovo(md_exp, g[1], param) p <- pedigreeGrid(g=g[1], vps=vps, figs=p) leg <- mdLegend(g[1]) upViewport(0) pushViewport(vps[["legend"]]) grid.text(leg, x=unit(0.02, "npc"), y=unit(0.95, "npc"), just=c("left", "top"), gp=gpar(cex=0.6, fontfamily="mono")) ## ## combine adjacent denovo hemizygous ## g2 <- reduce(denovoHemizygous(posteriorCalls), min.gapwidth=500e3) post <- MAP2(md_exp, g2) g2 <- denovoHemizygous(post) p <- plotDenovo(md_exp, g2, param) p <- pedigreeGrid(g=g2, vps=vps, figs=p) leg <- mdLegend(g2) upViewport(0) pushViewport(vps[["legend"]]) grid.text(leg, x=unit(0.02, "npc"), y=unit(0.95, "npc"), just=c("left", "top"), gp=gpar(cex=0.6, fontfamily="mono"))
library(VanillaICE) require(grid) ##marker-level summaries data(md_exp) seqlevels(md_exp, pruning.mode="coarse") <- "chr22" ## segmentation results data(md_gr) posteriorCalls <- MAP2(md_exp, md_gr, MinDistParam()) g <- denovoHemizygous(posteriorCalls) g vps <- MinimumDistance:::pedigreeViewports() param <- HmmTrellisParam() p <- plotDenovo(md_exp, g[1], param) p <- pedigreeGrid(g=g[1], vps=vps, figs=p) leg <- mdLegend(g[1]) upViewport(0) pushViewport(vps[["legend"]]) grid.text(leg, x=unit(0.02, "npc"), y=unit(0.95, "npc"), just=c("left", "top"), gp=gpar(cex=0.6, fontfamily="mono")) ## ## combine adjacent denovo hemizygous ## g2 <- reduce(denovoHemizygous(posteriorCalls), min.gapwidth=500e3) post <- MAP2(md_exp, g2) g2 <- denovoHemizygous(post) p <- plotDenovo(md_exp, g2, param) p <- pedigreeGrid(g=g2, vps=vps, figs=p) leg <- mdLegend(g2) upViewport(0) pushViewport(vps[["legend"]]) grid.text(leg, x=unit(0.02, "npc"), y=unit(0.95, "npc"), just=c("left", "top"), gp=gpar(cex=0.6, fontfamily="mono"))
Accessor for pedigree name
pedigreeName(object)
pedigreeName(object)
object |
a |
ParentOffspring
ParentOffspringList
Default viewports for plotting log R ratios, BAFs, chromosome idiogram, and a legend for a case-parent trio
pedigreeViewports()
pedigreeViewports()
vps <- pedigreeViewports()
vps <- pedigreeViewports()
PennParam
Parameters for the PennCNV Hidden Markov model
PennParam( states, referenceState = "222", prLessLikelyCN = 9e-04, prNonMendelian = 1.5e-06, prInitialStateNotDiploid = 4/5, prTransitionToNewState = 0.5, tauNM = 0.01 ) ## S4 method for signature 'PennParam' show(object)
PennParam( states, referenceState = "222", prLessLikelyCN = 9e-04, prNonMendelian = 1.5e-06, prInitialStateNotDiploid = 4/5, prTransitionToNewState = 0.5, tauNM = 0.01 ) ## S4 method for signature 'PennParam' show(object)
states |
character vector of possible trio states |
referenceState |
the reference (normal) trio copy number state (typically '222') |
prLessLikelyCN |
as defined in Wang et al. 2007, this is the probability of the less likely allele-specific copy numbers for the trio |
prNonMendelian |
the prior probability of a non-Mendelian copy number alteration |
prInitialStateNotDiploid |
initial probability for non-diploid states |
prTransitionToNewState |
probability of transitioning to a new state |
tauNM |
probability of transitioning from a Mendelian given previous event was non-Mendelian (and vice versa). |
object |
a |
Wang et al., Genome Res. 2007 Nov;17(11):1665-74. PMID: 17921354
Plot marker-level summaries for a genomic interval of interest
plotDenovo(object, g, param) ## S4 method for signature 'MinDistExperiment,MDRanges' plotDenovo(object, g, param)
plotDenovo(object, g, param) ## S4 method for signature 'MinDistExperiment,MDRanges' plotDenovo(object, g, param)
object |
see |
g |
a |
param |
a |
The range method for class ILimit is used internally in MinimumDistance.
## S4 method for signature 'ILimit' range(x, ..., na.rm = FALSE)
## S4 method for signature 'ILimit' range(x, ..., na.rm = FALSE)
x |
a |
... |
ignored |
na.rm |
logical. If TRUE, missing values are removed. |
Methods for circular binary segmentation.
segment2(object, ...) ## S4 method for signature 'TrioSet' segment2(object, md = NULL, segmentParents = TRUE, verbose = TRUE, ...) ## S4 method for signature 'matrix' segment2(object, pos, chrom, id, featureNames, ...) ## S4 method for signature 'ff_matrix' segment2(object, pos, chrom, id, featureNames, ...) ## S4 method for signature 'arrayORff_array' segment2( object, pos, chrom, id, featureNames, segmentParents = TRUE, verbose = TRUE, ... )
segment2(object, ...) ## S4 method for signature 'TrioSet' segment2(object, md = NULL, segmentParents = TRUE, verbose = TRUE, ...) ## S4 method for signature 'matrix' segment2(object, pos, chrom, id, featureNames, ...) ## S4 method for signature 'ff_matrix' segment2(object, pos, chrom, id, featureNames, ...) ## S4 method for signature 'arrayORff_array' segment2( object, pos, chrom, id, featureNames, segmentParents = TRUE, verbose = TRUE, ... )
object |
see |
... |
Additional arguments passed to DNAcopy's |
md |
a matrix of the minimum distance |
segmentParents |
logical. Whether to segment the log R ratios of the parents using circular binary segmentation. |
verbose |
logical. Whether to display messages that indicate progress. |
pos |
integer vector of physical position of markers in the genome |
chrom |
character or integer vector of chromosome names |
id |
character vector of trio identifiers for subsetting |
featureNames |
character vector specifying marker names for subsetting |
TrioSet
classThe TrioSet
class has been deprecated and may be removed in
a future release.
TrioSet( pedigreeData = Pedigree(), sample.sheet, row.names = NULL, lrr, baf, featureData, cdfname, drop = TRUE, mindist = NULL, genome = c("hg19", "hg18") )
TrioSet( pedigreeData = Pedigree(), sample.sheet, row.names = NULL, lrr, baf, featureData, cdfname, drop = TRUE, mindist = NULL, genome = c("hg19", "hg18") )
pedigreeData |
an object of class |
sample.sheet |
a |
row.names |
a character vector providing row identifiers for
the |
lrr |
a matrix of log R ratios |
baf |
a matrix of B allele frequencies |
featureData |
a |
cdfname |
character string indicating the annotation package used to extract physical position and chromosome of markers |
drop |
logical. When FALSE, the dimnames on the log R ratio and BAF arrays is set to NULL |
mindist |
can be either NULL or a matrix of the minimum distance |
genome |
character string providing the UCSC genome build |
TrioSet
This class is deprecated and will be defunct in a future release.
## S4 method for signature 'TrioSet' pedigree(object) ## S4 method for signature 'TrioSet' show(object) ## S4 method for signature 'TrioSet' mindist(object) ## S4 replacement method for signature 'TrioSet,matrix' mindist(object) <- value ## S4 method for signature 'TrioSet' dim(x) ## S4 method for signature 'TrioSet' trios(object) ## S4 method for signature 'TrioSet,ANY,ANY,ANY' x[i, j, ..., drop = FALSE] ## S4 method for signature 'TrioSet,GRanges' MAP( object, ranges, transition_param = TransitionParam(), emission_param = EmissionParam(), mdThr = 0.9, ... ) ## S4 method for signature 'ff_array,ANY,ANY,ANY' x[i, j, ..., drop = FALSE]
## S4 method for signature 'TrioSet' pedigree(object) ## S4 method for signature 'TrioSet' show(object) ## S4 method for signature 'TrioSet' mindist(object) ## S4 replacement method for signature 'TrioSet,matrix' mindist(object) <- value ## S4 method for signature 'TrioSet' dim(x) ## S4 method for signature 'TrioSet' trios(object) ## S4 method for signature 'TrioSet,ANY,ANY,ANY' x[i, j, ..., drop = FALSE] ## S4 method for signature 'TrioSet,GRanges' MAP( object, ranges, transition_param = TransitionParam(), emission_param = EmissionParam(), mdThr = 0.9, ... ) ## S4 method for signature 'ff_array,ANY,ANY,ANY' x[i, j, ..., drop = FALSE]
object |
a |
value |
a |
x |
a |
i |
a numeric vector for subsetting rows (optional) |
j |
a numeric vector for subsetting trios (optional) |
... |
additional arguments passed to subsetting methods for matrices and data frames |
drop |
logical. Whether to simplify matrices to numeric vectors. This should be left as FALSE. |
ranges |
a |
transition_param |
an object of class |
emission_param |
an object of class |
mdThr |
the minimum absolute value of the minimum distance
segment mean. Segments with means below |
fatherPhenoData
AnnotatedDataFrame
containing covariates for the father
motherPhenoData
AnnotatedDataFrame
containing covariates for the mother
pedigree
an object of class Pedigree
mindist
a numeric matrix of the minimum distance for each trio, or NULL
TrioSetList
classThe TrioSetList
class has been deprecated and may be removed in
a future release. Use MinDistExperiment
instead.
TrioSetList( chromosome = integer(), pedigreeData = Pedigree(), sample.sheet, row.names = NULL, lrr, baf, featureData, cdfname, ffname = "", genome )
TrioSetList( chromosome = integer(), pedigreeData = Pedigree(), sample.sheet, row.names = NULL, lrr, baf, featureData, cdfname, ffname = "", genome )
chromosome |
integer vector of chromosome names |
pedigreeData |
a |
sample.sheet |
a |
row.names |
a character vector |
lrr |
a matrix of log R ratios |
baf |
a matrix of B allele frequencies |
featureData |
a |
cdfname |
a character string indicating the annotation package |
ffname |
prefix for ff-filenames |
genome |
character string indicating genome build |
This class is deprecated and will be defunct in a future release.
## S4 method for signature 'TrioSetList,RangedSummarizedExperiment' coerce(from, to) ## S4 method for signature 'TrioSetList' pedigree(object) ## S4 method for signature 'TrioSetList' trios(object) ## S4 method for signature 'TrioSetList' offspringNames(object) ## S4 method for signature 'TrioSetList,ANY,ANY,ANY' x[i, j, ..., drop = FALSE] ## S4 method for signature 'TrioSetList,ANY,ANY' x[[i, j, ..., exact = TRUE]] ## S4 method for signature 'TrioSetList' show(object) ## S4 method for signature 'TrioSetList' length(x) ## S4 method for signature 'TrioSetList' x$name ## S4 method for signature 'TrioSetList,GRanges' MAP( object, ranges, id, TAUP = 1e+10, tauMAX = 1 - 5e-08, cnStates = c(-2, -0.4, 0, 0, 0.4, 1), pr.nonmendelian = 1.5e-06, mdThr = 0.9, ... ) ## S4 method for signature 'TrioSetList' segment2(object, md = NULL, segmentParents = TRUE, verbose = TRUE, ...) ## S4 method for signature 'list' segment2( object, pos, chrom, id = NULL, featureNames, segmentParents = TRUE, verbose = TRUE, genome, ... )
## S4 method for signature 'TrioSetList,RangedSummarizedExperiment' coerce(from, to) ## S4 method for signature 'TrioSetList' pedigree(object) ## S4 method for signature 'TrioSetList' trios(object) ## S4 method for signature 'TrioSetList' offspringNames(object) ## S4 method for signature 'TrioSetList,ANY,ANY,ANY' x[i, j, ..., drop = FALSE] ## S4 method for signature 'TrioSetList,ANY,ANY' x[[i, j, ..., exact = TRUE]] ## S4 method for signature 'TrioSetList' show(object) ## S4 method for signature 'TrioSetList' length(x) ## S4 method for signature 'TrioSetList' x$name ## S4 method for signature 'TrioSetList,GRanges' MAP( object, ranges, id, TAUP = 1e+10, tauMAX = 1 - 5e-08, cnStates = c(-2, -0.4, 0, 0, 0.4, 1), pr.nonmendelian = 1.5e-06, mdThr = 0.9, ... ) ## S4 method for signature 'TrioSetList' segment2(object, md = NULL, segmentParents = TRUE, verbose = TRUE, ...) ## S4 method for signature 'list' segment2( object, pos, chrom, id = NULL, featureNames, segmentParents = TRUE, verbose = TRUE, genome, ... )
from |
a |
to |
a |
object |
a |
x |
a |
i |
a numeric vector for subsetting the chromosomes (optional) |
j |
a numeric vector for subsetting trios (optional) |
... |
additional arguments passed to subsetting methods for matrices and data frames |
drop |
logical. Whether to simplify matrices to numeric vectors. This should be left as FALSE. |
exact |
ignored |
name |
character string of a variable name in the phenoData |
ranges |
a |
id |
a character vector of trio identifiers |
TAUP |
length-one numeric vector. Larger values decrease the probability of transitioning to an different state. |
tauMAX |
the maximum allowed transition probability |
cnStates |
a length-six numeric vector profiving initial values for the mean copy number for each of the 6 states |
pr.nonmendelian |
a length-one numeric vector indicating the probability of a non-Mendelian copy number alteration in the offspring |
mdThr |
a length-one numeric vector indicating the minimum
value of the mean minimum distance. Segments with absolute mean
value less than |
md |
a list of minimum distance matrices. Length of list
should be the same as the length of the |
segmentParents |
logical. Whether to segment the parental log R ratios. |
verbose |
logical. Whether to display messages indicating progress. |
pos |
a list of the genomic positions (integers) |
chrom |
list of chromosome names |
featureNames |
a list of the marker names |
genome |
a character vector indicating the UCSC genome build used for the annotation (i.e., 'hg18' or 'hg19'). |
fatherPhenoData
AnnotatedDataFrame
containing covariates for the father
motherPhenoData
AnnotatedDataFrame
containing covariates for the mother
pedigree
an object of class Pedigree
The TrioSetListLD constructor uses ff objects to handle large datasets. This function is defunct. Use MinDistExperiment instead.
TrioSetListLD( path, fnames, ext = "", samplesheet, row.names, pedigreeData, featureData, annotationPkg, outdir = ldPath(), ffprefix = "", genome = c("hg19", "hg18") )
TrioSetListLD( path, fnames, ext = "", samplesheet, row.names, pedigreeData, featureData, annotationPkg, outdir = ldPath(), ffprefix = "", genome = c("hg19", "hg18") )
path |
Path to plain-text files containing log R ratios and B allele frequencies. Files should contain data for a single sample. |
fnames |
Character string providing filenames. |
ext |
Character string indicating whether the |
samplesheet |
(Optional) |
row.names |
Character vector indicating the sample id for each
row in |
pedigreeData |
An object of class |
featureData |
A |
annotationPkg |
Character string indicating the annotation package used to extract information on the features (chromosome, physical position, and whether the feature is polymorphic ('isSnp')). |
outdir |
Character string indicating the path for storing |
ffprefix |
Character string indicating the prefix used to name ff objects. Ignored if the ff package is not loaded. |
genome |
character string indicating UCSC genome build. Only "hg19" is allowed for annotation packages that support a single build. Supported builds for most platforms are "hg18" and "hg19". |
A TrioSetList
object