restrand_nmatlist | R Documentation |
Re-strand coverage matrix data by inferred strandedness
restrand_nmatlist(
nmatlist,
restrand_heatmap = 1,
restrand_range = NULL,
restrand_buffer = NULL,
restrand_invert = FALSE,
empty_value = 0,
transform = NULL,
verbose = FALSE,
...
)
nmatlist |
|
restrand_heatmap |
|
restrand_range |
|
restrand_buffer |
|
restrand_invert |
|
empty_value |
|
transform |
|
verbose |
|
... |
additional arguments are ignored. |
Coverage matrix data is provided as nmatlist
which is a
list
of normalizedMatrix
objects (see EnrichmentHeatmap
).
One or more restrand_heatmap
are defined, and the side with
higher coverage "wins" such that the downstream signal is
always higher within the specified range.
object in format nmatlist
, a list
of normalizedMatrix
objects.
Other jam coverage heatmap functions:
coverage_matrix2nmat()
,
get_nmat_ceiling()
,
nmathm_row_order()
,
nmatlist2heatmaps()
,
recenter_nmatlist()
,
validate_heatmap_params()
,
zoom_nmatlist()
,
zoom_nmat()
cov_file1 <- system.file("data", "tss_coverage.matrix", package="platjam");
cov_file2 <- system.file("data", "h3k4me1_coverage.matrix", package="platjam");
cov_files <- c(cov_file1, cov_file2);
names(cov_files) <- gsub("[.]matrix",
"",
basename(cov_files));
nmatlist <- coverage_matrix2nmat(cov_files, verbose=FALSE);
# scramble the strandedness
new_k <- sample(c(TRUE, FALSE), size=nrow(nmatlist[[1]]), replace=TRUE)
nmatlist1 <- lapply(nmatlist, function(nmat){
nmat[new_k, ] <- nmat[new_k, rev(colnames(nmat)), drop=FALSE]
nmat;
})
nmatlist2heatmaps(nmatlist1,
title="Test data\n(mixed strandedness)",
transform=c("log2signed", "sqrt"));
nmatlist2heatmaps(nmatlist1,
title="Test data,\nrestranded by TSS",
restrand_heatmap=1,
transform=c("log2signed", "sqrt"));
nmatlist2heatmaps(nmatlist1,
title="Test data,\nrecentered by H3K4me1",
recenter_heatmap=2, recenter_invert=TRUE,
transform=c("log2signed", "sqrt"));
nmatlist2heatmaps(nmatlist1,
title="Test data, recentered by H3K4me1,\nrestranded by TSS",
recenter_heatmap=2, recenter_invert=TRUE,
restrand_heatmap=1,
transform=c("log2signed", "sqrt"));
nmatlist_c <- restrand_nmatlist(nmatlist, restrand_invert=FALSE,
transform=c("log2signed"), restrand_heatmap=1,
restrand_range=600, restrand_buffer=100)
nmhm <- nmatlist2heatmaps(nmatlist_c,
title="Re-stranded using tss signal",
transform=c("log2signed", "sqrt"));
k_clusters=8, k_method="euclidean", min_rows_per_k=10, k_heatmap=1,
nmatlist2i <- recenter_nmatlist(nmatlist, recenter_heatmap=1, recenter_range=1000, restrand_invert=TRUE)
nmatlist2heatmaps(nmatlist2i,
title="Test data, centered on inverted tss signal",
transform=c("log2signed", "sqrt"));
nmatlist2 <- recenter_nmatlist(nmatlist, recenter_heatmap=1, recenter_range=1000)
nmatlist2heatmaps(nmatlist2,
title="Test data, centered on tss signal",
transform=c("log2signed", "sqrt"));
nmatlist4 <- restrand_nmatlist(nmatlist2, restrand_invert=FALSE,
transform=c("log2signed"), restrand_heatmap=1,
restrand_range=600, restrand_buffer=100)
nmhm <- nmatlist2heatmaps(nmatlist4,
title="Test data, centered on tss signal\nRe-stranded on tss signal",
transform=c("log2signed", "sqrt"));
#k_clusters=8, k_method="euclidean", min_rows_per_k=10, k_heatmap=1,
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.