gcap.plotCircos: Plot Circos

View source: R/circos.R

gcap.plotCircosR Documentation

Plot Circos

Description

Plot Circos

Usage

gcap.plotCircos(
  fCNA,
  highlights = NULL,
  total_n = NULL,
  clust_distance = 1e+07,
  col = c("#FF000080", "#0000FF80"),
  genome_build = c("hg38", "hg19"),
  chrs = paste0("chr", 1:22),
  ideogram_height = 1,
  only = c(NA_character_, "circular", "noncircular"),
  ...
)

Arguments

fCNA

a fCNA object.

highlights

gene/cytoband list to highlight.

total_n

if not NULL, this is used for calculating percentage.

clust_distance

a distance as cutoff for different clusters. Default is 1e7, i.e. 10Mb. Note 100 Mb is set to genes on different chromosomes, so please don't set value larger than that.

col

length-2 colors for circular and noncircular.

genome_build

genome version.

chrs

chromosome names.

ideogram_height

ideogram height at default.

only

if not NA, only shows a type of amplicon.

...

other parameters passing to ggrepel::geom_label_repel().

Value

Nothing.

Examples


library(gcap)
if (require("circlize") && require("scales")) {
  data("ascn")
  data = ascn

  # Create fake data
  set.seed(1234)
  data$sample = sample(LETTERS[1:10], nrow(data), replace = TRUE)
  rv = gcap.ASCNworkflow(data, outdir = tempdir(), model = "XGB11")

  gcap.plotCircos(rv)

  # Select genes to highlight in plot
  r1 = rv$getGeneSummary()
  gcap.plotCircos(rv, r1[circular == 1]$gene_id[1:10])

  gcap.plotCircos(rv, rv$data[, .(label = .N), by = .(band)][1:10])
  gcap.plotCircos(
    rv,
    rv$data[, .(label = .N, cluster = gsub("(.*):.*", "\\1", band)),
      by = .(band)
    ][1:10]
  )
}


ShixiangWang/gcaputils documentation built on Feb. 14, 2023, 5:58 a.m.