Matrices Matrices are a rectangular structured array of numbers (entries) where the entries can be summed, subtracted, multiplied, and divided using the standard math operations. In the case of co-segregation,
Graph theory is used to see if a variable shares an edge or vertex with another variable on a network of nodes. Graph theory is the mathematical study of objects using pairwise relations that is shown through connected nodes called vertices that are connected to other nodes by edges. The image above depicts the conversion from a cosegregation matrix to an
adjacency matrix is one use of a matrix in genome architecture mapping where scientists are using cryosectioning to find
colocalization between DNA regions, genomes, and/or alleles. In that example, cosegregation is being used to describe the linkage of data to each other in terms of the distance between specific windows in a genome. The values in the cosegregation matrix were found using the formula above. Comparing windows , the formula seeks to find the intersection of Nuclear Profiles between the respective windows. The genomic windows would be the nodes and the adjacency graph is the matrix depiction of the edges connecting each node.
Heat maps A
heat map is a visual representation of a matrix of that can show different phenomenons on a two-dimensional scale. Heat maps have a range of color intensities based on the values and scale given from the data. Coding-wise, heat maps can be created using Python libraries such as plotly.express, matplotlib, and seaborn.heatmap. To interpret co-segregation, heat maps are used to visualize a matrix that contains binary values of either 1 or 0, which can indicate the commonalities between 2 or more variables; does variable
x match with variable
y, yes or no, 1 or 0. "The primary benefit of using heat maps is that they make otherwise dull or impenetrable data understandable. Many people understand heat maps intuitively, without even needing to be told that those warmer colors indicate a denser focus of interactions." In the limitation section, there are two heat maps (also put below for easy viewing) shown depicting the difference between normalized and non-normalized data. Showing the difference in the graphs would help the researcher identify different patterns based on the intensity of the color gradients as well as the clustering of data points. Co-segregation results as seen above can have different forms and visualizing them in heat maps can aid researchers in understanding which genomes are connected similar to matrices. The following heat maps represent this 1 or 0 value color range; it is important to use a diverging color set (as seen in these examples) that makes any distinctions in the data easy to both visualize and interpret scientifically/statistically. In heat maps, it is common to see a strong diagonal line (1 or 0), since any element will match when compared to itself on the opposite axis. The heat map below is a different representation of the data which uses the normalized linkage table instead of the resulting adjacency matrix. This visualization gives more variation (from -1 to 1 instead of only 0 or 1) and better shows the advantages of using a heat map. One limitation to heat maps are that some software does not allow the use of locating specific points on the graph, especially if there are many variables. There are coding libraries such as plotly.express that can create interactive heat maps where the programmer can hover over specified points on a graph and read the exact dependent variable's value. Another limitation is that heat maps do not represent real-time data. Since heat maps work by aggregating data over time, it does not show recent changes in behavior compared to the more dominant patterns already present. In genetics, network diagrams can be created using co-segregation adjacency matrices. To convert an adjacency matrix to a network diagram, one must translate the matrix elements into visual nodes and edges, where non-zero values indicate connections between nodes, thereby creating a graphical representation of the genetic interactions. Below is an image of a network diagram created using the
NetworkX library in Python.
NetworkX in Python To create network diagrams programmatically, people often use the NetworkX library in Python. NetworkX is a library that provides built-in classes and functions for creating network graphs. These functions will help you create graph objects, add nodes and edges, and draw the network. For visualizing graphs, Matplotlib is typically recommended, as it works well with NetworkX. Example: #Graph object G = nx.graph #Add nodes for i in range(len(table)): G.add_node(i) #Add edges for i in range(len(table)): for j in range(i + 1, len(table)): if value > 0: G.add_edge(i,j, weight=value) #Draw/plot network plt.figure(figsize=(6, 6)) pos = nx.spring_layout(G) #or layout of choosing nx.draw(G, pos, with_labels=True, node_color='lightblue', node_size=800, edge_color='gray', font_weight='bold') plt.title("Network Graph from Adjacency Matrix") plt.show() This graph represents the interaction between two nodes, where each node, in this case, corresponds to a genomic window, and each edge indicates a cosegregation relationship. NetworkX also supports edge and node attributes. For instance, with nx.draw, you can change all the features within the draw, such as with_labels, node_color, etc., and NetworkX supports multiple layout types, such as random_layout, spring_layout, shell_layout, etc., allowing you to visualize your graph better and obtain more information.
Spring Layout The spring layout is the default algorithm when visualizing network graphs. This layout positions nodes using the Fruchterman-Reingold force-directed algorithm, which treats edges as springs that hold connected nodes close together, while treating nodes as repelling objects. This will continue until the node positions reach a state of equilibrium. This will produce organized diagrams that will reveal clusters.
Shell Layout The shell layout positions nodes in concentric circles, which helps for visualizing (in cosegregation) organized by functional categories, levels, or chromosomal positions. Nodes will be arranged on one or more concentric circles (shells), with each shell specified as a list of nodes. Nodes that are in the same shell have the same distance from the center. Edges will be drawn between nodes in adjacent/other shells.
Circular Layout The circular layout arranges nodes evenly in a circle, with edges drawn between them based on the graph’s connectivity. The circular layout is often used to capture ring and star topologies but can be used for other networks as well. It can be used for social networks, WWW graphs, and clustering networks. When looking at symmetry or relationships between nodes in a consistent order, the circular layout makes these patterns easier to see. In cosegregation networks, circular layouts can be used to show relationships among genomic regions in a consistent ordering.
Random Layout Random layout assigns each node a random position within a unit square. Node placement doesn’t reflect any structural properties of the graph, so it is often not used for analysis. However, this layout is simple and quick to generate, and is often used for comparison against other more meaningful layout methods or to just get initial seeding for iterative algorithms.
Spectral Layout Unlike layouts such as spring or circular, the spectral layout is based on the mathematical properties of the graph—specifically the eigenvectors of the graph Laplacian matrix.{{cite web |title=Spectral layout|work=NetworkX 3.6.1 documentation == References ==