Description Usage Arguments Details Value Author(s) See Also Examples
Adds a peakset to, or retrieves a peakset from, a DBA object
1 2 3 4 5 6 7 8 | dba.peakset(DBA=NULL, peaks, sampID, tissue, factor, condition, treatment, replicate,
control, peak.caller, peak.format, reads=0, consensus=FALSE,
bamReads, bamControl, spikein,
scoreCol, bLowerScoreBetter, filter, counts,
bRemoveM=TRUE, bRemoveRandom=TRUE,
minOverlap=2, bMerge=TRUE,
bRetrieve=FALSE, writeFile, numCols=4,
DataType=DBA$config$DataType)
|
DBA |
DBA object. Required unless creating a new DBA object by adding an initial peakset. |
peaks |
When adding a specified peakset: set of peaks, either a When adding a consensus peakset: a sample mask or vector of peakset numbers to include in the consensus.
If missing or When adding and empty peakset (zero peaks), set When adding a set of consensus peaksets: a sample mask or vector of peakset numbers. Sample sets will be derived only from subsets of these peaksets. When adding all the peaks from one DBA object to another: a DBA object.
In this case, the only other parameter to have an effect is When retrieving and/or writing a peakset: either a |
sampID |
ID string for the peakset being added; if missing, one is assigned (a serial number for a new peakset, or a concatenation of IDs for a consensus peakset). Must be unique for each sample. |
tissue |
tissue name for the peakset being added; if missing, one is assigned for a consensus peakset (a concatenation of tissues). |
factor |
factor name for the peakset being added; if missing, one is assigned for a consensus peakset (a concatenation of factors). |
condition |
condition name for the peakset being added; if missing, one is assigned for a consensus peakset (a concatenation of conditions). |
treatment |
treatment name for the peakset being added; if missing, one is assigned for a consensus peakset (a concatenation of treatment). |
replicate |
replicate number for the peakset being added; if missing, one is assigned for a consensus peakset (a concatenation of replicate numbers). |
control |
control name for the peakset being added; if missing, one is assigned for a consensus peakset (a concatenation of control names). |
peak.caller |
peak caller name string. If peaks is specified as a file, and peak.format is missing, a default fie format for the caller will be used (see peak.format). Supported values:
When adding a consensus peakset, a default value (a concatenation of peak caller names) is assigned if this is missing. |
peak.format |
peak format string. If specified, overrides the default file format for the specified peak caller. Supported formats (with default score column):
|
reads |
total number of ChIPed library reads for the peakset being added. |
consensus |
either the logical value of the consensus attribute when adding a specific peakset
(set to
|
bamReads |
file path of the BAM/BED file containing the aligned reads for the peakset being added. |
bamControl |
file path of the BAM/BED file containing the aligned reads for the control used for the peakset being added. |
spikein |
file path of the BAM/BED file containing the aligned reads for the spike-ins used for the peakset being added. |
scoreCol |
peak column to normalize to 0...1 scale when adding a peakset; 0 indicates no normalization |
bLowerScoreBetter |
Logical indicating that lower scores indicate higher confidence peaks; default is that higher scores indicate better peaks. |
filter |
Numeric indicating a filter value for peaks.
If present, any peaks with a score less than this value
(or higher if |
counts |
Used for adding externally computed peak counts.
Can be a filename or a dataframe.
Can consist of a single column (or vector) with the counts, or two columns,
with an ID for each interval in the first column and the counts in the second column,
or four columns (chr, start, end, counts).
When |
bRemoveM |
logical indicating whether to remove peaks on chrM when adding a peakset |
bRemoveRandom |
logical indicating whether to remove peaks on chrN_random when adding a peakset |
minOverlap |
the minimum number of peaksets a peak must be in to be included when adding a consensus peakset.
When retrieving, if the peaks parameter is
a vector (logical mask or vector of peakset numbers), a binding matrix will be retrieved
including all peaks in at least this many peaksets.
If |
bMerge |
logical indicating whether global binding matrix should be compiled after adding the peakset.
When adding several peaksets via successive calls to |
bRetrieve |
logical indicating that a peakset is being retrieved and/or written, not added. |
writeFile |
file to write retrieved peakset. |
numCols |
number of columns to include when writing out peakset. First four columns are chr, start, end, score; the remainder are maintained from the original peakset. Ignored when writing out complete binding matrix. |
DataType |
The class of object for returned peaksets:
Can be set as default behavior by setting |
MODE: Add a specified peakset:
dba.peakset(DBA=NULL, peaks, sampID, tissue, factor, condition, replicate,
control, peak.caller, reads, consensus, bamReads, bamControl,
normCol, bRemoveM, bRemoveRandom)
MODE: Add a consensus peakset (derived from overlapping peaks in peaksets already present):
dba.peakset(DBA, peaks, minOverlap)
MODE: Add a sets of consensus peaksets bases on sample sets that share or differ in specified attributes
dba.peakset(DBA, peaks, consensus, minOverlap)
MODE: Retrieve a peakset:
dba.peakset(DBA, peaks, bRetrieve=T)
MODE: Write a peakset out to a file:
dba.peakset(DBA, peaks, bRetrieve=T, writeFile, numCols)
DBA object when adding a peakset.
Peakset matrix or GRanges
object when retrieving and/or writing a peakset.
Rory Stark
to add peaksets using a sample sheet, see dba
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | # create a new DBA object by adding three peaksets
mcf7 <- dba.peakset(NULL,
peaks=system.file("extra/peaks/MCF7_ER_1.bed.gz", package="DiffBind"),
peak.caller="bed", sampID="MCF7.1",tissue="MCF7",
factor="ER",condition="Responsive",replicate=1)
mcf7 <- dba.peakset(mcf7,
peaks=system.file("extra/peaks/MCF7_ER_2.bed.gz", package="DiffBind"),
peak.caller="bed", sampID="MCF7.2",tissue="MCF7",
factor="ER",condition="Responsive",replicate=2)
mcf7 <- dba.peakset(mcf7,
peaks=system.file("extra/peaks/MCF7_ER_3.bed.gz", package="DiffBind"),
peak.caller="bed", sampID="MCF7.3",tissue="MCF7",
factor="ER",condition="Responsive",replicate=3)
mcf7
#retrieve peaks that are in all three peaksets
mcf7.consensus <- dba.peakset(mcf7, 1:3, minOverlap=3, bRetrieve=TRUE)
mcf7.consensus
#add a consensus peakset -- peaks in all three replicates
mcf7 <- dba.peakset(mcf7, 1:3, minOverlap=3,sampID="MCF7_3of3")
mcf7
#add consensus peaksets for all sample types by combining replicates
data(tamoxifen_peaks)
tamoxifen <- dba.peakset(tamoxifen,consensus = -DBA_REPLICATE)
dba.show(tamoxifen,mask=tamoxifen$masks$Consensus)
#add consensus peaksets for all sample types by (same tissue and condition)
data(tamoxifen_peaks)
tamoxifen <- dba.peakset(tamoxifen,consensus = c(DBA_TISSUE,DBA_CONDITION))
dba.show(tamoxifen,mask=tamoxifen$masks$Consensus)
dba.plotVenn(tamoxifen,tamoxifen$masks$Responsive & tamoxifen$masks$Consensus)
#create consensus peaksets from sample type consensuses for Responsive and Resistant sample groups
tamoxifen <- dba.peakset(tamoxifen,peaks=tamoxifen$masks$Consensus,consensus=DBA_CONDITION)
dba.show(tamoxifen,mask=tamoxifen$masks$Consensus)
dba.plotVenn(tamoxifen,17:18)
#retrieve the consensus peakset as GRanges object
mcf7.consensus <- dba.peakset(mcf7,mcf7$masks$Consensus,bRetrieve=TRUE)
mcf7.consensus
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.