You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Rfunctions.R
+3-7Lines changed: 3 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -17,15 +17,11 @@ source(here("R/pcaplot2.R"))
17
17
# A function to draw volcano plots
18
18
source(here("R/volcanoplot2.R"))
19
19
20
-
# ----- pieAnno2 ----- #
21
-
# pieAnno2 -> A function to draw pie charts with the peaks divided by promoter and distal (all non promoter).
22
-
# filterAnno2 -> A function that takes the output of Annotate peak and changes the features to promoter or distal.
23
-
source(here("R/pieAnno2.R"))
24
20
25
21
# ----- pieAnno3 ----- #
26
-
#pieAnno3 -> A function to draw pie charts with the peaks divided by promoter, gene body (UTRs, introns, exons) and distal (distal intergeninc, downstream).
27
-
#filterAnno3 -> A function that takes the output of Annotate peak and changes the features to promoter or distal.
28
-
source(here("R/pieAnno3.R"))
22
+
#pieAnno -> A function to draw pie charts with the peaks divided by promoter, gene body (UTRs, introns, exons) and distal (distal intergeninc, downstream).
23
+
#filterAnno -> A function that takes the output of Annotate peak and changes the features to promoter or distal.
24
+
source(here("R/pieAnno.R"))
29
25
30
26
# ----- barAnno ----- #
31
27
# barAnno -> a function to draw barplots from a list of annotatePeak objects. Can divide peaks in promoter/distal or promoter/gene body/distal
#' It must be used after the function annotatePeak() from the R package ChIPseeker. @seealso \code{\link{annotatePeak}}
12
12
#'
13
13
#' It takes a list of annotation objects that come as output of annotatePeak() and changes the features to "Promoter", "Distal" and "Gene body" (or to "Promoter" and "Distal"). Finally it plots a bargraph with the distribution of all the proportions
14
14
#' As a ggplot2-based function, it allows to add more layers to format the plot.
15
15
#'
16
-
#' @param anno_list List of annotation objects that come from annotatePeak().
16
+
#' @param anno_list List of annotation objects that come from annotatePeak(). If anno_df is specified, anno_list must be null, otherwise must be specified.
17
17
#' @param names Charachter vector of the same length as 'anno_list'. Names that will be given to each of the objects in anno_list. Not that will be the names plotted in the bargraph
18
-
#' @param names_order Character vector with the same entries as 'names' with the order wanted to plot the data.
19
-
#' @param protein Character vector of the same length as 'anno_list' with the protein chipped in each dataframe of anno_list. This names will be passed through `facet_wrap()`. Only works if is_chip is set to TRUE. Default: NULL.
18
+
#' @param names_order Character vector with the same entries as 'names' with the order wanted to plot the data (optional).
19
+
#' @param protein Character vector of the same length as 'anno_list' with the protein chipped in each dataframe of anno_list. This names will be passed through `facet_wrap()`. Only works if facet is set to TRUE. Default: NULL.
20
20
#' @param main Character of lenght 1. Title of the plot. Default: NULL.
21
21
#' @param subtitle Character of lenght 1. Subtitle of the plot. Default: NULL.
22
22
#' @param ylab Character of lenght 1. Title of the Y axis. Default: NULL.
23
23
#' @param xlab Character of lenght 1. Title of the X axis. Default: NULL
24
24
#' @param palette Character of lenght 1. Color palette used to color the bars through the function `scale_fill_brewer()`. Default: "Set1".
25
25
#' @param legend_position Character of lenght 1. Position of the legend. One of c("none", "bottom", "right", "left," "top"). Default: "right"
26
26
#' @param is_anno Logical. If TRUE, takes the 'anno_list' as a list of annotation objects from annotatePeak. If FALSE, takes 'anno_list' as a list of `annotatePeak()` output that have already been formatted to data.frame (i.e. read from file)... this is done because of the behaviour of our snakemake pipeline.
27
-
#' @param is_chip Logical. If TRUE, it means that the input data comes from a ChiP experiment, which will separate the plot by proteins. It can be set to FALSE even if data comes from ChIPseq, but remember that if you want to separate proteins, the names of each protein group must be different. It can be also set to TRUE if data comes from ATACseq, then in 'protein' you can write the desired grouping variable. Default: FALSE.
27
+
#' @param facet Logical. If TRUE, the plot will be separated by the groups set in proteins. It can be set to FALSE even if data comes from ChIPseq, but remember that if you want to separate proteins, the names of each protein group must be different. It can be also set to TRUE if data comes from ATACseq, then in 'protein' you can write the desired grouping variable. Default: FALSE.
28
28
#' @param anno_num Integer number. Number of annotations to plot, either 2 (Promoter/Distal) or 3 (Promoter/Gene body/Distal). Default: 3.
29
29
#' @param position_fill Logical. If TRUE (default), it the plotted bars will represent proportion of peaks in each feature. If FALSE, the bars will have the height of the total number of peaks with the correspondent feature color.
30
+
#' @param plotly Logical. If TRUE, the ggplot object will be passed to 'ggplotlify()' to transform it to an interactive plotly graph.
message1<-"If 'facet' is TRUE, the argument 'protein' must be specified."
52
+
message2<-"The argument 'protein' must be a character vector of the same length as 'names', such as the proteins chipped in each sample or other grouping variables passed to 'facet_wrap()'"
0 commit comments