Title: | This Package Discovers Meso-scale Chromatin Remodeling from 3C Data |
---|---|
Description: | This package discovers meso-scale chromatin remodelling from 3C data. 3C data is local in nature. It givens interaction counts between restriction enzyme digestion fragments and a preferred 'viewpoint' region. By binning this data and using permutation testing, this package can test whether there are statistically significant changes in the interaction counts between the data from two cell types or two treatments. |
Authors: | Michael Shapiro [aut, cre] |
Maintainer: | Michael Shapiro <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.21.0 |
Built: | 2024-11-03 06:24:19 UTC |
Source: | https://github.com/bioc/deltaCaptureC |
This takes a GRanges object for binneed data and a column name designating where to find the relevant data in the mcols and returns a GRanges giving the consecutive runs of constant sign and their run totals. It is not exported.
.getRunsAndTotals(gr, colName)
.getRunsAndTotals(gr, colName)
gr |
a GRanges object whose mcols gives the relevant binned data |
colName |
This designates the column in mcols with the relevant data |
a GRanges object giving the contiguous regions and their respective sums.
The deltaCaptureC package depends on rebinning mean normalized capture C data from a small bin size to a large bin size. This gives the size of the latter. This is used in package documentation.
bigBinSize
bigBinSize
a numeric scalar
The data plotted here are the difference between mean normalized counts for captures in two replicates each of EScells and Neurons. The data here is binned to 1000bp and is shown in a region of 500kb up- and down-stream of the Paupar viewpoint. It is used here to illustrate functioning of the deltaCaptureC package.
binnedDeltaPlot
binnedDeltaPlot
A ggplot object
A smaller deltaSE restriction to a region of interest around the viewpoint, here binned to the bigBinSize, 10kb.
binnedDeltaSE
binnedDeltaSE
A RangedSummarizedExperiment with 1909 rows.
Capture-C counts of EScells and Neurons restricted to a region of interest around the Paupar viewpoint. The data have been binned to smallBins, i.e., bins of size 1000. Used in package documentation.
binnedSummarizedExperiment
binnedSummarizedExperiment
A RangedSummarizedExperiment.
This function takes a set of bins given by a GRanges object and a RangedSummarizedExperiment and produces a new RangedSummarizedExperiment with the bins as its rowRanges
binSummarizedExperiment(bins, se, checkDisjoint = FALSE)
binSummarizedExperiment(bins, se, checkDisjoint = FALSE)
bins |
a GRanges object whose ranges should be disjoint |
se |
a RangedSummarizedExperiment |
checkDisjoint |
= FALSE if set to true will check that the bins are disjoint |
a RangedSummarizedExperiment
binnedSummarizedExperiment = binSummarizedExperiment(smallSetOfSmallBins,smallerDeltaSE)
binnedSummarizedExperiment = binSummarizedExperiment(smallSetOfSmallBins,smallerDeltaSE)
This gives the difference in mean normalized capture C counts between two replicates each of EScells and Neurons. It is the underlying kind of data on which deltaCaptureC operates and is here to support documentation.
deltaSE
deltaSE
A RangedSummarizedExperiment with 5709 rows.
This function takes a data.frame with chr, start, end and numerical data and turns it into a matrix with row names chr:start-end
downshiftDFtoMatrix(df)
downshiftDFtoMatrix(df)
df |
This is a data frame whose first three columns are chr, start and end and whose remaining columns are numerical data |
A matrix of numerical data
m = downshiftDFtoMatrix(miniSEDF)
m = downshiftDFtoMatrix(miniSEDF)
This function takes a set of row ranges and an inner region and generates a permutation which is symmetric on the inner region and arbitrary on the remainder
generatePermutation(gr, innerRegion)
generatePermutation(gr, innerRegion)
gr |
a GRanges object which should be ordered |
innerRegion |
a GRanges object which should be a single interval |
a permutation of 1:length(gr)
permutations = generatePermutation(smallBins,viewpointRegion)
permutations = generatePermutation(smallBins,viewpointRegion)
This function takes a SummarizedExperiment with count data and produces a SummarizedExperiment of the delta track. There should exactly two values for treatment, i.e., byTreatment
getDeltaSE(countsSE, byTreatment = "treatment")
getDeltaSE(countsSE, byTreatment = "treatment")
countsSE |
A summarized experiment with assay counts and optionally assay normalized counts |
byTreatment |
= 'treatment' Allows for specifying some other condition than 'treatment' |
A summarized experiment with a single assay consisting of a single column, the delta mean normalized counts.
aSmallDeltaSE = getDeltaSE(miniSE)
aSmallDeltaSE = getDeltaSE(miniSE)
This function looks at the sidedness around the viewpoint and returns the absolute value of the difference between the sum of the values before and after the viewpoint inside the viewpoint region.
getLopsidedness(se, viewpointRegion, colName = "delta")
getLopsidedness(se, viewpointRegion, colName = "delta")
se |
a SummerizedExperiment giving the delta or permuted delta |
viewpointRegion |
the region around the viewpoint in which to investigate lopsidedness |
colName |
defaults to 'delta' |
the lopsidedness around the viewpointMid in the viewpointRegion
lopsidedness = getLopsidedness(binnedDeltaSE,viewpointRegion)
lopsidedness = getLopsidedness(binnedDeltaSE,viewpointRegion)
Get the mean normalized counts for each treatment
getMeanNormalizedCountsSE(countsSE, byTreatment = "treatment")
getMeanNormalizedCountsSE(countsSE, byTreatment = "treatment")
countsSE |
A SummarizedExperiment containing an assay 'counts' and optionally an assay 'normalizedCounts' |
byTreatment |
= 'treatment' This gives the column of colData to use for taking averages |
This function takes a SummarizedExperiment. It looks for an assay called normalizedCounts. If this assay is missing, it creates it by normalizing using the size factors. By default, it takes the mean for each value of colData$treatment
A SummarizedExperiment giving mean normalized counts for each value of byTreatment
meanNormalizedCountSE = getMeanNormalizedCountsSE(miniSE)
meanNormalizedCountSE = getMeanNormalizedCountsSE(miniSE)
This function takes a SummarizedExperiment giving the the counts for each replicate of the two treatments and computes and affixes an assay giving the normalized version of these counts.
getNormalizedCountsSE(se)
getNormalizedCountsSE(se)
se |
A SummarizedExperiment with an assay called counts giving the raw counts for each replicate of the two treatments. |
A SummarizedExperiment including a an assay of the normalized counts called normalizedCounts.
miniSENormalized = getNormalizedCountsSE(miniSE)
miniSENormalized = getNormalizedCountsSE(miniSE)
This function takes two GRanges, one representing a set of bins and the other representing data to be pro-rated over those bins and returns a data frame giving the overlaps, various widths and the fractions for pro-rating scores
getOverlapWeights(bins, gr, checkDisjoint = FALSE)
getOverlapWeights(bins, gr, checkDisjoint = FALSE)
bins |
a set of GRanges to be used for binning data. |
gr |
the GRanges of the data to be binned |
checkDisjoint |
= FALSE if this is TRUE it will check to see that the ranges in each of bins and gr are disjoint |
A data frame giving index pairs for the intersections, widths of the intersections and the fraction of each gr range meeting each bin
overlapWeights = getOverlapWeights(weightsExampleBins,weightsExampleGr)
overlapWeights = getOverlapWeights(weightsExampleBins,weightsExampleGr)
Given an Nx4 matrix with columns 'min','max','abs' and 'lopsidededness', this function returns the cutoff levels for a given pValue.
getPValueCutoff(runStats, p = 0.05)
getPValueCutoff(runStats, p = 0.05)
runStats |
a matrix with columns 'min','max','abs' and 'lopsidededness' |
p |
=.05 the desired p-value |
a vector with cutoff values
dimnames = list(c(),c('min','max','abs','lopsidedness')) m = 10 * (matrix(runif(400),ncol=4,dimnames=dimnames) - 0.5) cutoffs = getPValueCutoff(m,.05)
dimnames = list(c(),c('min','max','abs','lopsidedness')) m = 10 * (matrix(runif(400),ncol=4,dimnames=dimnames) - 0.5) cutoffs = getPValueCutoff(m,.05)
Get the distribution of run and lopsidedness statistics
getRunAndLopsidednessStatistics( scrambledDeltas, viewpointRegion, colName = "delta" )
getRunAndLopsidednessStatistics( scrambledDeltas, viewpointRegion, colName = "delta" )
scrambledDeltas |
a list of rebinned (i.e., to large bin size) of scrambled deltas |
viewpointRegion |
a GRanges object giving the region that is reserved for lopsidedness |
colName |
= 'delta' |
a Nx4 matrix giving the min, max, max(abs(min),abs(max)) and lopsidedness for the run totals in the list of scrambled deltas.
This is a helper function. Currently not exported.
getRunStatistics(runTotals)
getRunStatistics(runTotals)
runTotals |
is a GRanges object giving the consecutive runs and their totals. |
a vector of the min, max and absolute value of the min and max for the run totals.
This function takes a list of (scrambled) runs and extracts their run totals as a matrix with colnames 'min','max' and 'abs', the latter being the max of the absolute values of the previous two
getRunStatisticsDist(runTotalsList)
getRunStatisticsDist(runTotalsList)
runTotalsList |
this is a list whose members are GRanges objects giving the consecutive runs and their totals |
a Nx3 matrix giving the min, max and max(abs(min),abs(max)) run totals
This function finds the runs of consecutive ranges in which the sign of the data does not change. It returns a GRanges object containing the contiguous ranges and the weighted sum of data in each.
getRunTotals(se, innerRegion, colName = "delta")
getRunTotals(se, innerRegion, colName = "delta")
se |
a SummarizedExperiment whose first assay has a column named colName. Typically this will be a one-column matrix with delta. |
innerRegion |
a Granges object defining the region surrounding the viewpoint to be excluded from run total calculations |
colName |
defaults to 'delta' |
a GRanges object giving the contiguous regions and their respective sums
runTotals = getRunTotals(binnedDeltaSE,viewpointRegion)
runTotals = getRunTotals(binnedDeltaSE,viewpointRegion)
This function takes delta data as a SummarizedExperiment and required ancillary data and returns a GenomicRanges object whose mcols indicate the significant regions.
getSignificantRegions( deltaSE, regionOfInterest, viewpointRegion, smallBinSize, bigBinSize, numPermutations = 1000, pValue = 0.05 )
getSignificantRegions( deltaSE, regionOfInterest, viewpointRegion, smallBinSize, bigBinSize, numPermutations = 1000, pValue = 0.05 )
deltaSE |
a ranged summarized experiment with a one-column assay giving the delta mean count |
regionOfInterest |
a GenomicRanges object specifying the region of interest |
viewpointRegion |
the region withheld from arbitrary permutation |
smallBinSize |
size to bin original data to for permutation |
bigBinSize |
size to bin data to for significance testing. Must be a multiple of smallBinSize |
numPermutations |
= 1000 the number of permutations to be used for permutation testing |
pValue |
the desired significance level |
a GRanges object giving the bigBin binning of region of interest whose mcols gives the values of delta and logicals telling whether the bin is in the viewpoint regsion and whether it rises to statistical significance
This function takes a data frame giving chr, start, end and count for experimental replicates and returns the size factors for each of the replicates for use in normalization
getSizeFactorsDF(countsDF)
getSizeFactorsDF(countsDF)
countsDF |
A data frame whose first three columns are chr, start and end, and whose remaining columns are count data for experimental replicates |
The size factors for the columns of countsDF
sf = getSizeFactorsDF(miniSEDF)
sf = getSizeFactorsDF(miniSEDF)
This function takes a SummarizedExperiment with an assay counts and returns this object with a column sizeFactors added to its colData
getSizeFactorsSE(se)
getSizeFactorsSE(se)
se |
A SummarizedExperiment with an assay counts |
The same SummarizedExperiment with an additional column in its colData giving the size factors for counts
miniSEWithSizeFactors = getSizeFactorsSE(miniSE)
miniSEWithSizeFactors = getSizeFactorsSE(miniSE)
A smaller deltaSE restriction to a region of interest around the viewpoint.
miniDeltaSE
miniDeltaSE
A RangedSummarizedExperiment with 1909 rows.
Capture-C counts of EScells and Neurons restricted to a region of interest around the Paupar viewpoint. Used in package documentation.
miniSE
miniSE
A RangedSummarizedExperiment with 1909 rows.
Capture-C counts of EScells and Neurons restricted to a region of interest around the Paupar viewpoint. This contains the same information as miniSE, but here packaged as a data frame. Used in package documentation.
miniSEDF
miniSEDF
A data frame with 1909 rows.
Number of permutations used in example permutation testing in the example in the documentation.
numPermutations
numPermutations
A numeric scalar
This function takes a input the GRanges object produced by getSignificant regions and produces a ggplot of significant features
plotSignificantRegions( significantRegions, significanceType = "abs", title = "Significant Regions", xLabel = "viewpoint", legend = TRUE )
plotSignificantRegions( significantRegions, significanceType = "abs", title = "Significant Regions", xLabel = "viewpoint", legend = TRUE )
significantRegions |
a GRanges object as produced by getSignificantRegions |
significanceType |
= 'abs' a variable indicating whether to plot significance according to min, max or abs. |
title |
a title for the plot |
xLabel |
= 'viewpoint' supplies an xlabel |
legend |
= TRUE whether or not to show the legend |
a ggplot object
plotOfSignificantRegions = plotSignificantRegions(significantRegions)
plotOfSignificantRegions = plotSignificantRegions(significantRegions)
A title for the illustrative plot in the documentation
plotTitle
plotTitle
A character scalar
P-value used in the illustrative example of discovering statistically significant chromatin remodeling. Used in package documentation.
pValue
pValue
A numeric scalar
This is a faster way of rebinning when the old bins are consecutive and constant width and the new bins are to be a multiple of that width
rebinToMultiple(se, multiple, deleteShort = FALSE)
rebinToMultiple(se, multiple, deleteShort = FALSE)
se |
a RangedSummarizedExperiment to be rebinned |
multiple |
the factor by which to fatten the bins |
deleteShort |
= FALSE when set to true if the final bin is short it will be deleted |
a RangedSummarizedExperiment
rebinnedSummarizedExperiment = rebinToMultiple(binnedSummarizedExperiment,10)
rebinnedSummarizedExperiment = rebinToMultiple(binnedSummarizedExperiment,10)
This is the region 500kb up- and down-stream of the Paupar viewpoint, and defines the region on which we will look for statistically significan chromatin remodeling. This is used in package documentation.
regionOfInterest
regionOfInterest
A GRanges object with one segment.
Significance testing can be carried out by maximum, minimum or maximum absolute value. This has the value abs thus choosing the last of these. This is used in package documentation.
significanceType
significanceType
A scalar character
A GRanges object giving the value of delta in each bin and the significance or lack thereof according to the various statistical tests. This is used in package documentation.
significantRegions
significantRegions
A GRanges object
A ggplot object show the values of delta in the region of interest and the significant sub-regions. This is used for documentation purposes.
significantRegionsPlot
significantRegionsPlot
a ggplot object
The deltaCaptureC package depends on rebinning mean normalized capture C data from a small bin size to a large bin size. These are the small bins. They have a bin size of 1000 bp, i.e., smallBinSize, and span the region of interest. This is used in package documentation.
smallBins
smallBins
a GRanges object
The deltaCaptureC package depends on rebinning mean normalized capture C data from a small bin size to a large bin size. This gives the size of the former. This is used in package documentation.
smallBinSize
smallBinSize
a numeric scalar
This is a subset of miniDeltaSE. It's here so that the example for binSummarizedExperiment will run more quickly.
smallerDeltaSE
smallerDeltaSE
A RangedSummarizedExperiment.
This is a subset of the bins in smallBins and is here so that the example for binSummarizedExperiment will run more quickly.
smallSetOfSmallBins
smallSetOfSmallBins
a GRanges object
This is the region 50kb up- and down-stream of the Paupar viewpoint. This is the region in which counts strongly depend on distance from the viewpoint and will be treated distinctly from the region of interest.
viewpointRegion
viewpointRegion
A GRanges object with one segment.
This GRanges object is here to support the example for the function getOverlapWeights().
weightsExampleBins
weightsExampleBins
a GRanges object
This GRanges object is here to support the example for the function getOverlapWeights().
weightsExampleGr
weightsExampleGr
a GRanges object