Title: | An implementation of Circos plots for epidemiologists |
---|---|
Description: | An implementation of Circos plots for epidemiologists in R. It takes the Circlize package and adapts it for use by epidemiologists. Circos plots provide an informative way of plotting greater than 50 plotting points. A legend can be plotted automatically and customised. |
Authors: | person("Matthew", "Lee", email = "[email protected]", role = c("aut", "cre")) |
Maintainer: | The package maintainer <[email protected]> |
License: | CC0 |
Version: | 0.0.1 |
Built: | 2024-11-13 04:59:07 UTC |
Source: | https://github.com/mattlee821/EpiViz |
Create a Circos plot with up to 3 tracks using points, lines or bars
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, pvalue_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, equal_axis = FALSE, origin = 0, colours = c("#00378f", "#ffc067", "#894300") )
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, pvalue_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, equal_axis = FALSE, origin = 0, colours = c("#00378f", "#ffc067", "#894300") )
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 |
pvalue_legend |
Do you want a p-value legend icon (defalut = FALSE) |
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 |
equal_axis |
Do you want your tracks to share the same axis (Defalut = FALSE), if TRUE it will use the minimmum and maximum from the upper and lower confidence intervals to calculate the axis for each track. This ONLY applies to 'points' all other plot types are independent of each track. |
origin |
Where do you want your X axis line drawn, e.g. 0 for continuous outcomes and 1 for binary outcomes when using beta and odds ratios respectively. Default is 0 |
colours |
list of colours for each track. Use "". |
circos_plot(track_number = 3, track1_data = EpiViz_data1, track2_data = EpiViz_data2, track3_data = EpiViz_data3, track1_type = "points", track2_type = "lines", track3_type = "bar", label_column = 1, section_column = 9, estimate_column = 2, pvalue_column = 3, pvalue_adjustment = 1, lower_ci = 4, upper_ci = 5, lines_column = 2, lines_type = "o", bar_column = 2, legend = FALSE, pvalue_legend = FALSE, circle_size = 25)
circos_plot(track_number = 3, track1_data = EpiViz_data1, track2_data = EpiViz_data2, track3_data = EpiViz_data3, track1_type = "points", track2_type = "lines", track3_type = "bar", label_column = 1, section_column = 9, estimate_column = 2, pvalue_column = 3, pvalue_adjustment = 1, lower_ci = 4, upper_ci = 5, lines_column = 2, lines_type = "o", bar_column = 2, legend = FALSE, pvalue_legend = FALSE, circle_size = 25)
A simulated dataset of linear regression results for 123 outcomes.
EpiViz_data1
EpiViz_data1
A simulated data frame with 123 rows and 8 variables imitating a traditional epidemiology results file from a linear regression:
The name of the outcomes
Effect estimates
Pvalues of the effec estimates and standard errors
Lower confidence interval bound
Upper confidence interval bound
The exposure used in the Mendelian randomization alaysis
The name of the outcomes with units
The groups which the outcomes can be put into
The subgroups which the outcomes can be put into
...
A simulated dataset of linear regression results for 123 outcomes.
EpiViz_data2
EpiViz_data2
A simulated data frame with 123 rows and 8 variables imitating a traditional epidemiology results file from a linear regression:
The name of the outcomes
Effect estimates
Pvalues of the effec estimates and standard errors
Lower confidence interval bound
Upper confidence interval bound
The exposure used in the Mendelian randomization alaysis
The name of the outcomes with units
The groups which the outcomes can be put into
The subgroups which the outcomes can be put into
...
A simulated dataset of linear regression results for 123 outcomes.
EpiViz_data3
EpiViz_data3
A simulated data frame with 123 rows and 8 variables imitating a traditional epidemiology results file from a linear regression:
The name of the outcomes
Effect estimates
Pvalues of the effec estimates and standard errors
Lower confidence interval bound
Upper confidence interval bound
The exposure used in the Mendelian randomization alaysis
The name of the outcomes with units
The groups which the outcomes can be put into
The subgroups which the outcomes can be put into
...