ggplotDistanceGraph will create a graph-like visualisation (ripple plot) of the corresponding barcode sequences
and their similarity based on the ggplot2 and the ggnetwork packages. The nodes represent the barcode sequences and their
respective size reflects the corresponding read counts. Edges between nodes indicate a distance between two barcodes
of maximal minDist
.
If ori_BCs
is provided the node color also refelects the distance of a particular barcode to one of the initial
barcodes.
ggplotDistanceGraph(
BC_dat,
minDist = 1,
loga = TRUE,
ori_BCs = NULL,
lay = "fruchtermanreingold",
complete = FALSE,
col_type = "rainbow",
m = "hamming",
scale_nodes = 1,
scale_edges = 1,
legend_size = 4
)
a ggplot2 object
a BCdat object.
an integer value representing the maximal distance for which the graph will contain edges.
a logical value, indicating the use or non-use of logarithmic read count values.
a vector of character strings containing the barcode sequences (without the fixed positions of the barcode construct).
a character string, identifying the prefered layout algorithm (see ggnetwork layout option, "?gplot.layout"). Default value is "fruchtermanreingold", but possible are also "circle", "eigen", "kamadakawai", "spring" and many more. Or the user provides a two-column matrix with as many rows as there are nodes in the network, in which case the matrix is used as nodes coordinates.
a logical value. If TRUE, every node will have at least one edge.
a character sting, choosing one of the available color palettes ("rainbow", "heat.colors", "topo.colors", "greens", "wild" - see package "grDevices").
a character string, Method for distance calculation, default value is Hamming distance. Possible values are "osa", "lv", "dl", "hamming", "lcs", "qgram", "cosine", "jaccard", "jw", "soundex" (see stringdist function of the stringdist-package for more information).
a numeric value, scaling the node size.
a numeric value, scaling the edge size.
a numeric value, scaling the legend symbol size, if legend_size equals 0, the legend will be dismissed.
if (FALSE) {
data(BC_dat)
ggplotDistanceGraph(BC_dat, minDist = 1, loga = TRUE, ori_BCs = NULL, lay = "fruchtermanreingold",
complete = FALSE, col_type = "rainbow")
}
Run the code above in your browser using DataLab