Description Usage Arguments See Also Examples
plotIBDclusters()
Produces a figure of an isoRelate cluster network, where unique isolates are represented by vertices and a line is
drawn between two vertices if the isolates have been inferred IBD via the criteria specified in either getIBDiclusters
or
getIBDpclusters
.The networks are created using the R package igraph
.
1 2 3 4 5 | plotIBDclusters(ped.genotypes, clusters, groups = NULL, vertex.color = NULL,
vertex.frame.color = "white", vertex.size = 4, vertex.name = FALSE,
edge.color = "gray60", edge.width = 0.8, mark.border = "white",
mark.col = "gray94", add.legend = TRUE, legend.x = -1.5,
legend.y = -0.25, layout = NULL, return.layout = FALSE)
|
ped.genotypes |
A list containing 2 objects. See the |
clusters |
A named list of three objects containing network information.
See the |
groups |
A data frame with 3 columns of information:
Group ID, for example, can be the geographic regions where the isolates were collected.
If |
vertex.color |
A vector of characters or numeric values of the vertex colors in the network.
If |
vertex.frame.color |
Character string or numeric value. A single color that will be used as the vertex border. Default is |
vertex.size |
Numeric value indicating the size of the vertices in the network. Default is |
vertex.name |
Logical. Whether to add isolate names to the vertices. Default is |
edge.color |
Character string or numeric value. A single color to be used for all edges. Default is |
edge.width |
Numeric. A single value indicating the width of the edges. Default is |
mark.border |
Character string or numeric value. A single color to be used for all borders in hierarchical clustering groups. Default is |
mark.col |
Character string or numeric value. A single color to be used to fill hierarchical clustering groupings. Default is |
add.legend |
Logical. Whether to include a legend in the plot. Default is |
legend.x |
Numerical. A single value indicating the x-coordinate of the legend, with default |
legend.y |
Numerical. A single value indicating the y-coordinate of the legend, with default |
layout |
A matrix containing the x and y coordinates of the vertices, generated using the Fruchterman-Reingold force-directed layout. |
return.layout |
Logical. Whether or not to return the layout matrix (vertex positions) in the network.
This layout can be used as the input for the parameter |
getGenotypes
, getIBDpclusters
and getIBDiclusters
.
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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | # generate the isolates who are IBD over the Plasmodium falciparum CRT gene
my_i_clusters <- getIBDiclusters(ped.genotypes = png_genotypes,
ibd.segments = png_ibd,
interval = c("Pf3D7_07_v3", 403222, 406317),
prop=0,
hi.clust = FALSE)
str(my_i_clusters)
# creating a stratification dataset
my_groups <- png_genotypes[[1]][,1:3]
my_groups[1:10,"pid"] <- "a"
my_groups[11:25,"pid"] <- "b"
my_groups[26:38,"pid"] <- "c"
# plot the network of clusters
plotIBDclusters(ped.genotypes = png_genotypes,
clusters = my_i_clusters,
groups = my_groups,
vertex.color = NULL,
vertex.frame.color = "white",
vertex.size = 4,
vertex.name = FALSE,
edge.color = "gray60",
edge.width = 0.8,
mark.border = "white",
mark.col = "gray94",
add.legend = TRUE,
legend.x = -1.5,
legend.y = -0.25,
layout = NULL,
return.layout = FALSE)
# generate the isolates who share at least than 90% of their genome IBD
my_p_clusters <- getIBDpclusters(ped.genotypes = png_genotypes,
ibd.segments = png_ibd,
prop=0.9,
hi.clust = FALSE)
# plot the network of clusters
plotIBDclusters(ped.genotypes = png_genotypes,
clusters = my_p_clusters,
groups = my_groups,
vertex.color = NULL,
vertex.frame.color = "white",
vertex.size = 4,
vertex.name = FALSE,
edge.color = "gray60",
edge.width = 0.8,
mark.border = "white",
mark.col = "gray94",
add.legend = TRUE,
legend.x = -1.5,
legend.y = -0.25,
layout = NULL,
return.layout = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.