Skip to content

Commit 45d22d7

Browse files
committed
update documentation
1 parent 68945cd commit 45d22d7

10 files changed

+131
-78
lines changed

R/helpers-prototypeList.R

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
#' Generates a list of graph prototypes for the different isomorphism classes and
1+
#' Generates a list of graph prototypes for the different isomorphism classes and their occurence.
22
#'
33
#'
4-
#' @param G graph
5-
#' @param sort_by_nr_edges logical, if TRUE, the list of prototypes is sorted by number of edges
4+
#' @param G \strong{igraph graph object} \cr
5+
#' A graph.
6+
#' @param sort_by_nr_edges \strong{logical} \cr
7+
#' If \code{TRUE}, the list of prototypes is sorted by number of edges.
68
#'
7-
#' @return list of prototype graphs plus count
9+
#' @return A list of prototype graphs plus their count.
810
#' @export
911
#'
1012
#' @examples
1113
#'
12-
#'
14+
1315
generatePrototypeList <- function(G, sort_by_nr_edges = FALSE) {
1416

1517

R/helpers-small_helper_functions.R

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
#' Geometric mean
1+
#' Calculate the geometric mean.
22
#'
3-
#' @param x vector with numbers
4-
#' @param useprod if TRUE, prod(x)^(1/n) will be calculated, otherwise exp(mean(log(x)))
3+
#' @param x \strong{numeric vector} \cr
4+
#' Input data.
5+
#' @param useprod \strong{logical} \cr
6+
#' If \code{TRUE}, prod(x)^(1/n) will be calculated, otherwise exp(mean(log(x))).
57
#'
6-
#' @return geometric mean of the provided data points
8+
#' @return The geometric mean of the provided data points.
79
#' @export
810
#'
9-
#' @examples # TODO
11+
#' @examples
12+
#' data <- c(1,6,3.5)
13+
#' result <- geom_mean(data, useprod = FALSE)
14+
1015
geom_mean <- function(x, useprod = FALSE) {
1116
n <- length(x)
1217

R/plotBipartiteGraph.R

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,39 @@
55

66
#' Plotting of bipartite peptide-protein graphs.
77
#'
8-
#' @param G A bipartite graph (igraph object).
9-
#' @param vertex.label.dist Distance of the label from center of the vertex (0 = centered in vertex).
10-
#' @param legend Add legend?
11-
#' @param vertex.color Colours for the different vertex types.
12-
#' @param vertex.size Size of vertices.
13-
#' @param vertex.label.cex Size of vertex labels.
14-
#' @param edge.width Width of the edges.
15-
#' @param vertex.size2 Vertex size 2.
16-
#' @param useCanonicalPermutation Convert the graph into the canonical permutation before plotting?
17-
#' @param three_shapes Use a separate shape for the unique peptides?
18-
#' @param ... Additional arguments for plot.igraph.
19-
#' @param node_labels_proteins "letters" or "acessions"
20-
#' @param node_labels_peptides "numbers" or "pep_ratios" or "pep_ratio_aggr"
21-
#' @param round_digits Number of digits to round the peptide ratios to.
22-
#' @param use_edge_attributes Use edge attributes for plotting (e.g. deleted edges will be dashed)?
23-
#' @param legend.x x-coordinate of the legend.
24-
#' @param legend.y y-coordinate of the legend.
8+
#' @param G \strong{igraph graph object} \cr
9+
#' A bipartite peptide-protein graph.
10+
#' @param vertex.label.dist \strong{numeric} \cr
11+
#' The distance of the label from center of the vertex (0 = centered in vertex).
12+
#' @param legend \strong{logical} \cr
13+
#' If \code{TRUE}, a legend will be added.
14+
#' @param vertex.color \strong{character vector} \cr
15+
#' The colours for the different vertex types.
16+
#' @param vertex.size \strong{numeric} \cr
17+
#' The size of vertices.
18+
#' @param vertex.label.cex \strong{numeric} \cr
19+
#' The size of vertex labels.
20+
#' @param edge.width \strong{numeric} \cr
21+
#' The width of the edges.
22+
#' @param vertex.size2 \strong{numeric} \cr
23+
#' The vertex size 2.
24+
#' @param useCanonicalPermutation \strong{logical} \cr
25+
#' If \code{TRUE}, the graph will be converted into the canonical permutation before plotting.
26+
#' @param three_shapes \strong{logical} \cr
27+
#' If \code{TRUE}, a separate shape will be used for the unique peptides.
28+
#' @param node_labels_proteins \strong{character} \cr
29+
#' The type of labels for the proteins. Options are "letters" or "acessions".
30+
#' @param node_labels_peptides \strong{character} \cr
31+
#' The type of labels for the peptides. Options are"numbers" or "pep_ratios" or "pep_ratio_aggr".
32+
#' @param round_digits \strong{integer} \cr
33+
#' The number of digits to round the peptide ratios to.
34+
#' @param use_edge_attributes \strong{logical} \cr
35+
#' If \code{TRUE}, edge attributes will be used for plotting (e.g. deleted edges will be dashed)
36+
#' @param legend.x \strong{numeric or character} \cr
37+
#' The x-coordinate of the legend or a keyword for the position. See [graphics::legend()] for details.
38+
#' @param legend.y \strong{numeric or character} \cr
39+
#' The y-coordinate of the legend or a keyword for the position. See [graphics::legend()] for details.
40+
#' @param ... Additional arguments for plot.igraph.
2541
#'
2642
#' @return Plot of one bipartite graph.
2743
#' @export
@@ -30,6 +46,7 @@
3046
#' biadjacency_matrix <- matrix(c(1,1,1,0), nrow = 2)
3147
#' G <- igraph::graph_from_biadjacency_matrix(biadjacency_matrix)
3248
#' #plotBipartiteGraph(G, three_shapes = TRUE, useCanonicalPermutation = TRUE)
49+
3350
plotBipartiteGraph <- function(G, vertex.label.dist = 0, legend = TRUE,
3451
vertex.color = c("mediumseagreen", "cadetblue2", "coral1"),
3552
vertex.size = 15, vertex.label.cex = 1, edge.width = 1, vertex.size2=15,

R/tables-subgraph_characteristics.R

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1-
21
#' Generates a table with characteristics for each subgraph in a list.
32
#'
4-
#' @param S list of subgraphs, where peptide and protein nodes are collapsed
5-
#' @param fastalevel Are the subgraphs on fasta level?
6-
#' @param prototype Are the subgraphs part of a prototype list?
7-
#' @param file where to save the table.
3+
#' @param S \strong{list of igraph graph objects} \cr
4+
#' A list of subgraphs, where peptide and protein nodes are collapsed.
5+
#' @param fastalevel \strong{logical} \cr
6+
#' If \code{TRUE}, the subgraphs should be on fasta level
7+
#' @param prototype \strong{logical} \cr
8+
#' If \code{TRUE}, the subgraphs should be part of a prototype list
9+
#' @param file \strong{character} \cr
10+
#' A file path where to save the table.
811
#'
912
#'
10-
#' @return table
13+
#' @return A table with the characteristics.
1114
#' @export
1215
#'
1316
#' @examples
14-
#' # TODO
17+
#'
18+
1519
calculate_subgraph_characteristics <- function(S, #S2, S3,
1620
fastalevel = TRUE,
1721
prototype = FALSE,

R/tables-summary_table_graphs.R

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
21
#' Calculate number for table
3-
#' @param subgraph_char_tab subgraphs characteristics tables
4-
#' @param isomorph_list isomorph lists
2+
#'
3+
#' @param subgraph_char_tab \strong{data.frame} \cr
4+
#' A table of subgraphs characteristics, e.g. created by [calculate_subgraph_characteristics()]
5+
#' @param isomorph_list \strong{list} \cr
6+
#' A list of occuring isomorphs.
57
#'
68
#' @return bla
79
#' @export
810
#'
9-
#' @examples # TODO
11+
#' @examples
12+
#'
13+
1014
calculate_summary_table <- function(subgraph_char_tab, isomorph_list) {
1115

1216
D <- subgraph_char_tab

man/calculate_subgraph_characteristics.Rd

Lines changed: 9 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/calculate_summary_table.Rd

Lines changed: 4 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/generatePrototypeList.Rd

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/geom_mean.Rd

Lines changed: 9 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/plotBipartiteGraph.Rd

Lines changed: 32 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)