# NOT RUN {
v1 <- c("RCOR1", "NCOR1", "LCOR", "RCOR1", "RCOR1", "RCOR1", "RCOR1")
v2 <- c("sampleA", "sampleC", "sampleB", "sampleC", "sampleA", "sampleC", "sampleC")
v3 <- c("Deletion", "Deletion", "SNV", "Rearrangement", "SNV", "Rearrangement", "SNV")
v4 <- c(0.05, 0.5, 0.25, 0.01, 0.03, 0.24, 0.89)
v5 <- c(1, 2, 1, 1, 2, 2, 1)
feature.order <- c("RCOR1", "NCOR1", "LCOR")
sample.id.order <- c("sampleA", "sampleB", "sampleC")
in.df <- dplyr::data_frame(feature = v1, sampleID = v2, type = v3,
p_value = -log10(v4), dir_flag = v5)
fill.colors <- c("Deletion" = "Blue", "Rearrangement" = "Green", "SNV" = "Red")
plot_cofeature_mat(in.df)
# With black tile color
plot_cofeature_mat(in.df, tile.col = "black")
# Fill in missing values with a lightgrey color
plot_cofeature_mat(in.df, tile.col = "black", missing.fill.col = "lightgrey")
# Rotate x-axes labels by 90 degrees
plot_cofeature_mat(in.df, rotate.x.labels = 90)
# Specify order of features, samples, and colors
plot_cofeature_mat(in.df, feature.order, sample.id.order,
fill.colors = fill.colors)
# Specify each cell can only have one "feature type"
plot_cofeature_mat(in.df, feature.order, sample.id.order, fill.colors = fill.colors,
type.display.mode = "single")
# Specify the specific priority of the "feature type" for cells with
# multiple features
plot_cofeature_mat(in.df, feature.order, sample.id.order, fill.colors = fill.colors,
type.display.mode = "single", type.order = c("Rearrangement", "SNV", "Deletion"))
# Add dots to tiles for an additional layer of information
plot_cofeature_mat(in.df, dot.size = "p_value")
# Only display dots
plot_cofeature_mat(in.df, dot.flag = TRUE, dot.size = "p_value",
tile.flag = FALSE)
# Samples will not be dropped
sample.id.order.new <- c("sampleA", "sampleB", "sampleC", "sampleD")
plot_cofeature_mat(in.df, tile.col = "black",
sample.id.order = sample.id.order.new)
# Samples can be dropped by setting drop.x = TRUE
plot_cofeature_mat(in.df, tile.col = "black",
sample.id.order = sample.id.order.new, drop.x = TRUE)
# }
Run the code above in your browser using DataLab