示例#1
0
def plotModuleCorr(cyDf,
                   labels,
                   plotLabel,
                   sampleStr='M',
                   dropped=None,
                   compCommVar=None):
    """Make a corr plot for a module."""
    modDf = makeModuleVariables(cyDf[labels.index], labels, dropped=dropped)
    modVar = '%s%s' % (sampleStr, plotLabel)
    cyVars = labels2modules(labels, dropped=None)[plotLabel]
    if not compCommVar is None:
        cyVars.append(compCommVar)
    tmpDf = cyDf[cyVars].join(modDf[modVar]).copy()
    """Rename dropped columns with an asterisk but leave them on the plot"""
    if not dropped is None:
        tmpDf.columns = np.array([
            c + '*' if c in dropped and dropped[c] else c
            for c in tmpDf.columns
        ])

    figh = plt.gcf()
    figh.clf()
    combocorrplot(tmpDf, method='pearson')
    axh = plt.gca()
    axh.annotate('Module %s%s' % (sampleStr, plotLabel),
                 xy=(0.5, 0.99),
                 xycoords='figure fraction',
                 va='top',
                 ha='center')
示例#2
0
def plotInterModuleCorr(cyDf, labels, dropped=None, compCommVar=None):
    """Make a plot showing inter-module correlation"""
    modDf = makeModuleVariables(cyDf[labels.index], labels, dropped=dropped)
    modVars = modDf.columns.tolist()
    if not compCommVar is None:
        modDf = modDf.join(cyDf[compCommVar])
        modVars += [compCommVar]

    figh = plt.gcf()
    figh.clf()
    combocorrplot(modDf[modVars], method='pearson')
示例#3
0
def plotInterModuleCorr(cyDf, labels, dropped = None, compCommVar = None):
    """Make a plot showing inter-module correlation"""
    modDf = makeModuleVariables(cyDf[labels.index], labels, dropped = dropped)
    modVars = modDf.columns.tolist()
    if not compCommVar is None:
        modDf = modDf.join(cyDf[compCommVar])
        modVars += [compCommVar]

    figh = plt.gcf()
    figh.clf()
    combocorrplot(modDf[modVars], method = 'pearson')
示例#4
0
def plotModuleCorr(cyDf, labels, plotLabel, sampleStr='M', dropped=None, compCommVar=None):
    """Make a corr plot for a module."""
    modDf = makeModuleVariables(cyDf[labels.index], labels, dropped=dropped)
    modVar = '%s%s' % (sampleStr, plotLabel)
    cyVars = labels2modules(labels, dropped = None)[plotLabel]
    if not compCommVar is None:
        cyVars.append(compCommVar)
    tmpDf = cyDf[cyVars].join(modDf[modVar]).copy()

    """Rename dropped columns with an asterisk but leave them on the plot"""
    if not dropped is None:
        tmpDf.columns = np.array([c + '*' if c in dropped and dropped[c] else c for c in tmpDf.columns])

    figh = plt.gcf()
    figh.clf()
    combocorrplot(tmpDf, method = 'pearson')
    axh = plt.gca()
    axh.annotate('Module %s%s' % (sampleStr, plotLabel), xy=(0.5,0.99), xycoords='figure fraction', va = 'top', ha='center')