MCPcopy Create free account
hub / github.com/CamaraLab/scTDA / plot_CDR_correlation

Method plot_CDR_correlation

scTDA/main.py:1831–1851  ·  view source on GitHub ↗

Displays correlation between sampling time points and CDR. It returns the two parameters of the linear fit, Pearson's r, p-value and standard error. If optional argument 'doplot' is False, the plot is not displayed.

(self, doplot=True)

Source from the content-addressed store, hash-verified

1829 return polter
1830
1831 def plot_CDR_correlation(self, doplot=True):
1832 """
1833 Displays correlation between sampling time points and CDR. It returns the two
1834 parameters of the linear fit, Pearson's r, p-value and standard error. If optional argument 'doplot' is
1835 False, the plot is not displayed.
1836 """
1837 pel2, tol = self.get_gene(self.rootlane, ignore_log=True)
1838 pel = numpy.array([pel2[m] for m in self.pl])*tol
1839 dr2 = self.get_gene('_CDR')[0]
1840 dr = numpy.array([dr2[m] for m in self.pl])
1841 po = scipy.stats.linregress(pel, dr)
1842 if doplot:
1843 pylab.scatter(pel, dr, s=9.0, alpha=0.7, c='r')
1844 pylab.xlim(min(pel), max(pel))
1845 pylab.ylim(0, max(dr)*1.1)
1846 pylab.xlabel(self.rootlane)
1847 pylab.ylabel('CDR')
1848 xk = pylab.linspace(min(pel), max(pel), 50)
1849 pylab.plot(xk, po[1]+po[0]*xk, 'k--', linewidth=2.0)
1850 pylab.show()
1851 return po
1852
1853 def plot_rootlane_correlation(self):
1854 """

Callers

nothing calls this directly

Calls 1

get_geneMethod · 0.95

Tested by

no test coverage detected