| Title: | HiCaptuRe: Manipulating and integrating Capture Hi-C data |
|---|---|
| Description: | Capture Hi-C is a set of techniques that enable the detection of genomic interactions involving regions of interest, known as baits. By focusing on selected loci, these approaches reduce sequencing costs while maintaining high resolution at the level of restriction fragments. HiCaptuRe provides tools to import, annotate, manipulate, and export Capture Hi-C data. The package accounts for the specific structure of bait–otherEnd interactions, facilitates integration with other omics datasets, and enables comparison across samples and conditions. |
| Authors: | Laureano Tomas-Daza [aut, cre] (ORCID: <https://orcid.org/0000-0002-6127-1694>) |
| Maintainer: | Laureano Tomas-Daza <[email protected]> |
| License: | GPL-3 |
| Version: | 1.3.0 |
| Built: | 2026-05-30 08:08:55 UTC |
| Source: | https://github.com/bioc/HiCaptuRe |
This function annotate a HiCaptuRe object from load_interactions, based on a given annotations file
annotate_interactions(interactions, annotation, ...)annotate_interactions(interactions, annotation, ...)
interactions |
HiCaptuRe object from |
annotation |
full path to annotations file or a dataframe with 5 columns: chr, start, end, fragmentID, annotation |
... |
additional parameters for fread |
HiCaptuRe object annotated, with columns bait_1 and bait_2 substituted based on the given annotation
annotation <- system.file("extdata", "annotation_example.txt", package = "HiCaptuRe") ibed1 <- system.file("extdata", "ibed1_example.zip", package = "HiCaptuRe") interactions <- load_interactions(ibed1, select_chr = "19") interactions <- annotate_interactions(interactions = interactions, annotation = annotation)annotation <- system.file("extdata", "annotation_example.txt", package = "HiCaptuRe") ibed1 <- system.file("extdata", "ibed1_example.zip", package = "HiCaptuRe") interactions <- load_interactions(ibed1, select_chr = "19") interactions <- annotate_interactions(interactions = interactions, annotation = annotation)
This function takes a genome installed and generates its digest for a given restriction enzyme
digest_genome( genome = "GRCh38", RE_name = "HindIII", motif = NULL, cut_position = NULL, select_chr = c(seq_len(22), "X", "Y"), PAR_mask = TRUE, PAR_file = NULL, ... )digest_genome( genome = "GRCh38", RE_name = "HindIII", motif = NULL, cut_position = NULL, select_chr = c(seq_len(22), "X", "Y"), PAR_mask = TRUE, PAR_file = NULL, ... )
genome |
character with the name of the genome version |
RE_name |
name of the restriction enzyme |
motif |
recognition motif of the restriction enzyme |
cut_position |
cut position of the restriction enzyme inside the motif |
select_chr |
a character vector containing the specific chromosomes to used from this genome, if NULL all chromosomes will be used |
PAR_mask |
a logical value where the Y chromosome should exclude the Pseudoautosomical Regions (PAR) or not |
PAR_file |
a full path to a file containing the coordinates of Y chromosome PAR with at least 3 columns with header: seqnames, start, end |
... |
extra arguments for read.table |
list object with 2 elements: a dataframe with the digested genome, and a the parameters used for the digestion.
The package provides for a PAR coordinates file only for Homo sapiens for the genome version 38
The package provides the motives and cut positions for several restriction enzymes (HindIII, MboI, DpnII, EcoRI, BamHI)
digest <- digest_genome(genome = "GRCh38", RE_name = "HindIII", select_chr = "19")digest <- digest_genome(genome = "GRCh38", RE_name = "HindIII", select_chr = "19")
This function computes the number of interactions by distance for a given GenomicInteractions object
distance_summary(interactions, breaks = seq(0, 10^6, 10^5), sample = "sample")distance_summary(interactions, breaks = seq(0, 10^6, 10^5), sample = "sample")
interactions |
GenomicInteractions object from |
breaks |
vector with breaks for split distances |
sample |
character variable with the name of the sample |
list with 2 tables: short_int_dist_table and long_int_dist_table, with the number of short interactions and long interactions respectively
ibed1 <- system.file("extdata", "ibed1_example.zip", package = "HiCaptuRe") interactions1 <- load_interactions(ibed1, select_chr = "19") df <- distance_summary(interactions = interactions1)ibed1 <- system.file("extdata", "ibed1_example.zip", package = "HiCaptuRe") interactions1 <- load_interactions(ibed1, select_chr = "19") df <- distance_summary(interactions = interactions1)
This function exports interactions in different formats
export_interactions( interactions, file, format = "ibed", over.write = FALSE, cutoff = 5, parameters = FALSE )export_interactions( interactions, file, format = "ibed", over.write = FALSE, cutoff = 5, parameters = FALSE )
interactions |
GenomicInteractions object from |
file |
full path to desired output file (ibed, peakmatrix, washU, washUold, cytoscape, bedpe) |
format |
type of output format (ibed, peakmatrix, washU, washUold, cytoscape, bedpe, seqmonk) |
over.write |
TRUE/FALSE to over write the output file |
cutoff |
Chicago score cutoff to export interactions |
parameters |
TRUE/FALSE to also export the parameters of the given object |
tibble object with the ibed table and save it in the desired output file
ibed1 <- system.file("extdata", "ibed1_example.zip", package = "HiCaptuRe") interactions <- load_interactions(ibed1, select_chr = "19") export_interactions(interactions = interactions, file = tempfile(), format = "ibed", over.write = TRUE)ibed1 <- system.file("extdata", "ibed1_example.zip", package = "HiCaptuRe") interactions <- load_interactions(ibed1, select_chr = "19") export_interactions(interactions = interactions, file = tempfile(), format = "ibed", over.write = TRUE)
Use these functions to access data stored in each of the slots of a HiCapture object.
getParameters(x) ## S4 method for signature 'HiCaptuRe' getParameters(x) getByBaits(x) ## S4 method for signature 'HiCaptuRe' getByBaits(x) getByRegions(x) ## S4 method for signature 'HiCaptuRe' getByRegions(x)getParameters(x) ## S4 method for signature 'HiCaptuRe' getParameters(x) getByBaits(x) ## S4 method for signature 'HiCaptuRe' getByBaits(x) getByRegions(x) ## S4 method for signature 'HiCaptuRe' getByRegions(x)
x |
A HiCaptuRe object |
A named list of named vectors with all parameters used.
A list of tibbles with bait‑centric summaries.
A list of 'GRanges' with region‑centric summaries.
ibed1 <- system.file("extdata", "ibed1_example.zip", package = "HiCaptuRe") interactions <- load_interactions(ibed1, select_chr = "19") getParameters(interactions) baits <- c("ENST00000332235", "ENST00000516525") interactions_baits <- interactionsByBaits(interactions = interactions, baits = baits) getByBaits(interactions_baits) regions <- GenomicRanges::GRanges(seqnames = 19, ranges = IRanges::IRanges(start = c(500000, 1000000), end = c(510000, 1100000))) interactions_regions <- interactionsByRegions(interactions = interactions, regions = regions) getByRegions(interactions_regions)ibed1 <- system.file("extdata", "ibed1_example.zip", package = "HiCaptuRe") interactions <- load_interactions(ibed1, select_chr = "19") getParameters(interactions) baits <- c("ENST00000332235", "ENST00000516525") interactions_baits <- interactionsByBaits(interactions = interactions, baits = baits) getByBaits(interactions_baits) regions <- GenomicRanges::GRanges(seqnames = 19, ranges = IRanges::IRanges(start = c(500000, 1000000), end = c(510000, 1100000))) interactions_regions <- interactionsByRegions(interactions = interactions, regions = regions) getByRegions(interactions_regions)
A S4 class to represent interactions between genomic regions
parametersList of parameters used to create the object and subsequence analysis
ByBaitsList of Baits used by interactionsByBaits.
ByRegionsList of Regions used by interactionsByRegions
This class contains a GenomicInteractions object inside therefore all methods available to it can be used. This type of object should be created through the function load_interactions
This function filters a HiCaptuRe object from load_interactions by a set of given bait(s)
interactionsByBaits(interactions, baits, sep = ",", invert = FALSE)interactionsByBaits(interactions, baits, sep = ",", invert = FALSE)
interactions |
a HiCaptuRe object |
baits |
character vector containing bait names |
sep |
character separating baits names when several baits in same fragment |
invert |
TRUE/FALSE if need those interactions that do NOT contain the given baits |
The returned object includes a filtered set of interactions and updates the ByBaits slot with a tibble summarizing bait-wise interaction statistics (number of interactions, other ends, etc.). Baits that are not present in the interaction data will have empty statistics.
ibed1 <- system.file("extdata", "ibed1_example.zip", package = "HiCaptuRe") interactions <- load_interactions(ibed1, select_chr = "19") baits <- c("ENST00000332235", "ENST00000516525") interactions_baits <- interactionsByBaits(interactions = interactions, baits = baits)ibed1 <- system.file("extdata", "ibed1_example.zip", package = "HiCaptuRe") interactions <- load_interactions(ibed1, select_chr = "19") baits <- c("ENST00000332235", "ENST00000516525") interactions_baits <- interactionsByBaits(interactions = interactions, baits = baits)
This function filters a HiCaptuRe object from load_interactions by overlaping regions
interactionsByRegions( interactions, regions, chr = NULL, start = NULL, end = NULL, invert = FALSE )interactionsByRegions( interactions, regions, chr = NULL, start = NULL, end = NULL, invert = FALSE )
interactions |
HiCaptuRe object |
regions |
full path to regions file (bed format) or a GRanges object |
chr |
column name of chromosome values |
start |
column name of start positions |
end |
column name of end positions |
invert |
TRUE/FALSE if need those interactions that do NOT overlaps with any regions |
HiCaptuRe object filtered by regions, by default with additional columns regarding overlap on each node. If invert=T no additional columns. And an additional slot ByRegions with region-centric statistics
ibed1 <- system.file("extdata", "ibed1_example.zip", package = "HiCaptuRe") interactions <- load_interactions(ibed1, select_chr = "19") regions <- GenomicRanges::GRanges(seqnames = 19, ranges = IRanges::IRanges(start = c(500000, 1000000), end = c(510000, 1100000))) interactions_regions <- interactionsByRegions(interactions = interactions, regions = regions)ibed1 <- system.file("extdata", "ibed1_example.zip", package = "HiCaptuRe") interactions <- load_interactions(ibed1, select_chr = "19") regions <- GenomicRanges::GRanges(seqnames = 19, ranges = IRanges::IRanges(start = c(500000, 1000000), end = c(510000, 1100000))) interactions_regions <- interactionsByRegions(interactions = interactions, regions = regions)
This function computes all the possible intersects for a given list of HiCaptuRe objects
intersect_interactions(interactions_list, distance.boxplot = FALSE, ...)intersect_interactions(interactions_list, distance.boxplot = FALSE, ...)
interactions_list |
list of HiCaptuRe objects from |
distance.boxplot |
logical, by default FALSE, plot a boxplot of log10 distance of each intersection in the upset plot |
... |
extra arguments for UpSetR |
A list with:
A named list of intersected HiCaptuRe objects
An UpSetR plot
A ggVennDiagram plot (NULL if > 7 sets)
ibed1 <- system.file("extdata", "ibed1_example.zip", package = "HiCaptuRe") interactions1 <- load_interactions(ibed1, select_chr = "19") ibed2 <- system.file("extdata", "ibed2_example.zip", package = "HiCaptuRe") interactions2 <- load_interactions(ibed2, select_chr = "19") interactions_list <- list(ibed1 = interactions1, ibed2 = interactions2) intersection <- intersect_interactions(interactions_list = interactions_list)ibed1 <- system.file("extdata", "ibed1_example.zip", package = "HiCaptuRe") interactions1 <- load_interactions(ibed1, select_chr = "19") ibed2 <- system.file("extdata", "ibed2_example.zip", package = "HiCaptuRe") interactions2 <- load_interactions(ibed2, select_chr = "19") interactions_list <- list(ibed1 = interactions1, ibed2 = interactions2) intersection <- intersect_interactions(interactions_list = interactions_list)
This function loads interaction files from Chicago R package into a GenomicInteractions Object, and remove possible duplicated interactions
load_interactions(file, sep = "\t", ...)load_interactions(file, sep = "\t", ...)
file |
full path to the interaction file (seqmonk, ibed, washU) |
sep |
separator to read the file |
... |
arguments to pass to digest_genome |
HiCaptuRe object
ibed1 <- system.file("extdata", "ibed1_example.zip", package = "HiCaptuRe") interactions <- load_interactions(ibed1, select_chr = "19")ibed1 <- system.file("extdata", "ibed1_example.zip", package = "HiCaptuRe") interactions <- load_interactions(ibed1, select_chr = "19")
This function creates a list of HiCaptuRe objects separating all the samples included on a peakmatrix.
peakmatrix2list(peakmatrix, cutoff = 5)peakmatrix2list(peakmatrix, cutoff = 5)
peakmatrix |
HiCaptuRe object of a peakmatrix |
cutoff |
Chicago score cut-off to filter interactions |
A named list of HiCaptuRe objects, each corresponding to a sample (inferred from CS_* columns in the peakmatrix).
peakmatrix <- system.file("extdata", "peakmatrix_example.zip", package = "HiCaptuRe") interactions <- load_interactions(peakmatrix, select_chr = "19") interactions_list <- peakmatrix2list(peakmatrix = interactions)peakmatrix <- system.file("extdata", "peakmatrix_example.zip", package = "HiCaptuRe") interactions <- load_interactions(peakmatrix, select_chr = "19") interactions_list <- peakmatrix2list(peakmatrix = interactions)
This function plots the distances by different approaches for the output of distance_summary
plot_distance_summary(distances, type_of_value = "absolute")plot_distance_summary(distances, type_of_value = "absolute")
distances |
dataframes output from |
type_of_value |
an element from: absolute, by_int_type, by_total |
The type_of_value argument could be: Absolute: plots the Absolute number of interactions. By_int_type: plots the number of interactions divided by the total number of interactions of each type. By_total: plots the number of interactions divided by the total number of interactions
list with the plots
ibed1 <- system.file("extdata", "ibed1_example.zip", package = "HiCaptuRe") interactions1 <- load_interactions(ibed1, select_chr = "19") df <- distance_summary(interactions = interactions1) plots <- plot_distance_summary(distances = df)ibed1 <- system.file("extdata", "ibed1_example.zip", package = "HiCaptuRe") interactions1 <- load_interactions(ibed1, select_chr = "19") df <- distance_summary(interactions = interactions1) plots <- plot_distance_summary(distances = df)