-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontacts.R
66 lines (64 loc) · 2.24 KB
/
contacts.R
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
################################################################################
# #
# CONSTRUCTORS #
# #
################################################################################
#' @title Contacts
#'
#' @rdname Contacts
#'
#' @description
#'
#' This function has been deprecated in favor of the generic `HiCExperiment()`
#' constructor (from HiCExperiment package).
#'
#' @param file Path to a (m)cool file
#' @param resolution Resolution to use with mcool file
#' @param focus focus Chr. coordinates for which
#' interaction counts are extracted from the .(m)cool file, provided
#' as a character string (e.g. "II:4001-5000"). If not provided,
#' the entire (m)cool file will be imported.
#' @param metadata list of metadata
#' @param topologicalFeatures topologicalFeatures provided as a named SimpleList
#' @param pairsFile Path to an associated .pairs file
#' @return a new `HiCExperiment` object.
#'
#' @import HiCExperiment
#' @export
#' @examples
#' library(HiContacts)
#' library(HiContactsData)
#' mcool_path <- HiContactsData::HiContactsData('yeast_wt', 'mcool')
#' Contacts(mcool_path, resolution = 1000)
Contacts <- function(
file,
resolution = NULL,
focus = NULL,
metadata = list(),
topologicalFeatures = S4Vectors::SimpleList(
'loops' = S4Vectors::Pairs(
GenomicRanges::GRanges(),
GenomicRanges::GRanges()
),
'borders' = GenomicRanges::GRanges(),
'compartments' = GenomicRanges::GRanges(),
'viewpoints' = GenomicRanges::GRanges()
),
pairsFile = NULL
) {
.Deprecated(
"HiCExperiment::HiCExperiment",
msg = paste(
"`HiContacts::Contacts` is deprecated;",
"see '?HiCExperiment::HiCExperiment' constructor instead."
)
)
HiCExperiment::HiCExperiment(
file = file,
resolution = resolution,
focus = focus,
metadata = metadata,
topologicalFeatures = topologicalFeatures,
pairsFile = pairsFile
)
}