Plot the optimal graph by model selection
# S3 method for select
plot(x, vis= NULL, xlab= NULL, ylab= NULL, n.mem= NULL, vertex.label= FALSE
, ..., layout= NULL, label.vertex= "all", vertex.size= NULL, vertex.color= NULL,
edge.color= "gray29", sel.nod.label= NULL, label.size = NULL, w.btw= 800,
w.within = 10, sign.edg= TRUE, edge.width= NULL, edge.label= NULL,
max.degree= NULL, layout.tree= NULL, root.node= NULL, degree.node= NULL,
curve= FALSE, delet.v =TRUE, pos.legend= "bottomleft", cex.legend= 0.8,
iterl = NULL, temp = NULL, tk.width = NULL, tk.height= NULL)
An object with S3 class "select"
is returned:
Plot of a selected graph, when vis
= "CI".
Conditional independence (CI) relationships between variables, when vis
= "CI"
Interactive plot of a selected graph with .eps format, when vis
= "interactive"
An object with S3 class "select"
Visualizing the results as a graph (network) or as a matrix. There are 4 options to visulize the selected graph: (i) "CI": plotting conditional independence (CI) relationships between variables, (ii) "interactive": plotting the conditional independence network, where opens a new windows with interactive graph drawing facility, and (iii) "parcor.network": plots the estimated graph based on partial correlation values. (iv) "parcor.interactive": plots the estimated graph based on partial correlation matrix with an interactive graph drawing facility. Default is "CI".
Also, there are 3 options to visulaze the selected graph as a matrix: (i) vis
= "image.parcorMatrix" plots the image of partial correlation matrix, (ii) vis
= "image.adj" draws the adjacency matrix (only presence and absence of links), (iii) vis
= "image.precision" plots the selected precision matrix.
ONLY applicable when vis = "CI"
, "image.parcorMatrix", "image.adj", or "image.precision".
ONLY applicable when vis = "CI"
, "image.parcorMatrix", "image.adj", or "image.precision".
A vector of memberships. For example, the CviCol dataset, which is provided in the package, contain 5 chromosomes which the total number of markers is \(p = 90\), where the first 24 markers belong into chromosome 1, the next 14 markers into chromosome 2, ..., and chromosome 5 contains 19 markers. Thus, n.mem = c(24,14,17,16,19). If n.mem = NULL
and vis = "CI"
all vertices are coloured the same.
ONLY applicable when vis
= "CI". Assign names to the vertices. Default is FALSE.
ONLY applicable when vis
= "CI". System reserved (No specific usage)
ONLY applicable when vis
= "interactive" or "parcor.network". The layout specification. Some graph layouts examples: layout_with_fr, layout_in_circle, layout_as_tree, and layout.fruchterman.reingold. The default layout is layout_with_fr.
ONLY applicable when vis
= "interactive". Assign names to the vertices. There are three options: "none", "some", "all". Specify "none" to omit vertex labels in the graph; using label.vertex
= "some" you must provide a vector of vertex IDs or a single vertex ID to the sel.label
argument, which you would like to be shown in the graph. Specify "all" to include all vertex labels in the graph. Default is "all".
Optional. The size of vertices in the graph visualization. The default value is 7.
ONLY applicable when vis
= "interactive" or "parcor.network". Optional vector (or a color name) giving the colors of the vertices. The default is "red"
ONLY applicable when vis
= "interactive". Optional. The default is "gray".
ONLY applicable when vis
= "interactive" or "parcor.network". A vector of vertex IDs or a single vertex ID, which you would like to be shown in the graph. ONLY applicable when label.vertex
="some".
ONLY applicable for vis
= "interactive" or vis
= "parcor.network". The font size of the vertex labels.
Distance between nodes from different memberships of n.mem
in layout.
Distance of nodes within one membership of n.mem
in layout.
Optional. ONLY applicable when vis
= "parcor.network". If TRUE
then edges are colored as red and blue, where red stands for positive and blue negative partial correlation values. If FASLE
all edeges are colored as gray. Default is TRUE.
Optional. ONLY applicable when vis
= "parcor.network". Based on the strength of partial correlation values, edges will shown with different line type. Default is FALSE.
Optional. ONLY applicable when vis
= "parcor.network". If TRUE then the partial correlation values will be shown on top of each edge. Default is FALSE.
Optional. ONLY applicable when vis
= "parcor.network". A number showing degree of a node. This can be used to print those vertex labels that the correspondence vertex have at least e.g. 1 degree.
Optional. ONLY applicable when vis
= "parcor.network". If TRUE then it uses layout_as_tree
from igraph
package. Default is FALSE.
Optional. ONLY applicable when vis
= "parcor.network". The index of the root vertex or root vertices. If this is a non-empty vector then the supplied vertex ids are used as the roots of the trees . If it is an empty vector, then the root vertices are automatically calculated based on topological sorting, performed with the opposite mode than the mode argument. After the vertices have been sorted, one is selected from each component.
Optional. ONLY applicable when vis
= "parcor.network". It is related to the vertex label degree. It controls the position of the labels with respect to the vertices. Value are for example -pi/2, 0, pi/2, pi sets above, to the right, below, to the left of a node, respectively.
Optional. ONLY applicable when vis
= "parcor.network". Edge curvature, range between 0 and 1 (FALSE sets it to 0, TRUE to 0.5). Default is FALSE.
Delete vertices with no edges. Default is "TRUE".
Applicable when vis
= "parcor.network" or vis
= "CI". The x and y co-ordinates to be used to position the legend. They can be specified by keywords like "topright", "topleft", and etc. Default is "bottomleft".
Applicable when vis
= "parcor.network" or vis
= "CI".
Optional. ONLY applicable when vis
= "parcor.interactive". integer scalar, the number of iterations to perform for layout_with_fr layout.
Optional. ONLY applicable when vis
= "parcor.interactive". Real scalar, the start temperature for layout_with_fr layout.
Optional. The size of the drawing area of interactive plot.
Optional. The size of the drawing area of interactive plot.
Pariya Behrouzi
Maintainer: Pariya Behrouzi pariya.behrouzi@gmail.com
Behrouzi, P., and Wit, E. C. (2017c). netgwas: An R Package for Network-Based Genome-Wide Association Studies. arXiv preprint, arXiv:1710.01236.
select
# \donttest{
#simulate data
data(CviCol)
out <- netsnp(CviCol)
sel <- selectnet(out)
cl <- c(rep("palegoldenrod", 24), rep("white",14), rep("tan1",17),
rep("gray",16), rep("lightblue2",19))
plot(sel, vis= "parcor.network", sign.edg = TRUE, layout = NULL, vertex.color = cl)
# }
Run the code above in your browser using DataLab