circos_plot: Create a Circos plot with up to 3 tracks

Description Usage Arguments Examples

View source: R/circos_plot.R

Description

Create a Circos plot with up to 3 tracks

Usage

 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
circos_plot(
  track_number,
  track1_data,
  track2_data,
  track3_data,
  track1_type,
  track2_type,
  track3_type,
  label_column,
  section_column,
  order = TRUE,
  order_column,
  estimate_column,
  pvalue_column,
  pvalue_adjustment,
  lower_ci,
  upper_ci,
  lines_column,
  lines_type = "o",
  bar_column,
  histogram_column,
  histogram_binsize = 0.01,
  histogram_densityplot = FALSE,
  legend = FALSE,
  track1_label = NA,
  track2_label = NA,
  track3_label = NA,
  pvalue_label = NA,
  circle_size = 25,
  track1_height = 0.2,
  track2_height = 0.2,
  track3_height = 0.2
)

Arguments

track_number

The number of tracks you wnat your circos plot to have. Maximum number of tracks is 3.

track1_data

The data frame of your first track.

track2_data

The data frame of your second track.

track3_data

The data frame of your third track.

track1_type

The type of plot for the first track. One of "scatter", "lines", "bar" and "histogram".

track2_type

The type of plot for the second track. One of "scatter", "lines", "bar" and "histogram".

track3_type

The type of plot for the third track. One of "scatter", "lines", "bar" and "histogram".

label_column

The column in your data frames that you will use as the labels for the circos plot. This will likely be the column with your exposure/outcome name in. Labels go on the outside of the plot.

section_column

The column in your data frames that you will use to group/section your data/plot by.

order

Do you want MR Viz to organise your columns alphabetically. Default is TRUE

order_column

If order = FALSE what column do you want to order your sections by

estimate_column

The column in your data frames with the estimates in.

pvalue_column

The column in your data frames with the p-values in.

pvalue_adjustment

The threshold you want to set your p-value 'significance' threshold too. This can be in the format of a single value or a function e.g. 0.05/22. The p-value thrshold is only used for scatter plots.

lower_ci

The column in your data frames with the lower confidence intervals in.

upper_ci

The column in your data frames with the upper confidence intervals in.

lines_column

The column in your data frames that you want to plot as lines.

lines_type

The type of line plot you want. "l" = straight lines; "o" = straight lines with points; "s" = boxed lines; "h" = vertical lines. Default is "o".

bar_column

The column in your data frames that you want to plot as bars.

histogram_column

The column in your data frames that you want to plot as histograms.

histogram_binsize

The binsize of the histogram. Default is 0.01.

histogram_densityplot

Do you want your histogram to be a density plot or not. Default is FALSE.

legend

Do you want a legend = TRUE or FALSE. FALSE by default

track1_label

What do you want the label for the first track to be e.g. "Body Mass Index"

track2_label

What do you want the label for the first track to be e.g. "Corondary Heart Disease"

track3_label

What do you want the label for the first track to be e.g. "Breast Cancer"

pvalue_label

What do you want the label for the p-value to read e.g. "p-value <= 0.05"

circle_size

The size of the circos plot. Smaller numbers make larger circos plots. Default is 25. You will need to adjust this number a few times to get the perfect size for your specific circos plot requirements. If you have long labels then try ≥ 25. If your labels are short try 1-10.

track1_height

Size of the track as a percent of the whole circle. Default is 20 percent (0.20)

track2_height

Size of the track as a percent of the whole circle. Default is 20 percent (0.20)

track3_height

Size of the track as a percent of the whole circle. Default is 20 percent (0.20). It is sometimes worth increasing the size of track 3 to 30 percent

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
circos_plot(track_number = 3,
track1_data = EpiCircos_data,
track2_data = EpiCircos_data,
track3_data = EpiCircos_data,
track1_type = "points",
track2_type = "lines",
track3_type = "bar",
label_column = 1,
section_column = 2,
estimate_column = 4,
pvalue_column = 5,
pvalue_adjustment = 0.05,
lower_ci = 7,
upper_ci = 8,
lines_column = 4,
lines_type = "o",
bar_column = 4,
histogram_column = 4,
histogram_binsize = 0.01,
histogram_densityplot = F,
legend = FALSE,
circle_size = 25)

mattlee821/EpiCircos documentation built on Jan. 6, 2020, 7:13 a.m.