NOTE: this class has been deprecated in favour of the InteractionSet class from the InteractionSet package. Users should use InteractionSet objects for future work. Existing DIList objects can be converted into InteractionSet objects using the DI2IS function.
DIList(counts, totals=colSums(counts), anchors, targets, regions, exptData=List(), ...)
:
Returns a DIList object where each entry is used to fill the corresponding slots.
Type coercion is performed as required.
Arguments in ...
are used as columns in colData
.
x
is a DIList object. anchors(x, id=FALSE)
:
Get the GRanges
corresponding to the anchor intervals for each interaction.
If id=TRUE
, indices to the corresponding intervals in regions
are returned instead.
targets(x, id=FALSE)
:
Get the GRanges
corresponding to the target intervals for each interaction.
If id=TRUE
, indices to the corresponding intervals in regions
are returned instead.
regions(x)
:
Get the GRanges
for all interacting regions.
counts(x)
:
Get the matrix of counts for all interactions in all libraries.
colData(x)
:
Get the DataFrame
of library-specific information.
exptData(x)
:
Get the List
of experiment-specific information.
x$name
:
Get the value of colData(x)$name
.
dim(x)
:
Get the dimensions, i.e., number of interactions (rows) against number of libraries (columns).
dimnames(x)
:
Get the dimension names. This returns a list of length 2, where each element is NULL
or a character vector.
x
is a DIList object. x$name <- value
:
Assign value
to the name
field of the colData
in x
.
Primarily intended for modification of the library sizes in totals
, but can also be used to store additional library-specific information.
exptData(x) <- value
:
Assign a SimpleList
object named value
to the exptData
slot of x
.
Note that this also works with list accessors, e.g., by assigning to exptData(x)$name
.
x
is a DIList object. x[i, j]
:
Get count and coordinate data for all interactions i
in libraries j
.
Either i
or j
can be missing, in which case all interactions or libraries are returned, respectively.
c(x, ..., add.totals=TRUE)
:
Merge x
with other DIList
objects in ...
, by concatenating the count matrices along with the anchor and target indices.
By default, the totals will be added across all objects to be merged.
This can be turned off by setting add.totals=FALSE
, whereby only the totals of x
are used (a warning will be generated if totals are not identical between objects).
In all cases, objects to be merged should have the same value in the regions
slot.
x
is a DIList object.
show(x)
:
Shows a summary of the information in x
.
Specifically, a string is printed that reports the number of libraries, number of interactions and total number of regions in x
.
as.matrix(x, first=NULL, second=first, fill=NULL, ...)
:
Converts x
into a contact matrix where rows and columns represent regions on the first
and second
chromosomes, respectively.
Entries of the matrix correspond to an interaction of x
.
Each entry is extracted from fill
, where fill
is a numeric vector with one value per interaction in x
.
By default, the average abundance of each interaction in x
is used as the entry.
For intra-chromosomal spaces, both sides of the diagonal are filled.
Multiple chromosomes can also be specified in first
or second
(all chromosomes are used by default).
Each row and column is named according to the matching index of regions(x)
.
counts
:colData
:DataFrame
object containing library-specific information in each row, e.g., the total number of read pairsexptData
:List
object containing data or parameters pertinent to countinganchors
:targets
:regions
:GRanges
object containing the coordinates of all interacting regionsEach row of counts
corresponds to an interaction, while each column corresponds to a library.
Each interaction is parameterized by an anchors
and targets
index, pointing to the anchor and target intervals in regions
, respectively.
The anchor interval is defined as that with the higher genomic start coordinate, compared to that of the target interval.
This means that anchors
is never less than targets
to avoid redundant permutations.