ups
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import pylab
|
||||
import matplotlib
|
||||
import networkx as nx
|
||||
import scipy
|
||||
|
||||
def plot_corrloads(R, pc1=0,pc2=1,s=20, c='b', zorder=5,expvar=None,ax=None,drawback=True, labels=None):
|
||||
""" Correlation loading plot."""
|
||||
@@ -56,3 +57,31 @@ def plot_dag(edge_dict, node_color='b', node_size=30,labels=None,nodelist=None,p
|
||||
|
||||
nx.draw_networkx(G,pos, with_labels=with_labels, node_size=node_size, node_color=node_color, nodelist=nodelist)
|
||||
|
||||
|
||||
def plot_ZXcorr(gene_ids, term_ids, gene2go, X, D, scale=True):
|
||||
""" Plot correlation/covariance between genes as a function of
|
||||
semantic difference.
|
||||
|
||||
input: X (n, p) data matrix
|
||||
D (p, p) gene-gene sematic similarity matrix
|
||||
"""
|
||||
D = scipy.corrcoef(X)
|
||||
term2ind = dict(enumerate(term_ids))
|
||||
for i, gene_i in enumerate(gene_ids):
|
||||
for j, gene_j in enumerate(gene_ids):
|
||||
if j<i:
|
||||
r2 = D[i,j]
|
||||
terms_i = gene2go[gene_i]
|
||||
terms_j = gene2go[gene_j]
|
||||
for ti, term in enumerate(term_ids):
|
||||
if term in terms_i:
|
||||
pass
|
||||
|
||||
|
||||
def clustering_index(T, Yg):
|
||||
pass
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user