Skip to content

Commit

Permalink
adding references
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxime RIO committed Jul 5, 2019
1 parent 6822661 commit f5957dd
Show file tree
Hide file tree
Showing 5 changed files with 368 additions and 10 deletions.
6 changes: 3 additions & 3 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# depends on pandoc (>= 2.0) and pdf2svg
# depends on pandoc (>= 2.0) with pandoc-citeproc and pdf2svg

all: model.html

model.html: model.md style.css
pandoc --lua-filter tikz.lua --mathjax -s -o "$@" "$<" -c "$(word 2,$^)"
model.html: model.md style.css references.bib
pandoc --filter pandoc-citeproc --lua-filter tikz.lua --mathjax -s -o "$@" "$<"
252 changes: 252 additions & 0 deletions docs/council-of-science-editors-alphabetical.csl
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="en-US">
<info>
<title>Council of Science Editors, Citation-Name (numeric, sorted alphabetically)</title>
<title-short>CSE C-N</title-short>
<id>http://www.zotero.org/styles/council-of-science-editors-alphabetical</id>
<link href="http://www.zotero.org/styles/council-of-science-editors-alphabetical" rel="self"/>
<link href="http://www.zotero.org/styles/council-of-science-editors" rel="template"/>
<link href="http://www.scientificstyleandformat.org/Tools/SSF-Citation-Quick-Guide.html" rel="documentation"/>
<author>
<name>Julian Onions</name>
<email>[email protected]</email>
</author>
<contributor>
<name>Patrick O'Brien</name>
</contributor>
<contributor>
<name>Aurimas Vinckevicius</name>
<email>[email protected]</email>
</contributor>
<category citation-format="numeric"/>
<category field="science"/>
<summary>The Council of Science Editors style 8th edition, Citation-Name system: numbers in text, sorted in alphabetical order by author.</summary>
<updated>2019-01-16T10:57:42+00:00</updated>
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
</info>
<locale xml:lang="en">
<terms>
<term name="editortranslator" form="long">
<single>editor and translator</single>
<multiple>editors and translators</multiple>
</term>
<term name="collection-editor" form="long">
<single>editor</single>
<multiple>editors</multiple>
</term>
</terms>
</locale>
<macro name="editor">
<names variable="editor translator" delimiter="; " suffix=".">
<name delimiter-precedes-last="always" initialize-with="" name-as-sort-order="all" sort-separator=" "/>
<label prefix=", "/>
</names>
</macro>
<macro name="author">
<names variable="author" delimiter="; ">
<name name-as-sort-order="all" sort-separator=" " initialize-with="" delimiter=", " delimiter-precedes-last="always"/>
<label form="long" prefix=", " strip-periods="true"/>
<substitute>
<names variable="editor translator"/>
<text variable="title"/>
</substitute>
</names>
</macro>
<macro name="review">
<group delimiter=". ">
<text variable="reviewed-title"/>
<text variable="container-title"/>
</group>
</macro>
<macro name="access">
<choose>
<if variable="accessed" match="any">
<text variable="URL"/>
</if>
</choose>
</macro>
<macro name="title">
<group delimiter=" ">
<text variable="title"/>
<choose>
<if type="thesis" match="any">
<text variable="genre" form="long" prefix="[" suffix="]"/>
</if>
</choose>
</group>
</macro>
<macro name="publisher">
<group delimiter=": ">
<text variable="publisher-place"/>
<text variable="publisher"/>
</group>
</macro>
<macro name="issued">
<group delimiter=" ">
<date variable="issued" delimiter=" ">
<date-part name="year"/>
</date>
<choose>
<if type="patent article-newspaper webpage" match="any">
<date variable="issued" delimiter=" ">
<date-part name="month" form="short" strip-periods="true"/>
<date-part name="day"/>
</date>
</if>
<else-if type="article-journal article-magazine" match="any">
<choose>
<if variable="volume issue" match="none">
<date variable="issued" delimiter=" ">
<date-part name="month" form="short" strip-periods="true"/>
<date-part name="day"/>
</date>
</if>
</choose>
</else-if>
</choose>
<group prefix=" [" suffix="]" delimiter=" ">
<text term="accessed"/>
<date variable="accessed" delimiter=" ">
<date-part name="year"/>
<date-part name="month" form="short" strip-periods="true"/>
<date-part name="day"/>
</date>
</group>
</group>
</macro>
<macro name="pages">
<group>
<label variable="page" form="short" suffix=" " plural="never"/>
<text variable="page"/>
</group>
</macro>
<macro name="edition">
<choose>
<if is-numeric="edition">
<group delimiter=" ">
<number variable="edition" form="ordinal"/>
<text term="edition" form="short"/>
</group>
</if>
<else>
<text variable="edition" suffix="."/>
</else>
</choose>
</macro>
<macro name="collection">
<choose>
<if type="report">
<group prefix=" " suffix="." delimiter=" ">
<text variable="collection-title"/>
<text variable="number" prefix=" Report No.: "/>
</group>
</if>
<else>
<group prefix=" (" suffix=")." delimiter=" ">
<names variable="collection-editor" suffix=". ">
<name delimiter-precedes-last="always" initialize-with="" name-as-sort-order="all" sort-separator=" "/>
<label prefix=", "/>
</names>
<text variable="collection-title"/>
</group>
</else>
</choose>
</macro>
<citation collapse="citation-number">
<sort>
<key variable="citation-number"/>
</sort>
<layout delimiter="," vertical-align="sup">
<text variable="citation-number"/>
<group prefix="(" suffix=")">
<label variable="locator" form="short" strip-periods="true"/>
<text variable="locator"/>
</group>
</layout>
</citation>
<bibliography hanging-indent="false" et-al-min="11" et-al-use-first="10">
<sort>
<key macro="author"/>
<key variable="title"/>
</sort>
<layout>
<text variable="citation-number" suffix=". "/>
<text macro="author" suffix="."/>
<choose>
<if type="bill book graphic legal_case legislation motion_picture report song thesis" match="any">
<group prefix=" " suffix="." delimiter=" ">
<text macro="title" suffix="."/>
<text macro="edition"/>
<text macro="editor"/>
</group>
<group prefix=" " delimiter="; ">
<text macro="publisher"/>
<group suffix="." delimiter=". ">
<text macro="issued"/>
<text macro="pages"/>
</group>
</group>
</if>
<else-if type="chapter paper-conference entry-dictionary entry-encyclopedia" match="any">
<text macro="title" prefix=" " suffix="."/>
<group prefix=" " delimiter=" ">
<group delimiter=" ">
<text term="in" text-case="capitalize-first" suffix=":"/>
<text macro="editor"/>
<text variable="container-title" suffix="."/>
</group>
<group delimiter=" " suffix=".">
<label text-case="capitalize-first" variable="volume" form="short"/>
<text variable="volume"/>
</group>
<text macro="edition"/>
<group suffix="." delimiter="; ">
<text macro="publisher"/>
<group suffix="." delimiter=". ">
<text macro="issued"/>
<text macro="pages"/>
</group>
</group>
</group>
</else-if>
<else-if type="review review-book" match="any">
<group suffix=".">
<text macro="title" prefix=" "/>
<text macro="editor" prefix=" "/>
</group>
<group prefix=" " suffix=".">
<text macro="review" suffix="."/>
<group delimiter=";" prefix=" ">
<text macro="issued"/>
<group>
<text variable="volume"/>
<text variable="issue" prefix="(" suffix=")"/>
</group>
</group>
<text variable="page" prefix=":"/>
</group>
</else-if>
<else>
<group suffix="." prefix=" " delimiter=". ">
<text macro="title"/>
<text macro="editor"/>
</group>
<group prefix=" " suffix=".">
<text variable="container-title" suffix="."/>
<group delimiter=";" prefix=" ">
<text macro="issued"/>
<group>
<text variable="volume"/>
<text variable="issue" prefix="(" suffix=")"/>
</group>
</group>
<text variable="page" prefix=":"/>
</group>
</else>
</choose>
<text prefix=" " macro="collection"/>
<text prefix=" " macro="access"/>
<text variable="DOI" prefix=". doi:"/>
</layout>
</bibliography>
</style>
25 changes: 21 additions & 4 deletions docs/model.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>model</title>
<title>ASt model description</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
Expand All @@ -18,9 +18,11 @@
<![endif]-->
</head>
<body>
<h1 id="model-description">Model description</h1>
<header id="title-block-header">
<h1 class="title">ASt model description</h1>
</header>
<p>There are several approaches for dealing with neuropil contamination, the most common involve subtracting the surrounding neuropil fluorescence from each ROI with a scale factor determined by linear regression or hand-picked manually.</p>
<p>We fit both ROI and surround fluorescence to asymmetric Student-t (ASt) distributions, whose mean was determined by a common neuropil signal contributing to both ROI and surrounding fluorescence:</p>
<p>We fit both ROI and surround fluorescence to asymmetric Student-t (ASt) distributions,<span class="citation" data-cites="Zhu2010"><sup><a href="#ref-Zhu2010" role="doc-biblioref">4</a></sup></span> whose mean was determined by a common neuropil signal contributing to both ROI and surrounding fluorescence:</p>
<p><span class="math display">\[\begin{align}
f_r(t) &amp;\sim \mathrm{ASt}(\alpha z(t) + \mu_r, \sigma^2) \\
f_n(t) &amp;\sim \mathrm{ASt}(z(t) + \mu_n, \sigma^2 / N) \\
Expand All @@ -31,10 +33,25 @@ <h1 id="model-description">Model description</h1>
<p>The following figure represents the corresponding probabilistic graphical model, gray nodes indicating observed variables and white nodes latent variables.</p>
<p><img src="f9420a611d0987ff66e9541d0ef5e35e0a98ed76.svg" /></p>
<p>The advantage of this approach over other methods, lies in the use of the ASt distribution to model deviations in both ROI and surround signals. The long right tail of the ASt distribution helps prevent over-estimating the neuropil component for densely active cells. At the same time, the use of the ASt distribution for the surround signal helps account for transient increases in fluorescence arising from unannotated neurites or cell bodies, which could otherwise result in false negative transients in the corrected trace.</p>
<p>The challenge of fitting this model is that the posterior distributions over model parameters, including the neuropil trace <span class="math inline">\(z(t)\)</span>, cannot be computed exactly. Instead, we use the black-box stochastic variational inference (BBSVI) with reparametrization gradients to fit an approximate posterior distribution.</p>
<p>The challenge of fitting this model is that the posterior distributions over model parameters, including the neuropil trace <span class="math inline">\(z(t)\)</span>, cannot be computed exactly. Instead, we use the black-box stochastic variational inference (BBSVI) with reparametrization gradients<span class="citation" data-cites="Ranganath2014 Titsias2014 Kucukelbir2017"><sup><a href="#ref-Kucukelbir2017" role="doc-biblioref">1</a><a href="#ref-Titsias2014" role="doc-biblioref">3</a></sup></span> to fit an approximate posterior distribution.</p>
<p>The neuropil corrected fluorescence trace will then be estimated as the “noise” of the ASt model:</p>
<p><span class="math display">\[f(t) = f_r(t)- \hat{\alpha} \hat{z}(t)\]</span></p>
<p>where <span class="math inline">\(\hat{\alpha}\)</span> and <span class="math inline">\(\hat{z}(t)\)</span> are point estimates derived from the approximate posterior distribution, e.g. its mean.</p>
<p>The ASt model is not limited to finding common contaminating signals in two traces. In principle, we could split the neuropil donut into multiple sectors and provide a trace for each one of them. <code>fit_ast_model</code> can also correct for baseline drift as a part of the neuropil estimation procedure.</p>
<h1 id="references" class="unnumbered">References</h1>
<div id="refs" class="references" role="doc-bibliography">
<div id="ref-Kucukelbir2017">
<p>1. Kucukelbir A, Tran D, Ranganath R, Gelman A, Blei DM. Automatic differentiation variational inference. Journal of Machine Learning Research. 2017;18:14:1–14:45.</p>
</div>
<div id="ref-Ranganath2014">
<p>2. Ranganath R, Gerrish S, Blei DM. Black box variational inference. In: Proceedings of the seventeenth international conference on artificial intelligence and statistics, AISTATS 2014, reykjavik, iceland, april 22-25, 2014. Vol. 33. JMLR.org; 2014. pp. 814–822. (JMLR workshop and conference proceedings).</p>
</div>
<div id="ref-Titsias2014">
<p>3. Titsias MK, Yau C. Hamming ball auxiliary sampling for factorial hidden markov models. In: Ghahramani Z; Welling M; Cortes C; Lawrence ND; Weinberger KQ, editors. Advances in neural information processing systems 27: Annual conference on neural information processing systems 2014, december 8-13 2014, montreal, quebec, canada. 2014. pp. 2960–2968.</p>
</div>
<div id="ref-Zhu2010">
<p>4. Zhu D, Galbraith JW. A generalized asymmetric student-t distribution with application to financial econometrics. Journal of Econometrics. 2010;157(2):297–305. doi:<a href="https://doi.org/10.1016/j.jeconom.2010.01.013">10.1016/j.jeconom.2010.01.013</a></p>
</div>
</div>
</body>
</html>
15 changes: 12 additions & 3 deletions docs/model.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# Model description
---
title: ASt model description
bibliography: references.bib
link-citations: true
csl: council-of-science-editors-alphabetical.csl
css: style.css
---

There are several approaches for dealing with neuropil contamination, the most
common involve subtracting the surrounding neuropil fluorescence from each ROI
with a scale factor determined by linear regression or hand-picked manually.

We fit both ROI and surround fluorescence to asymmetric Student-t (ASt)
distributions, whose mean was determined by a common neuropil signal
distributions [@Zhu2010], whose mean was determined by a common neuropil signal
contributing to both ROI and surrounding fluorescence:

\begin{align}
Expand Down Expand Up @@ -56,7 +62,8 @@ otherwise result in false negative transients in the corrected trace.
The challenge of fitting this model is that the posterior distributions over
model parameters, including the neuropil trace $z(t)$, cannot be computed
exactly. Instead, we use the black-box stochastic variational inference (BBSVI)
with reparametrization gradients to fit an approximate posterior distribution.
with reparametrization gradients [@Ranganath2014;@Titsias2014;@Kucukelbir2017]
to fit an approximate posterior distribution.

The neuropil corrected fluorescence trace will then be estimated as the "noise"
of the ASt model:
Expand All @@ -70,3 +77,5 @@ The ASt model is not limited to finding common contaminating signals in two
traces. In principle, we could split the neuropil donut into multiple sectors
and provide a trace for each one of them. `fit_ast_model` can also correct for
baseline drift as a part of the neuropil estimation procedure.

# References
Loading

0 comments on commit f5957dd

Please sign in to comment.