<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Amogh Jalihal</title>
		<description>Welcome to my website!</description>		
		<link></link>
		<atom:link href="/feed.xml" rel="self" type="application/rss+xml" />
		
			<item>
				<title>The Political Philosophy of Zhang Taiyan</title>
				<description>&lt;p&gt;Viren Murthy reflects on  Zhang Taiyan’s (&lt;a href=&quot;https://en.wikipedia.org/wiki/Zhang_Binglin&quot;&gt;章太炎&lt;/a&gt;) essays developing a critique of modernity using a Yogacara Buddhist framework.&lt;/p&gt;

&lt;p&gt;Zhang Taiyan is writing from Tokyo in the early 20th century, first with a strong anti-Manchu stance, that colors his views on imperialism, and then more generally a Buddhist interpretation of identity and nationhood in modernity. The Manchus primarily followed Confucianism, and Zhang attacks the Heavenly principle using Daoist and Buddhist arguments.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/960px-Sakyamuni,_Lao_Tzu,_and_Confucius_-_Google_Art_ProjectFXD.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Zhang Taiyan constructs arguments using &lt;em&gt;karma&lt;/em&gt; and &lt;em&gt;vasana&lt;/em&gt; (perfumation) and the &lt;em&gt;astavijnanani&lt;/em&gt; to synthesize ideas ranging from evolution to conceptualizing modernity.&lt;/p&gt;

&lt;p&gt;(Murthy pp. 157, Ch 5)&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;Just as a cloth acquires the scent of nearby perfume, humans’ behaviour and mental activity are conditioned by karmic actions and experiences.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In Yogacara, this metaphor is used to show that that the self is constantly confused and clings to things in the world.&lt;/p&gt;

&lt;h1 id=&quot;evolution-and-history&quot;&gt;Evolution and History&lt;/h1&gt;
&lt;ol&gt;
  &lt;li&gt;The notion of &lt;em&gt;karma beeja&lt;/em&gt; the seeds of karma that lay hidden underground that cause unseen/unknowable roots of the present fruits &lt;em&gt;karmaphala&lt;/em&gt; of past action plays an axiomatic role in structuring Zhang’s argument. (Lusthaus, On the plant metaphor)
Zhang:
    &lt;blockquote&gt;
      &lt;p&gt;One cannot negate the fact of evolution, but one should not accept the affects of evolution on us
Murthy (pp 157):
Yogacara does posit a degree of collectiev karma which forms the condition for the possibility of human 
being’s perceptural workd and communication. In Zhang’s view, this collective karma is grounded in alaya consciousness, which he claims is identical to living things. 
    &amp;gt; “All living things are the same as sychness (tathata); they are the same as alaya consiousness. Therefore consciousness is not limited to one’s body.”&lt;/p&gt;
    &lt;/blockquote&gt;
  &lt;/li&gt;
  &lt;li&gt;Zhang is able to connect Evolution to the karmic cycle:
    &lt;blockquote&gt;
      &lt;p&gt;Why do morality and immorality advance together? One cause is perfuming. Sentient being’s
original natures are neither virtuous nor immoral, but through action they can become virtuous
or immoral. Alaya consciousness is a state of non impedimentary moral neutrality (alklista-avyakarta).
Manas consciousness is a state of impedimentary moral neutrality. With consciousness we began to  have virtue, immorality, and neutrality. 
Pure neutrality is called original seeds. When good and bad are mixed, this refers to when the seeds begin to sprout.
All things advance according to the law of evolution; hence they cannot stay ath the level of neutrality.
One must mix the seeds of good and bad. The only creature that does not mix these two is the earliest amoeba.
From that time on beacuse there are impediments, various types of good and bad slowly appear and develop. 
They perfume the original consciousness and become seeds
Finally, Zhang develops the argument that the “confusion” of one’s identity with alaya consciousness causes one’s “will to win”, and hence tries to explain the destructive arc of imperialism as an outcome of this primordial “confusion”.&lt;/p&gt;
    &lt;/blockquote&gt;
  &lt;/li&gt;
  &lt;li&gt;Zhang posits that history cannot be merely progressive. He argues that more false identity causes a greater good in terms of progression of science but also great evil. So modernity beckons extreme versions of both good and evil.
Murthy:
    &lt;blockquote&gt;
      &lt;p&gt;[Zhang] asserts … that history or evolution is not linear but moves in two directions. As the good progresses so does the bad; as pleasure increases so does pain.&lt;/p&gt;
    &lt;/blockquote&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h1 id=&quot;notes-from-chapters&quot;&gt;Notes from chapters&lt;/h1&gt;
&lt;ol&gt;
  &lt;li&gt;Introduction: Zhang Taiyan and Chinese modernity
Takeuchi Yoshimi, writing about Zhang’s student Lu Xun’s conceptualization of Chinese anti-imperialism:
    &lt;blockquote&gt;
      &lt;p&gt;Modernity is the self-recognition of Europe as seen within history,
the taking as a self thatself that separates itsefl from feudalism, which
Europe gained in the proecss of linterating itself from the feudal. 
Therefore it can be said that Europe is first possible only in this
history and that history itself is possible in this Europe.&lt;/p&gt;
    &lt;/blockquote&gt;
  &lt;/li&gt;
  &lt;li&gt;Zhang’s Critique of Kang Youwei: Anti-Manchurism, the National Essenece, and the Revolution&lt;/li&gt;
  &lt;li&gt;Buddhist Epistemology and Modern Self-Identity: Zhang Taiyan’s “On Establishing Religion”
Murthy:
    &lt;blockquote&gt;
      &lt;p&gt;… in Zhang’s view, the belief in the legitimacy of the state and in progress
and science are both regligious.  Such religious beliefs not only legitimate
the oppression of individuals in a society, but, Zhang contended, they are used
as fig leads by imperialists. Hence, unlike almost all of his contemporaries, 
Zhang did not think of religion and science as opposed. In fact, …, he connected key
scientific concepts, such as evolution, to a relgigious attribution of existence to that
which is illusory.
Murthy pp 158:&lt;/p&gt;

    &lt;/blockquote&gt;
  &lt;/li&gt;
  &lt;li&gt;Transfiguring Modern Temporality: Zhang Taiyan’s Critique of Evolutionary History&lt;/li&gt;
  &lt;li&gt;Daoist Equalization against the Universal Principle: Zhang Taiyan’s Critique of Late Qing Political Theory
    &lt;blockquote&gt;
      &lt;p&gt;… Internationally stats have turned into imperialist man-eaters that bring to 
mind the beast-races/rulers on four sides, Hun Dun, Tao Tie, Tao Wu, and Quing Qi. …
These four terms refer to mythical beasts that have merely fictional existence, especially
when placed in the context of a scientific worldview. … Zhang hopes that by involing
the fantastical and mythical, he can make his critique and yet avoid a simple re-inscription
of the civilization-barbarism dichotomy, which he believes is presuppsed by the scientific
worldview.&lt;/p&gt;
    &lt;/blockquote&gt;
  &lt;/li&gt;
  &lt;li&gt;Conclusion: Zhang Taiyan, Lu Xun, Wang Hui: The Politics of Imagining a Better Future&lt;/li&gt;
&lt;/ol&gt;

&lt;h1 id=&quot;scholars-i-want-to-follow-up-on&quot;&gt;Scholars I want to follow up on&lt;/h1&gt;
&lt;ol&gt;
  &lt;li&gt;Prasenjit Duara&lt;/li&gt;
  &lt;li&gt;Arif Dirlik&lt;/li&gt;
&lt;/ol&gt;
</description>
				<pubDate>Sat, 21 Feb 2026 00:00:00 +0000</pubDate>
				<link>/2026/02/21/zhang-taiyan.html</link>
				<guid isPermaLink="true">/2026/02/21/zhang-taiyan.html</guid>
			</item>
		
			<item>
				<title>Why are 20nt primers sufficiently unique in the human genome?</title>
				<description>&lt;script src=&quot;https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;

&lt;p&gt;I recently came across a neat information theoretic proof of why a primer of length 20nt is pretty much unique in the human genome.  I decided to work it out for myself using plain probabilities first.&lt;/p&gt;

&lt;h2 id=&quot;the-problem&quot;&gt;The problem&lt;/h2&gt;

&lt;p&gt;Given the genome of size \(N\), how long \(n\) should a primer be to statistically match uniquely in the genome.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;You can skip the first section if you want to see the Shannon entropy demonstration of the same idea.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Assumptions:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;The genome is generated randomly from the 4 bases. This is not really true, but I can roll with it for now, ignoring repeat regions.&lt;/li&gt;
  &lt;li&gt;The four bases occur with equal probability 0.25. This isn’t very important, and can be easily adapted to genome specific GC content&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;the-straightforward-approach---generate-all-possible-oligonucleotides-of-length-n&quot;&gt;The straightforward approach - generate all possible oligonucleotides of length &lt;em&gt;n&lt;/em&gt;&lt;/h2&gt;

&lt;p&gt;I further assume that all the ‘substrings’ of the genome are independent of each other, the given genome can be split up into smaller contiguous chunks as illustrated below.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/primer-uniqueness.png&quot; alt=&quot;The contiguous sequence of bases can be treated as being independent of each other for any substring size n.&quot; /&gt;.&lt;/p&gt;

&lt;p&gt;This means I can break up the genome of length &lt;em&gt;N&lt;/em&gt; which is hard to think about, into many many “draws” of oligonucleotides of varying lengths.&lt;/p&gt;

&lt;p&gt;I am working through this in steps because this is how I convinced myself of this result.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;What is the totalf number of occurences of a sequence of length &lt;em&gt;n=1&lt;/em&gt;. Note: each position can be one of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;{A,T,G,C}&lt;/code&gt;. From assumption (2) above, for a nucleotide &lt;em&gt;b&lt;/em&gt;, its probability of occurence  p(b)  is 0.25.
The total number of occurences can be calculated as &lt;strong&gt;the probability of any instance substring of length &lt;em&gt;n=1&lt;/em&gt;&lt;/strong&gt; times the &lt;strong&gt;number of occurences of length &lt;em&gt;n=1&lt;/em&gt;&lt;/strong&gt; substrings in the genome. I am going to compute these two separately.&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;There are only 4 unique &lt;em&gt;n=1&lt;/em&gt; mononucleotides possible, namely, “A”, “T”, “G”, “C”. The probability of any one instance of these four occuring is 0.25 (which is p(b) from above).&lt;/li&gt;
      &lt;li&gt;The total number of such substrings is p(b)*N because there are N such mononucleotide sequences in the genome.&lt;/li&gt;
    &lt;/ul&gt;

    &lt;p&gt;This tells us that there are N*p(b) occurences of any single one nucleotide string. This makes sense, a quarter of the nucleotides will be the same from assumption (2).&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Next, what is the total number of occurences of a sequence of length &lt;em&gt;n=2&lt;/em&gt;. Now, the possible dinucleotides can be &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;{AA, AT, AG,....,CC}&lt;/code&gt;, i.e. 16 possible dinucleotides. Each of these two positions can be filled independently,&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;The probability of occurence of any one instance of a dinucleotide is p(b)*p(b) = 0.25*0.25 = 0.0625. (this is the same as 1/16 possible.)&lt;/li&gt;
      &lt;li&gt;The genome of length N has N-1 contiguous dinucleotides. See figure above for an illustration of why this is true.&lt;/li&gt;
    &lt;/ul&gt;

    &lt;p&gt;Now, I have (N-1)*p(b)^2 occurences of any dinucleotide sequence.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Let me work out one last example, for &lt;em&gt;n=3&lt;/em&gt;.  The possible trinucleotides are &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;{AAA, AAT, ..., CCC}&lt;/code&gt;, i.e. 4^3 = 64 possible trinucleotides.&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;The probability of occurence of a given trinucleotide is p(b)*p(b)*p(b) = 0.25^3.&lt;/li&gt;
      &lt;li&gt;The number of occurences of contiguous trinucleotides is N-2.&lt;/li&gt;
    &lt;/ul&gt;

    &lt;p&gt;I thus have (N-2)*p(b)^3 occurences of trinucleotides.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I can generalize this pattern now. For a given oligonucleotide of length &lt;em&gt;n&lt;/em&gt;, the number of occurences of any particular oligonucleotide in the genome is going to be &lt;em&gt;(N-n+1)*p(b)^n&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Great, but why did I come up with this expression? I wanted to find the length of a primer which is guaranteed to occur &lt;em&gt;exactly once&lt;/em&gt; in the genome, which is hopefully our target sequence. I can now solve for this explicitly.  I want the number of occurences to be exactly 1.&lt;/p&gt;

&lt;p&gt;Solve for &lt;em&gt;n&lt;/em&gt; such that:&lt;/p&gt;

\[(N-n+1)p(b)^n = 1\]

&lt;p&gt;Let us make a quick simplification at this point. I know that typical genomes are massive compared to the size of the primers. I can thus simplify (N-n+1) to N.&lt;/p&gt;

\[N p(b)^n = 1 \implies n \log(p(b)) = -\log(N) \implies n = -\log(N)/\log(p(b))\]

&lt;p&gt;Lets plug in some values now. If the human genome has length 3e9bp, -log(3*10^9)/log(0.25) = 15.7 which I round up to 16. This result tells us that given our assumptions, any random 16-mer should occur only once in the human genome.&lt;/p&gt;

&lt;h1 id=&quot;how-surprising-is-to-find-an-oligonucleotide-of-length-n-in-the-human-genome&quot;&gt;How surprising is to find an oligonucleotide of length &lt;em&gt;n&lt;/em&gt; in the human genome?&lt;/h1&gt;

&lt;p&gt;Claude Shannon’s work on information theory allows us to pose questions like the one above.&lt;/p&gt;

&lt;p&gt;The Shannon Entropy allows us to capture the degree of uncertainty in a probability distribution. Alternatively, I think of it as the degree of surprise we expect for any event sampled from a probability distribution.  We can thus pose the question, how long must an oligonucleotide sequence be such that it is surprising to find it in the genome?&lt;/p&gt;

&lt;p&gt;Shannon Entropy is mathematically defined as \(H_x =- p(x) \log(p(x))\) where p(x) is the probability of occurence of event x.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I am interested in calculating the surprise of occurence of an &lt;em&gt;n&lt;/em&gt; length oligomer, which is the sum of entropies of all possible nucleotide states at a given position.&lt;/strong&gt;&lt;/p&gt;

\[H_n =- \Sigma_{i=1}^{n} \Sigma_{b \in \text{ATGC}} p(b) \log(p(b)) = - n (4 p(b) \log(p(b))) = n \log(1/p(b))\]

&lt;p&gt;&lt;em&gt;(Note: I have cancelled out the 4*p(b) above in this case because p(b)=1/4)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I want to compare this surprise to the random occurence of any length &lt;em&gt;n&lt;/em&gt; oligo across the genome. Because of assumption (1) above, any random oligo of any length has an equal chance of occuring anywhere in the genome. For a genome of length N, p(occurence) = 1/N. I denote this with p(o). I can calculate the Shannon Entropy for the (uniform) distribution of motifs of length n across the genome.  Here again, I assume that n« N, so I don’t have to be too careful with the summation bounds.&lt;/p&gt;

\[H_o = -\Sigma_{i=1}^{N} p(o) \log(p(o)) = -N p(o) \log(p(o)) = -N/N \log(1/N) = \log(N)\]

&lt;p&gt;Finally, when does \(H_n \geq H_o\) i.e., the surprise of seeing a random sequence of oligonucleotides exceed the surprise of finding it in the genome?&lt;/p&gt;

&lt;p&gt;i.e. \(n \log(1/p(b)) \geq \log(N) \implies n \geq -\log(N)/\log(p(b))\)&lt;/p&gt;

&lt;p&gt;This is the same expression as the one above!&lt;/p&gt;

&lt;p&gt;It took me a while to convince myself that the above comparison of entropies over two different random variables was OK. One way that I’ve convinced myself is to ask when is the uncertainty of an &lt;em&gt;n&lt;/em&gt; length oligonucleotide greater than the uncertainty of finding a random &lt;em&gt;n&lt;/em&gt; length sequence anywhere in the genome.  I am still not entirely clear what assumptions I might be violating when I compare these two quantities, and I’ll probably post a follow up to this when I learn more.&lt;/p&gt;

&lt;h2 id=&quot;takehomes&quot;&gt;Takehomes&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;The choice of 20nt exceeds the predicted 16nt for the human genome.  This essentially guarantees a unique target sequence, as long as we are not looking for repeat regions.&lt;/li&gt;
  &lt;li&gt;Both the standard probability based approach and the information theory approach lead to the same result. The second approach however is much more powerful because of its simplicity.&lt;/li&gt;
  &lt;li&gt;The general result is that if each letter in an alphabet of size (A) occurs with equal probability, the shortest “word” that will appear at most once in a book of N letters will be given by 
\(- \log(N)/log(p), p = 1/A\)&lt;/li&gt;
  &lt;li&gt;We are interested in the case where the letters don’t all have the same frequency. In this case, the expression will be modified to \(n \geq - \log(N) \frac{1}{\Sigma_{b \in A} p(b) \log p(b)}\).  In the case of DNA, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;A = {A,T,G,C}&lt;/code&gt;, where we can estimate p(A), p(G), p(T), p(C) from the GC content of the genome&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I am starting to grok Shannon Entropy and applications of information theory in biology now. I have been thinking about protein and nucleotide motifs and how to test for their statistical significance. There is a whole world of information theory crossed with Markov Models that I am excited to get into!&lt;/p&gt;

</description>
				<pubDate>Thu, 28 Dec 2023 00:00:00 +0000</pubDate>
				<link>/2023/12/28/primer-uniqueness.html</link>
				<guid isPermaLink="true">/2023/12/28/primer-uniqueness.html</guid>
			</item>
		
			<item>
				<title>Eichmann in Jerusalem by Hannah Arendt</title>
				<description>&lt;p&gt;Arendt poses and develops a variety of critiques of the Israeli court that tried Adolf Eichmann in the Jerusalem trial of 1961.  The argument that stood out the most, posed in the epilogue of this book reveals the understanding of the Hitler’s genocide through the point of Jewish self identity.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;…how little Israel, like the Jewish people in general, was preprared to recognize in the crimes that Eichmann was accused of, &lt;strong&gt;an unprecedented crime&lt;/strong&gt;, and precisely how difficult such a recognition must have been for the Jewish people. In the eyes of the Jews, thinking exclusively in terms of their own history, the catastrophe that had befallen them under Hitler in which a third of the people had perished, appeared not as the most recent of crimes, the unprecedented crime of genocide, but on the contrary as the oldest crime they knew and remembered. This misunderstanding… is actually at the root of all the failures and shortcomings of the Jerusalem trial.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Arendt goes on to argue that the failure that is alluded to above, is the failure of the Israeli court to set a precedent for &lt;em&gt;international law&lt;/em&gt; to create a framework under which to understand genocide, by rather focusing on the Jewish perception of the genocide as a part of a long Jewish experience.&lt;/p&gt;

&lt;p&gt;To me, this is the first argument that I’ve read that chooses to focus on the shared humanity between the perpetrators and the victims of the genocide, and hints at a framework to move beyond communal crimes. What stands out here is that by choosing a legalistic framework, she is making a strong assumption about the equality of all of humanity under the law. On the contrary, the Israeli court is coming from a position of Jewish self identity and experience, carefully crafting an image of the strength of the survivors. There is a &lt;em&gt;moral&lt;/em&gt; sense in which the localization of the genocide to the &lt;em&gt;Jewish&lt;/em&gt; experience is important as a formative component of their self image, particularly for the Israeli state.  The role of the Eichmann trials in giving voice to the survivors of the Holocaust in a way that the Nuremberg trials had not, has created a space for a cultural reckoning, a feedback of self reflection on collective experience.&lt;/p&gt;

&lt;p&gt;Probably because she wrote the book so soon after the trial, Arendt does not grapple with the importance of this event for the Jewish people. However, the reason she attended the trial itself was because she thought it would be the last chance for her to truly understand the horrors of the holocaust. So perhaps she, a Jewish exile from Nazi Germany, implicitly understood the importance of the trial  for the Jewish people. This makes her criticism of the trial even more intriguing and bold.&lt;/p&gt;

</description>
				<pubDate>Tue, 26 Dec 2023 00:00:00 +0000</pubDate>
				<link>/2023/12/26/eichmann.html</link>
				<guid isPermaLink="true">/2023/12/26/eichmann.html</guid>
			</item>
		
			<item>
				<title>Custom elisp function to jump to analysis folders</title>
				<description>&lt;p&gt;At work, I have adopted a project ID system from Julius Palme, who in turn attributes the system to Jue Wang.  The system is pretty simple:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Each project gets a two letter code&lt;/li&gt;
  &lt;li&gt;Each experiment under the project is numbered, starting with 1.&lt;/li&gt;
  &lt;li&gt;A repeat of the experiment is further labeled A-Z.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The advantage of this system is that everything is labeled systematically, including cloning experiments, strains, and even phenotyping experiments.&lt;/p&gt;

&lt;p&gt;I use this system even for theory/modeling, bioinformatics, and general data analysis.  I have now accumulated around a 150 folders across around 8 projects, which look like this&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;  drwxrwxr-x   3 jalihal jalihal  4096 Sep 26 16:53 2023-09-12-am3-sand-gradient
  drwxrwxr-x  10 jalihal jalihal  4096 Sep 16 19:26 2023-07-19-xa33-evolution
  drwxrwxr-x   3 jalihal jalihal  4096 Sep  1 11:29 2023-08-30-nf9-nf10-analysis
  drwxrwxr-x   2 jalihal jalihal  4096 Sep  1 11:29 2023-08-31-xa37-ph-test
  drwxrwxr-x   3 jalihal jalihal  4096 Aug 30 11:16 2023-08-30-nf11-lb-timecourse
  drwxrwxr-x   3 jalihal jalihal  4096 Aug 22 22:47 2023-07-07-xa31-environmental-samples
  drwxr-xr-x   3 jalihal jalihal  4096 Aug  3 18:14 2022-10-11-ts138
  drwxrwxr-x   2 jalihal jalihal  4096 Jul 17 14:14 2023-07-10-xa32-biofilm-growth
  drwxrwxr-x   3 jalihal jalihal  4096 Jul 17 08:48 2023-07-06-xa26
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Here, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;am3&lt;/code&gt; is the third experiment/analysis I’ve performed for the project &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;am&lt;/code&gt;.  The directory name further records the time stamp of the start of this experiment/analysis, and optionally some keywords to help understand what this was about.&lt;/p&gt;

&lt;p&gt;I need to typically access the folders of roughly the past month at any given point in time, around 15 folders give or take.  The important thing is that I now remember the experiment IDs of these recent experiments, so it is easier to now access them in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dired&lt;/code&gt; by filtering for the the ID itself.  For some time now, I’ve wished for a way to jump directly to the experiment folder from any arbitrary location in emacs.  The following function does exactly this. (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;analysispath&lt;/code&gt; contains the path to the directory containing the folders shown above)&lt;/p&gt;

&lt;div class=&quot;language-emacs-lisp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;defun&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;aj/jump-to-analysis&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
  &lt;span class=&quot;s&quot;&gt;&quot;Jump to an analysis folder with a two letter-number ID&quot;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;interactive&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;let*&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;path&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;analysispath&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
         &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;files&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;directory-files&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
         &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;numfiles&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;length&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;files&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
         &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;counter&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
         &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;alltags&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()))&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;counter&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;numfiles&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;dolist&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;comp&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;split-string&lt;/span&gt;  &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;nth&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;counter&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;files&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;-&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;string-match-p&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;^[a-zA-Z][a-zA-Z][0-9]+&quot;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;comp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;progn&lt;/span&gt;
              &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;setq&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;alltags&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cons&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;format&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;%s&quot;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;comp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;nth&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;counter&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;files&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;alltags&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)))))&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;setq&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;counter&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;counter&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)))&lt;/span&gt;

    &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;switch-to-buffer&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;find-file-noselect&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;format&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;%s%s&quot;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;path&lt;/span&gt;  &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cdr&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;assoc&lt;/span&gt;
                                         &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;completing-read&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;jump to analysis:&quot;&lt;/span&gt; 
                                                         &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;mapcar&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;&apos;car&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;alltags&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
                                        &lt;span class=&quot;nv&quot;&gt;alltags&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
                          &lt;span class=&quot;p&quot;&gt;)))))&lt;/span&gt;
                          
&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;global-set-key&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;kbd&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;C-x j&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;&apos;aj/jump-to-analysis&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Finally, it was a nice touch to add some annotations for the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;marginalia&lt;/code&gt; package that I’ve come to enjoy using.&lt;/p&gt;

&lt;div class=&quot;language-emacs-lisp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;defun&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;my-analysis-annotator&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;cand&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;let*&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;path&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;analysispath&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
         &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;files&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;directory-files&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
         &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;numfiles&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;length&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;files&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
         &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;counter&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
         &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;counter&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;numfiles&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;string-match-p&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;regexp-quote&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;cand&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;nth&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;counter&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;files&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
          &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;setq&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;nth&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;counter&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;files&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)))&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;setq&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;counter&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;counter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)))&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;marginalia--fields&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:face&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;&apos;marginalia-documentation&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))))&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;add-to-list&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;&apos;marginalia-annotators-heavy&lt;/span&gt;
             &lt;span class=&quot;o&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;analysis&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;my-analysis-annotator&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This function looks up the prompt of completing read to see if it matches a regexp defined under the keyword &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;analysis&lt;/code&gt;, and defines an annotator that looks up the analysis ID in each filename, and just displays the filename as the annotation.  Lots of possibilities for this ahead!&lt;/p&gt;

&lt;p&gt;Finally, I added a new prompt category in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;customize&lt;/code&gt; interface for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;marginalia-prompt-categories&lt;/code&gt; that looks for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;\&amp;lt;analysis\&amp;gt;&lt;/code&gt; in the prompt, so I’m simply looking to the word “analysis”.&lt;/p&gt;

&lt;p&gt;So now I simply type in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;C-x j&lt;/code&gt;, get a completion prompt for all the experiment IDs that I have in the folder, with each experiment ID annotated with the corresponding full file name.&lt;/p&gt;

&lt;p&gt;Works like a charm!&lt;/p&gt;
</description>
				<pubDate>Mon, 02 Oct 2023 00:00:00 +0000</pubDate>
				<link>/2023/10/02/custom-analysis-folder-completion.html</link>
				<guid isPermaLink="true">/2023/10/02/custom-analysis-folder-completion.html</guid>
			</item>
		
			<item>
				<title>A note on fractional dilution</title>
				<description>&lt;script src=&quot;https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;

&lt;p&gt;I’ve been working on extending the capabilities of the &lt;a href=&quot;https://www.fynchbio.com/&quot;&gt;eVOLVER&lt;/a&gt; system.  The eVOLVER is an open source platform with 16 reactor sleeves with individual control of temperature, stir rates and media flow rates into each reactor.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/41587_2018_Article_BFnbt4151_Fig2_HTML.webp&quot; alt=&quot;Figure 2 from Wong et al 2018, Nature Biotech. They don&apos;t in fact measure OD600 as this figure would have you believe.&quot; /&gt;&lt;/p&gt;

&lt;p&gt;While attempting to improve the quality of &lt;a href=&quot;https://en.wikipedia.org/wiki/OD600&quot;&gt;OD measurements&lt;/a&gt;, we recognized that the main source of noise in these measurements came from the glass vial itself.   One solution to this problem is to redo an OD calibration in the glass vial directly.  I propose to do this by starting with a dense culture, and sequentially adding a fixed bolus of media until we span the OD range that we are interested in.  By recording the sensor values (there are two sensors that record the scattering of 900nm light through the culture) at each dilution step, we can use this calibration data to then infer real ODs during an experiment.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;The Proposal&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If I dispense a fixed bolus of media and record the sensor readings, I’ll be able to construct a calibration curve. Here is an example of the outcome of this calibration, with the red dots being the sensor readings at each dilution curve, and the colored dots representing the timecourse, with bright colors representing later times.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/fractional-dilution-illustration.png&quot; alt=&quot;Left: An illustration of the fractional dilution scheme with repeated additions of a fixed bolus of media to a dense culture. Right: An example of a successful calibration, the axes show the sensor readings, and the red points show readings at discrete dilution events&quot; width=&quot;10%&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;The Problem&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Given a 20mL culture at OD 1, I need to dilute this down to an OD of 0.01 &lt;em&gt;in the vial&lt;/em&gt;.  &lt;strong&gt;How much media do I need?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If vial volume wasn’t a constraint, &lt;em&gt;per&lt;/em&gt; &lt;em&gt;c1 v1 = c2 v2&lt;/em&gt;, I’ll need 20mL*(1/0.01) ≅ 2000mL &lt;em&gt;per vial&lt;/em&gt; !
That would mean, for 16 vials, I’d need about &lt;strong&gt;32L of media&lt;/strong&gt; which is ridiculous.&lt;/p&gt;

&lt;p&gt;Stepping back a second, I didn’t actually do this calculation when I was testing out the dilution strategy.  I just went ahead and dispensed a fixed “bolus” into each vial.  The first time I add the bolus, the effective dilution is&lt;/p&gt;

&lt;p&gt;\(c_{\text{first dilution}} = c_{\text{initial}} \frac{V}{V + bolus}\).&lt;/p&gt;

&lt;p&gt;I then aspirate off the bolus volume, so the total volume is again &lt;em&gt;V&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The second time I do it, it becomes&lt;/p&gt;

&lt;p&gt;\(c_{\text{second dilution}} = c_{\text{first dilution}} \frac{V}{V + bolus} = c_{\text{initial}} \left(\frac{V}{V + bolus}\right)^2\).&lt;/p&gt;

&lt;p&gt;At the end of \(n\) steps, my final concentration is&lt;/p&gt;

\[c_n = c_{\text{initial}}\left(\frac{V}{V + bolus}\right)^n\]

&lt;p&gt;For a volume &lt;em&gt;V&lt;/em&gt; going from &lt;em&gt;startOD&lt;/em&gt; to &lt;em&gt;endOD&lt;/em&gt; with additions of &lt;em&gt;bolus&lt;/em&gt;mL media at each step, I calculated that I’d need &lt;em&gt;n&lt;/em&gt; dilution steps, where&lt;/p&gt;

\[n = \frac{\log(endOD/startOD)}{\log(V/(V + bolus))}\]

&lt;p&gt;I noticed that I always needed far less than the predicted 32L of media for a 100X dilution. In fact, it was always less than 2L for all 16 vials put together. &lt;strong&gt;Was I doing something wrong?&lt;/strong&gt; How was I so efficiently diluting over 2 orders of magnitude with such a small total volume of media?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;The Theory&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So what was the total cumulative volume being consumed in my calibration procedure? Well, for the fixed bolus size, it was as simple as&lt;/p&gt;

\[V_{\text{cumulative}} = n \text{bolus} = \text{bolus} \frac{\log(endOD/startOD)}{\log(V/(V + \text{bolus}))}\]

&lt;p&gt;That didn’t mean much to me, so I plotted it out.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does the cumulative volume dispensed change with different bolus sizes dispensed?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/example-fractional-dilution-cumulative-volume-dependence.png&quot; alt=&quot;Variation of number of dilution steps (left) and total volume dispensed (right) with bolus size for a volume of 22mL over a 100X dilution range.&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Two observations stood out to me.&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;At large bolus sizes, the number of dilution steps needed went down. This makes sense.&lt;/li&gt;
  &lt;li&gt;As the bolus size &lt;em&gt;decreased&lt;/em&gt;, the total volume dispensed seemed asymptotically reach a lower limit. Huh?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So I decided to calculate the \(\text{lim}_{\text{bolus}\rightarrow 0} V_{\text{cumulative}}\).&lt;/p&gt;

\[\text{lim}_{\text{bolus}\rightarrow 0} \text{bolus} \frac{\log(endOD/startOD)}{\log(V/(V + \text{bolus}))}\]

&lt;p&gt;I’d forgotten how to solve this limit when things were going to zero in the numerator and denominator. &lt;a href=&quot;https://sushrutk.github.io/&quot;&gt;Sushrut Karmalkar&lt;/a&gt; reminded me to apply  l’Hopital’s rule and differentiate the two parts&lt;/p&gt;

&lt;p&gt;Numerator: \(\frac{d}{d \text{bolus}}\text{bolus} \log(endOD/startOD) = \log(endOD/startOD)\)&lt;/p&gt;

&lt;p&gt;Denominator: \(\frac{d}{d \text{bolus}} \log(V/(V + \text{bolus})) = \frac{1}{V/(V+bolus)} \frac{-V}{(V+bolus)^2} = \frac{-1}{(V+bolus)} = \frac{-1}{V}\) as bolus goes to zero.&lt;/p&gt;

&lt;p&gt;Putting this together:&lt;/p&gt;

\[\text{lim}_{\text{bolus}\rightarrow 0} V_{\text{cumulative}}= -V \log\frac{endOD}{startOD} = \boxed{V \log \frac{startOD}{endOD}}\]

&lt;p&gt;This was pretty cool! So over a 100X dilution for a volume of 22mL, I’d only need about 22ln(100) = 22*4.6 = 101.9 mL! Nowhere close to the 2L if I was to do the entire dilution in a single step.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What did I just read&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I’ve been scratching my head about this one for a few days now.  This seems to be a general result in fractional dilution systems. I immediately thought of fractional killing in chemotherapy, or  multiple doses of antibiotics.  The intuition for these systems is always that we are killing off a fixed fraction of cancer cells/pathogens at each dose.  But the result above indicates that repeated doses allows for a reduction of the total amount of therapeutic used as well! This is pretty cool.&lt;/p&gt;

&lt;p&gt;I looked around briefly for other domains where this law comes up.  The only other thing I’ve been able to find is what is called the &lt;a href=&quot;https://en.wikipedia.org/wiki/Dilution_(equation)&quot;&gt;Basic Room Purge Equation&lt;/a&gt; which states that in order to reduce the concentration of a particular gas say carbon monoxide in a room, the time required at a flow rate of clean air Q in a room of volume V is&lt;/p&gt;

\[D_t = \frac{V}{Q}\log \frac{C_i}{C_f}\]

&lt;p&gt;Very interesting.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Moral of the story&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;I continue to be convinced that I don’t have a strong intuition for fractions.&lt;/li&gt;
  &lt;li&gt;This fractional dilution law definitely has a lot of applications.  Let me know if this has been discussed at length somewhere!&lt;/li&gt;
&lt;/ol&gt;
</description>
				<pubDate>Tue, 09 May 2023 00:00:00 +0000</pubDate>
				<link>/2023/05/09/fractional-dilution.html</link>
				<guid isPermaLink="true">/2023/05/09/fractional-dilution.html</guid>
			</item>
		
			<item>
				<title>Shadi Hamid&apos;s The Problem with Democracy</title>
				<description>&lt;p&gt;Hamid proposes &lt;em&gt;democratic minimalism&lt;/em&gt; as the strategy for American foreign policy in the Middle East, and to decouple expectations of liberal outcomes from democracy promotion.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;What Hamid manages to do&lt;/em&gt; is to&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;be consistent in his application of democratic minimalism in his critique of the Obama and Biden administrations.  He points out that Trump was disinterested in American interference in the Middle East and beyond, and cannot be accused of the hypocrisy of Obama and Biden.&lt;/li&gt;
  &lt;li&gt;lay out an analysis of the Islamic Brotherhood’s political success (and lack thereof) across the Middle East. This serves as a good introduction/reference to a critical but pro-Islamist view of the politics across the Middle East.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;Where Hamid falls short&lt;/em&gt; is&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;to convince the readers that promoting Islamist politics is actually what the people in the Middle East want.  In fact, Hamid does a good job of critically analyzing the lack of an ‘Islamic’ vision of the Brotherhood politics (c.f. &lt;a href=&quot;https://en.wikipedia.org/wiki/Hassan_al-Banna&quot;&gt;Hassan al-Banna&lt;/a&gt;), and how the attempts at ‘modernization’ have been met with criticism from ultraconservative Muslims.  Who does promoting an Islamist politics benefit?&lt;/li&gt;
  &lt;li&gt;to make a convincing case of the success of democracy promotion.  It is unfair to pose this question, but it would be pretty cool to setup a thought experiment to evaluate the success of the introduction of democracy in a non-Islamic context, instead of the polemics at the end of the book (chapters ‘On Hypocrisy’ and ‘On Power’).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I found the book to be a very engaging read because Hamid brings up many new ideas that could have taken him in completely different directions. Political leverage, agency of a nation-state, the “international community”.  I found myself wishing that Hamid had moved the characterization of Islamic politics (chapter 8 “Islamists in Government”) much earlier in the book to set the context.&lt;/p&gt;

</description>
				<pubDate>Thu, 23 Feb 2023 00:00:00 +0000</pubDate>
				<link>/2023/02/23/the-problem-with-democracy.html</link>
				<guid isPermaLink="true">/2023/02/23/the-problem-with-democracy.html</guid>
			</item>
		
			<item>
				<title>I&apos;ll be presenting a poster at ASCB 2022</title>
				<description>&lt;p&gt;Hi! I am a post doc in &lt;a href=&quot;https://springerlab.org/&quot;&gt;Michael Springer’s&lt;/a&gt; lab at Harvard Medical School. Please feel free to reach out to me with any questions you might have!&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/assets/images/ascb-2022.pdf&quot;&gt;Here is a link to my poster&lt;/a&gt;&lt;/p&gt;
</description>
				<pubDate>Wed, 30 Nov 2022 00:00:00 +0000</pubDate>
				<link>/2022/11/30/ascb2022.html</link>
				<guid isPermaLink="true">/2022/11/30/ascb2022.html</guid>
			</item>
		
			<item>
				<title>Fall in Massachusetts</title>
				<description>&lt;p&gt;&lt;img src=&quot;/assets/images/2022-10-22-otter-river-park-compressed.JPG&quot; alt=&quot;By the pond&quot; /&gt;&lt;/p&gt;
</description>
				<pubDate>Sun, 23 Oct 2022 00:00:00 +0000</pubDate>
				<link>/2022/10/23/fall.html</link>
				<guid isPermaLink="true">/2022/10/23/fall.html</guid>
			</item>
		
			<item>
				<title>SLURM notes</title>
				<description>&lt;p&gt;The compute cluster at HMS uses SLURM as a job scheduler.  It has taken be a good 6 months of working on the cluster on and off to have gotten efficient at using it as a compute cluster and not just a high powered node on the interactive partition.&lt;/p&gt;

&lt;p&gt;The painful part of the tooling in bioinformatics is that a lot of the pipelines eventually involve R, and R packages are really not meant to be run as scripts. I am still struggling to find a way of running R scripts with easy debugging from the command line.&lt;/p&gt;

&lt;h1 id=&quot;useful-bash-aliases&quot;&gt;Useful bash aliases&lt;/h1&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;alias &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;sint&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;srun --pty -p interactive -t 0-2:00 --mem 2G -c 2 /bin/bash&quot;&lt;/span&gt; 
&lt;span class=&quot;nb&quot;&gt;alias &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;ws&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;watch squeue -u &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;whomai&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;snakefile-cluster-config&quot;&gt;Snakefile cluster config&lt;/h1&gt;
&lt;div class=&quot;language-json highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;__default__&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;n&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;c&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;p&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;short&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;mem&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;4G&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;t&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;0-0:30&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;metaspades&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;c&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;mem&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;8G&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;t&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;0-0:45&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;cutadapt&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;c&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;mem&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;2G&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;t&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;0-1:00&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;kraken2&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;c&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;mem&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;64G&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;t&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;0-0:30&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;usearch&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;t&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;0-1:00&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;blca&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;mem&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;8G&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;t&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;0-1:00&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;bowtie2&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;c&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;mem&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;8G&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;t&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;0-0:30&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;blastn&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;c&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;t&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;0-&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And finally this is a useful sbatch template which sends you an email when the job finishes.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;
    &lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#SBATCH -p short&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#SBATCH -t 0-1:0:0&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#SBATCH -c 4&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#SBATCH --mem=16G&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#SBATCH -o %j.out ##  %j uses job id&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#SBATCH -e %j.err ##&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#SBATCH --mail-user=you@email.id&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;#SBATCH --mail-type=END&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;# module load commands&lt;/span&gt;
    YOUR COMMAND HERE

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
				<pubDate>Tue, 31 May 2022 00:00:00 +0000</pubDate>
				<link>/2022/05/31/notes-hpc.html</link>
				<guid isPermaLink="true">/2022/05/31/notes-hpc.html</guid>
			</item>
		
			<item>
				<title>Introducing biomodels.el</title>
				<description>&lt;p&gt;&lt;img src=&quot;/assets/images/screenshot_20220227_135818.png&quot; alt=&quot;img&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;rationale&quot;&gt;Rationale&lt;/h1&gt;
&lt;p&gt;I think there is an accessibility problem in biology, where useful data is tied up in databases that don’t have good interfaces to retrieve them. One of my pet peeves has been the messy ecosystem around SBML models hosted on BioModels, and how everything about it, from model definition to simulation is made opaque to users in favor of machine readability. This is my attempt to build an emacs interface to searching the &lt;a href=&quot;https://www.ebi.ac.uk/biomodels/&quot;&gt;BioModels database&lt;/a&gt;. The good thing about building this interface in emacs is that it can be extended to custom workflows in terms of parameter estimation or model comparison.&lt;/p&gt;

&lt;h1 id=&quot;what-does-the-package-do&quot;&gt;What does the package do?&lt;/h1&gt;
&lt;p&gt;Currently the package provides a simple set of key-bindings to:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Search for models by key word&lt;/li&gt;
  &lt;li&gt;View reaction wiring diagrams (if available)&lt;/li&gt;
  &lt;li&gt;Download and view SBML/PDF/XPP files provided by BioModels.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For me, this functionality makes it easier to get to simulating the XPP files, rather having to rely on esoteric SBML tooling to explore time dynamics or effects of parameter perturbations.&lt;/p&gt;

&lt;h1 id=&quot;where-can-i-find-it&quot;&gt;Where can I find it?&lt;/h1&gt;
&lt;p&gt;You can find the code on &lt;a href=&quot;https://github.com/amoghpj/biomodels.el&quot;&gt;my github repo&lt;/a&gt;. The python wrapper requires installing the python-libSBML package.&lt;/p&gt;

&lt;h1 id=&quot;what-does-it-look-like&quot;&gt;What does it look like?&lt;/h1&gt;
&lt;p&gt;Here is a rather long video walking through the steps of inspecting the wiring diagram of a model and downloading it.&lt;/p&gt;

&lt;video controls=&quot;&quot;&gt;
&lt;source src=&quot;/assets/videos/2022-02-27-biomodels.mp4&quot; type=&quot;video/mp4&quot; /&gt;
&lt;/video&gt;

&lt;h1 id=&quot;feedback-welcome&quot;&gt;Feedback welcome!&lt;/h1&gt;
&lt;p&gt;Always looking for feedback, either on my elisp or the utility of such a package to fellow biologists!&lt;/p&gt;

</description>
				<pubDate>Sun, 27 Feb 2022 00:00:00 +0000</pubDate>
				<link>/2022/02/27/biomodels.html</link>
				<guid isPermaLink="true">/2022/02/27/biomodels.html</guid>
			</item>
		
	</channel>
</rss>
