Skip to content

Commit bda9e3e

Browse files
committed
Add a summary section.
1 parent 3b76ca8 commit bda9e3e

File tree

1 file changed

+238
-4
lines changed

1 file changed

+238
-4
lines changed

calcium_imaging/02-Imported and Computed tables.ipynb

Lines changed: 238 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
},
1111
{
1212
"cell_type": "code",
13-
"execution_count": null,
13+
"execution_count": 140,
1414
"metadata": {},
1515
"outputs": [],
16-
"source": []
16+
"source": [
17+
"%matplotlib inline"
18+
]
1719
},
1820
{
1921
"cell_type": "markdown",
@@ -1784,7 +1786,7 @@
17841786
},
17851787
{
17861788
"cell_type": "code",
1787-
"execution_count": 138,
1789+
"execution_count": 141,
17881790
"metadata": {},
17891791
"outputs": [
17901792
{
@@ -1793,7 +1795,7 @@
17931795
"Text(0, 0.5, 'Fluorescence')"
17941796
]
17951797
},
1796-
"execution_count": 138,
1798+
"execution_count": 141,
17971799
"metadata": {},
17981800
"output_type": "execute_result"
17991801
},
@@ -1820,6 +1822,238 @@
18201822
"plt.xlabel('Time (s)')\n",
18211823
"plt.ylabel('Fluorescence')"
18221824
]
1825+
},
1826+
{
1827+
"cell_type": "markdown",
1828+
"metadata": {},
1829+
"source": [
1830+
"# Summary"
1831+
]
1832+
},
1833+
{
1834+
"cell_type": "markdown",
1835+
"metadata": {},
1836+
"source": [
1837+
"As a summary, now let's take a look at the data pipeline we have so far. It now contains all types of tables, which we call **table tiers**, and major types of dependencies."
1838+
]
1839+
},
1840+
{
1841+
"cell_type": "code",
1842+
"execution_count": 142,
1843+
"metadata": {},
1844+
"outputs": [
1845+
{
1846+
"data": {
1847+
"image/svg+xml": [
1848+
"<svg height=\"444pt\" viewBox=\"0.00 0.00 296.11 444.50\" width=\"296pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
1849+
"<g class=\"graph\" id=\"graph0\" transform=\"scale(1 1) rotate(0) translate(4 440.499)\">\n",
1850+
"<title>%3</title>\n",
1851+
"<polygon fill=\"#ffffff\" points=\"-4,4 -4,-440.499 292.1096,-440.499 292.1096,4 -4,4\" stroke=\"transparent\"/>\n",
1852+
"<!-- Scan -->\n",
1853+
"<g class=\"node\" id=\"node1\">\n",
1854+
"<title>Scan</title>\n",
1855+
"<g id=\"a_node1\"><a xlink:title=\"→ experiment.Session\r",
1856+
"scan_idx             \r",
1857+
"------------------------------\r",
1858+
"depth                \r",
1859+
"wavelength           \r",
1860+
"laser_power          \r",
1861+
"fps                  \r",
1862+
"file_name            \r",
1863+
"\">\n",
1864+
"<polygon fill=\"#00ff00\" fill-opacity=\"0.188235\" points=\"202.7002,-294.499 158.9942,-294.499 158.9942,-259.499 202.7002,-259.499 202.7002,-294.499\" stroke=\"#00ff00\" stroke-opacity=\"0.188235\"/>\n",
1865+
"<text fill=\"#006400\" font-family=\"arial\" font-size=\"12.00\" text-anchor=\"start\" text-decoration=\"underline\" x=\"167.1714\" y=\"-275.2984\">Scan</text>\n",
1866+
"</a>\n",
1867+
"</g>\n",
1868+
"</g>\n",
1869+
"<!-- AverageFluorescence -->\n",
1870+
"<g class=\"node\" id=\"node6\">\n",
1871+
"<title>AverageFluorescence</title>\n",
1872+
"<g id=\"a_node6\"><a xlink:title=\"→ Scan\r",
1873+
"------------------------------\r",
1874+
"average_fluorescence \r",
1875+
"\">\n",
1876+
"<ellipse cx=\"180.8472\" cy=\"-205.999\" fill=\"#00007f\" fill-opacity=\"0.250980\" rx=\"84.8768\" ry=\"17.5\" stroke=\"#00007f\" stroke-opacity=\"0.250980\"/>\n",
1877+
"<text fill=\"#00007f\" font-family=\"arial\" font-size=\"12.00\" text-anchor=\"middle\" x=\"180.8472\" y=\"-203.2984\">AverageFluorescence</text>\n",
1878+
"</a>\n",
1879+
"</g>\n",
1880+
"</g>\n",
1881+
"<!-- Scan&#45;&gt;AverageFluorescence -->\n",
1882+
"<g class=\"edge\" id=\"edge1\">\n",
1883+
"<title>Scan-&gt;AverageFluorescence</title>\n",
1884+
"<path d=\"M180.8472,-259.4485C180.8472,-248.6074 180.8472,-234.7356 180.8472,-223.8408\" fill=\"none\" stroke=\"#000000\" stroke-opacity=\"0.250980\" stroke-width=\"2\"/>\n",
1885+
"</g>\n",
1886+
"<!-- experiment.Session -->\n",
1887+
"<g class=\"node\" id=\"node2\">\n",
1888+
"<title>experiment.Session</title>\n",
1889+
"<g id=\"a_node2\"><a xlink:title=\"→ experiment.Mouse\r",
1890+
"session_number       \r",
1891+
"------------------------------\r",
1892+
"session_date         \r",
1893+
"person               \r",
1894+
"data_path=&quot;&quot;         \r",
1895+
"\">\n",
1896+
"<polygon fill=\"#00ff00\" fill-opacity=\"0.188235\" points=\"241.7345,-365.499 119.9598,-365.499 119.9598,-330.499 241.7345,-330.499 241.7345,-365.499\" stroke=\"#00ff00\" stroke-opacity=\"0.188235\"/>\n",
1897+
"<text fill=\"#006400\" font-family=\"arial\" font-size=\"12.00\" text-anchor=\"start\" text-decoration=\"underline\" x=\"128.1538\" y=\"-346.2984\">experiment.Session</text>\n",
1898+
"</a>\n",
1899+
"</g>\n",
1900+
"</g>\n",
1901+
"<!-- experiment.Session&#45;&gt;Scan -->\n",
1902+
"<g class=\"edge\" id=\"edge2\">\n",
1903+
"<title>experiment.Session-&gt;Scan</title>\n",
1904+
"<path d=\"M180.8472,-330.4485C180.8472,-319.6074 180.8472,-305.7356 180.8472,-294.8408\" fill=\"none\" stroke=\"#000000\" stroke-opacity=\"0.250980\" stroke-width=\".75\"/>\n",
1905+
"</g>\n",
1906+
"<!-- Segmentation -->\n",
1907+
"<g class=\"node\" id=\"node3\">\n",
1908+
"<title>Segmentation</title>\n",
1909+
"<g id=\"a_node3\"><a xlink:title=\"→ AverageFluorescence\r",
1910+
"→ ParameterSet\r",
1911+
"------------------------------\r",
1912+
"segmented_masks      \r",
1913+
"\">\n",
1914+
"<ellipse cx=\"109.8472\" cy=\"-139.499\" fill=\"#ff0000\" fill-opacity=\"0.125490\" rx=\"13.0073\" ry=\"13\" stroke=\"#ff0000\" stroke-opacity=\"0.125490\"/>\n",
1915+
"<text fill=\"#7f0000\" font-family=\"arial\" font-size=\"12.00\" text-anchor=\"middle\" x=\"109.8472\" y=\"-136.7984\">Segmentation</text>\n",
1916+
"</a>\n",
1917+
"</g>\n",
1918+
"</g>\n",
1919+
"<!-- Segmentation.Roi -->\n",
1920+
"<g class=\"node\" id=\"node7\">\n",
1921+
"<title>Segmentation.Roi</title>\n",
1922+
"<g id=\"a_node7\"><a xlink:title=\"→ Segmentation\r",
1923+
"roi_idx              \r",
1924+
"------------------------------\r",
1925+
"mask                 \r",
1926+
"\">\n",
1927+
"<polygon fill=\"transparent\" points=\"157.8406,-83.0046 61.8537,-83.0046 61.8537,-62.9934 157.8406,-62.9934 157.8406,-83.0046\" stroke=\"transparent\"/>\n",
1928+
"<text fill=\"#000000\" font-family=\"arial\" font-size=\"10.00\" text-anchor=\"start\" text-decoration=\"underline\" x=\"70.1011\" y=\"-71.7485\">Segmentation.Roi</text>\n",
1929+
"</a>\n",
1930+
"</g>\n",
1931+
"</g>\n",
1932+
"<!-- Segmentation&#45;&gt;Segmentation.Roi -->\n",
1933+
"<g class=\"edge\" id=\"edge3\">\n",
1934+
"<title>Segmentation-&gt;Segmentation.Roi</title>\n",
1935+
"<path d=\"M109.8472,-126.3608C109.8472,-113.6426 109.8472,-94.636 109.8472,-83.0718\" fill=\"none\" stroke=\"#000000\" stroke-opacity=\"0.250980\" stroke-width=\".75\"/>\n",
1936+
"</g>\n",
1937+
"<!-- Fluorescence -->\n",
1938+
"<g class=\"node\" id=\"node9\">\n",
1939+
"<title>Fluorescence</title>\n",
1940+
"<g id=\"a_node9\"><a xlink:title=\"→ Segmentation\r",
1941+
"------------------------------\r",
1942+
"time                 \r",
1943+
"\">\n",
1944+
"<ellipse cx=\"231.8472\" cy=\"-72.999\" fill=\"#00007f\" fill-opacity=\"0.250980\" rx=\"56.0258\" ry=\"17.5\" stroke=\"#00007f\" stroke-opacity=\"0.250980\"/>\n",
1945+
"<text fill=\"#00007f\" font-family=\"arial\" font-size=\"12.00\" text-anchor=\"middle\" x=\"231.8472\" y=\"-70.2984\">Fluorescence</text>\n",
1946+
"</a>\n",
1947+
"</g>\n",
1948+
"</g>\n",
1949+
"<!-- Segmentation&#45;&gt;Fluorescence -->\n",
1950+
"<g class=\"edge\" id=\"edge4\">\n",
1951+
"<title>Segmentation-&gt;Fluorescence</title>\n",
1952+
"<path d=\"M121.545,-133.1227C140.272,-122.915 177.5153,-102.6143 203.5201,-88.4396\" fill=\"none\" stroke=\"#000000\" stroke-opacity=\"0.250980\" stroke-width=\"2\"/>\n",
1953+
"</g>\n",
1954+
"<!-- ParameterSet -->\n",
1955+
"<g class=\"node\" id=\"node4\">\n",
1956+
"<title>ParameterSet</title>\n",
1957+
"<g id=\"a_node4\"><a xlink:title=\"parameter_set_id     \r",
1958+
"------------------------------\r",
1959+
"threshold            \r",
1960+
"size_cutoff          \r",
1961+
"\">\n",
1962+
"<polygon fill=\"#000000\" fill-opacity=\"0.125490\" points=\"77.5421,-223.499 .1522,-223.499 .1522,-188.499 77.5421,-188.499 77.5421,-223.499\" stroke=\"transparent\"/>\n",
1963+
"<text fill=\"#000000\" font-family=\"arial\" font-size=\"10.00\" text-anchor=\"start\" text-decoration=\"underline\" x=\"8\" y=\"-204.7485\">ParameterSet</text>\n",
1964+
"</a>\n",
1965+
"</g>\n",
1966+
"</g>\n",
1967+
"<!-- ParameterSet&#45;&gt;Segmentation -->\n",
1968+
"<g class=\"edge\" id=\"edge5\">\n",
1969+
"<title>ParameterSet-&gt;Segmentation</title>\n",
1970+
"<path d=\"M57.8739,-188.1782C71.5112,-175.4053 89.3159,-158.729 100.1493,-148.5822\" fill=\"none\" stroke=\"#000000\" stroke-opacity=\"0.250980\" stroke-width=\".75\"/>\n",
1971+
"</g>\n",
1972+
"<!-- Fluorescence.Trace -->\n",
1973+
"<g class=\"node\" id=\"node5\">\n",
1974+
"<title>Fluorescence.Trace</title>\n",
1975+
"<g id=\"a_node5\"><a xlink:title=\"→ Fluorescence\r",
1976+
"→ Segmentation.Roi\r",
1977+
"------------------------------\r",
1978+
"trace                \r",
1979+
"\">\n",
1980+
"<polygon fill=\"transparent\" points=\"283.8452,-19.7551 179.8491,-19.7551 179.8491,.2561 283.8452,.2561 283.8452,-19.7551\" stroke=\"transparent\"/>\n",
1981+
"<text fill=\"#000000\" font-family=\"arial\" font-size=\"10.00\" text-anchor=\"middle\" x=\"231.8472\" y=\"-7.499\">Fluorescence.Trace</text>\n",
1982+
"</a>\n",
1983+
"</g>\n",
1984+
"</g>\n",
1985+
"<!-- AverageFluorescence&#45;&gt;Segmentation -->\n",
1986+
"<g class=\"edge\" id=\"edge6\">\n",
1987+
"<title>AverageFluorescence-&gt;Segmentation</title>\n",
1988+
"<path d=\"M162.5629,-188.8736C148.7575,-175.9432 130.3689,-158.7201 119.3581,-148.4071\" fill=\"none\" stroke=\"#000000\" stroke-opacity=\"0.250980\" stroke-width=\".75\"/>\n",
1989+
"</g>\n",
1990+
"<!-- Segmentation.Roi&#45;&gt;Fluorescence.Trace -->\n",
1991+
"<g class=\"edge\" id=\"edge7\">\n",
1992+
"<title>Segmentation.Roi-&gt;Fluorescence.Trace</title>\n",
1993+
"<path d=\"M128.9097,-63.1163C151.8293,-51.2338 190.0587,-31.4143 212.9185,-19.5629\" fill=\"none\" stroke=\"#000000\" stroke-opacity=\"0.250980\" stroke-width=\"2\"/>\n",
1994+
"</g>\n",
1995+
"<!-- experiment.Mouse -->\n",
1996+
"<g class=\"node\" id=\"node8\">\n",
1997+
"<title>experiment.Mouse</title>\n",
1998+
"<g id=\"a_node8\"><a xlink:title=\"mouse_id             \r",
1999+
"------------------------------\r",
2000+
"dob=null             \r",
2001+
"sex=&quot;unknown&quot;        \r",
2002+
"mouse_notes=&quot;&quot;       \r",
2003+
"\">\n",
2004+
"<polygon fill=\"#00ff00\" fill-opacity=\"0.188235\" points=\"238.0604,-436.499 123.6339,-436.499 123.6339,-401.499 238.0604,-401.499 238.0604,-436.499\" stroke=\"#00ff00\" stroke-opacity=\"0.188235\"/>\n",
2005+
"<text fill=\"#006400\" font-family=\"arial\" font-size=\"12.00\" text-anchor=\"start\" text-decoration=\"underline\" x=\"131.4907\" y=\"-417.2984\">experiment.Mouse</text>\n",
2006+
"</a>\n",
2007+
"</g>\n",
2008+
"</g>\n",
2009+
"<!-- experiment.Mouse&#45;&gt;experiment.Session -->\n",
2010+
"<g class=\"edge\" id=\"edge8\">\n",
2011+
"<title>experiment.Mouse-&gt;experiment.Session</title>\n",
2012+
"<path d=\"M180.8472,-401.4485C180.8472,-390.6074 180.8472,-376.7356 180.8472,-365.8408\" fill=\"none\" stroke=\"#000000\" stroke-opacity=\"0.250980\" stroke-width=\".75\"/>\n",
2013+
"</g>\n",
2014+
"<!-- Fluorescence&#45;&gt;Fluorescence.Trace -->\n",
2015+
"<g class=\"edge\" id=\"edge9\">\n",
2016+
"<title>Fluorescence-&gt;Fluorescence.Trace</title>\n",
2017+
"<path d=\"M231.8472,-55.3805C231.8472,-43.8298 231.8472,-29.1552 231.8472,-19.6127\" fill=\"none\" stroke=\"#000000\" stroke-opacity=\"0.250980\" stroke-width=\".75\"/>\n",
2018+
"</g>\n",
2019+
"</g>\n",
2020+
"</svg>"
2021+
],
2022+
"text/plain": [
2023+
"<datajoint.diagram.Diagram at 0x1c2d20cbe0>"
2024+
]
2025+
},
2026+
"execution_count": 142,
2027+
"metadata": {},
2028+
"output_type": "execute_result"
2029+
}
2030+
],
2031+
"source": [
2032+
"dj.ERD(schema)"
2033+
]
2034+
},
2035+
{
2036+
"cell_type": "markdown",
2037+
"metadata": {},
2038+
"source": [
2039+
"**Table tiers**: \n",
2040+
"Manual table: green box \n",
2041+
"Lookup table: gray box \n",
2042+
"Imported table: blue oval \n",
2043+
"Computed table: red circle \n",
2044+
"Part table: plain text\n",
2045+
"\n",
2046+
"**Dependencies**: \n",
2047+
"One-to-one primary: thick solid line, share the exact same primary key \n",
2048+
"One-to-many primary: thin solid line, inherit the primary key from the parent table, but have additional field(s) as part of the primary key as well"
2049+
]
2050+
},
2051+
{
2052+
"cell_type": "code",
2053+
"execution_count": null,
2054+
"metadata": {},
2055+
"outputs": [],
2056+
"source": []
18232057
}
18242058
],
18252059
"metadata": {

0 commit comments

Comments
 (0)