<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Clojure on zachcp</title>
		<link>http://zachcp.org/categories/clojure/</link>
		<description>Recent content in Clojure on zachcp</description>
		<generator>Hugo</generator>
		<language>en-us</language>
		
		
		
			<copyright>© 2007- {year}</copyright>
		
		
			<lastBuildDate>Thu, 22 Sep 2016 08:03:00 +0000</lastBuildDate>
		
			<atom:link href="http://zachcp.org/categories/clojure/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Exploring Mibig with Datalog</title>
				<link>http://zachcp.org/blog/mibig_datamaps/</link>
				<pubDate>Thu, 22 Sep 2016 08:03:00 +0000</pubDate>
				<guid>http://zachcp.org/blog/mibig_datamaps/</guid>
				<description>&lt;p&gt;As a follow up on &lt;a href=&#34;http://zachcp.org/blog/2016/mibig-json-pics/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;the previous post about Mibig&lt;/a&gt;, this post is an example of using datalog to examine Mibig Data.&#xA;I encountered the excellent &lt;a href=&#34;https://github.com/djjolicoeur/datamaps&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;datamaps&lt;/a&gt; library which allows you to ingest clojure maps/vectors as a DB which can then&#xA;be queried using the datalog engine of datomic. Below are a few examples to give a flavor of how it works. Perhaps the best example of the flexibility is&#xA;the query that can be read &amp;ldquo;get all molecules that have tyrosine-encoding adenylation domains.&amp;rdquo;&lt;/p&gt;</description>
			</item>
			<item>
				<title>Growing Peptides Again</title>
				<link>http://zachcp.org/blog/cdkpeptides-part-ii/</link>
				<pubDate>Mon, 30 May 2016 08:03:00 +0000</pubDate>
				<guid>http://zachcp.org/blog/cdkpeptides-part-ii/</guid>
				<description>&lt;pre&gt;&lt;code class=&#34;language-[clojure]&#34;&gt;(peptideanimation &amp;quot;peptidechain.gif&amp;quot; (take 17 aminos) :width 2000 :height 1000)&#xA;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;img src=&#34;http://zachcp.org/pics/blog/2016/peptidechain.gif&#34; width=800&gt;&#xA;&lt;p&gt;A few small updates to my &lt;a href=&#34;https://github.com/zachcp/drawpeptides&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;peptide viz tool &lt;/a&gt; (described &lt;a href=&#34;http://zachcp.org/blog/2015/clojure-cdk-peptides/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;earlier&lt;/a&gt;).&lt;/p&gt;&#xA;&lt;p&gt;This GIF simply takes each peptide fragment (1; 1,2; 1,2,3&amp;hellip;), calculates the structure, and concatenates the images to give an effect of the&#xA;peptide growing. Obviously its not perfect, however, you can see that CDK&amp;rsquo;s layout has improved so that the peptide side chains no longer clash.&#xA;You can also note how the longest carbon chain is detected so that sometimes the terminal side-chains are included as part of linear chain,&#xA;causing the chain to &amp;ldquo;bend&amp;rdquo;.&lt;/p&gt;</description>
			</item>
			<item>
				<title>D3 with Reagent</title>
				<link>http://zachcp.org/blog/reagent-d3/</link>
				<pubDate>Sat, 19 Dec 2015 08:03:00 +0000</pubDate>
				<guid>http://zachcp.org/blog/reagent-d3/</guid>
				<description>&lt;img src=&#34;http://zachcp.org/pics/blog/2015/simplecomponent.png&#34; width=800&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve been interested in using &lt;a href=&#34;http://d3js.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;D3.js&lt;/a&gt; with &lt;a href=&#34;https://github.com/reagent-project/reagent&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Reagent&lt;/a&gt; for awhile. Reagent is wrapper around &lt;a href=&#34;http://facebook.github.io/react/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;React.js&lt;/a&gt; that uses a simple syntax that makes it straightforward to create relatively sophisticated web applications without needing many details of whats happening under the hood. Furthermore, Reagent has &lt;a href=&#34;https://github.com/Day8/re-frame&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;re-frame&lt;/a&gt;, an excellent framework for managing state whose documentation alone makes it a treasure trove&#xA;of knowledge and entertainment (thanks Mike Thompson!). With a bit of clojurescript knowledge, the re-frame documents can get you making complicated, interactive web applications in no time. But at some point you will want to do something that is not 100% clojurescript, like add a D3-backed component, and things can get tricky quickly.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Immutable Stack 2</title>
				<link>http://zachcp.org/blog/immutablestack/</link>
				<pubDate>Sun, 18 Oct 2015 08:03:00 +0000</pubDate>
				<guid>http://zachcp.org/blog/immutablestack/</guid>
				<description>&lt;p&gt;I spent my time this past weekend at &lt;a href=&#34;http://kitchentablecoders.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Kitchen Table Coders&amp;rsquo;&lt;/a&gt;&#xA;Immutable Stack 2, a two day interactive workshop focusing on &lt;a href=&#34;http://www.datomic.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Datomic&lt;/a&gt;&#xA;and &lt;a href=&#34;https://github.com/omcljs/om&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Om-Next&lt;/a&gt;. The workshop was enjoyably taught&#xA;by &lt;a href=&#34;https://twitter.com/swannodette&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;David Nolen&lt;/a&gt; and &lt;a href=&#34;https://twitter.com/kovasb&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Kovas Boguta&lt;/a&gt;,&#xA;who were excellent complements to one another, and who managed to create a relaxed environment where&#xA;people were free to ask questions throughout. Kovas&amp;rsquo; section brought out his dry, understated humor,&#xA;and in Davids&amp;rsquo; section we witnessed his exuberance for the subject. Largely because of these two,&#xA;the attitude of the two days was very relaxed: despite being in a room filled with technically&#xA;competent people, the questions and answers were entirely positive and well respected,&#xA;resulting in a fast-paced, knowledge-dense two days.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Browser Chemistry Part I</title>
				<link>http://zachcp.org/blog/browserchemistry/</link>
				<pubDate>Mon, 08 Jun 2015 08:03:00 +0000</pubDate>
				<guid>http://zachcp.org/blog/browserchemistry/</guid>
				<description>&lt;p&gt;A few months back &lt;a href=&#34;http://baoilleach.blogspot.co.uk/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Noel O&amp;rsquo;Boyle&lt;/a&gt; wrote a series of blog posts wherein he used &lt;a href=&#34;http://kripken.github.io/emscripten-site/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Emscripten&lt;/a&gt;&#xA;to compile a number of chemoinformatics toolkits to Javascript including &lt;a href=&#34;http://baoilleach.blogspot.com/2015/02/cheminformaticsjs-open-babel.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenBabel&lt;/a&gt;,&#xA;&lt;a href=&#34;http://baoilleach.blogspot.com/2015/02/cheminformaticsjs-rdkit.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;RDKit&lt;/a&gt;, and &lt;a href=&#34;http://baoilleach.blogspot.com/2015/02/cheminformaticsjs-helium.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Helium&lt;/a&gt;. As someone interested in using the browser to interact with molecules, I thought this was a great series of posts and thought I might even be able to reuse some of the javascript he had generated. However, upon attempting to reuse his smiles-to-svg functions on a different webpage I discovered that output of Emscripten is difficult to reuse (or at least not obvious to someone unfamiliar with &lt;a href=&#34;http://asmjs.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;ASM.js&lt;/a&gt;. I tried downloading&#xA;the JS file in order to call the smiles-to-svg function in another context but started running into errors with the generated code. I was still interested in trying to generate images in the browser, however, and in his &lt;a href=&#34;http://baoilleach.blogspot.com/2015/02/cheminformaticsjs-conclusion.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;final post&lt;/a&gt;, Noel points the way by mentioning the &lt;a href=&#34;https://github.com/kemia/kemia&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;kemia&lt;/a&gt; project, a javascript chemistry library that aims to be &amp;ldquo;the world’s first open source, 100% javascript chemistry toolkit.&amp;rdquo; The rest of this post is how I used kemia, ChemDoodle, and clojurescript to make pure-browser smiles-to-canvas widget.&lt;/p&gt;</description>
			</item>
			<item>
				<title>CDK Plotting Basics: Rotation and Center-Translation</title>
				<link>http://zachcp.org/blog/basic-cdk-rendering/</link>
				<pubDate>Thu, 22 Jan 2015 08:03:00 +0000</pubDate>
				<guid>http://zachcp.org/blog/basic-cdk-rendering/</guid>
				<description>&lt;img src=&#34;http://zachcp.org/pics/blog/2015/caffeinerepeat.png&#34;&gt;&#xA;&lt;p&gt;&lt;em&gt;tl;dr plotting molecules is fun once you get the hang of it.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;This post is a continuation of my &lt;a href=&#34;http://zachcp.org/blog/2015/clojure-cdk-peptides/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;previous post&lt;/a&gt;, wherein I began playing with the &lt;a href=&#34;https://github.com/cdk/cdk&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Chemistry Development Kit (CDK)&lt;/a&gt; for the purpose of making visualizations. CDK does a great job of generating structures of small molecules, but what if you want to scale, transform, or rotate these molecule on your canvas? Its not quite as easy as it seems.&lt;/p&gt;</description>
			</item>
			<item>
				<title>A Simple Peptide Viz Tool in Clojure using CDK</title>
				<link>http://zachcp.org/blog/clojure-cdk-peptides/</link>
				<pubDate>Mon, 19 Jan 2015 08:03:00 +0000</pubDate>
				<guid>http://zachcp.org/blog/clojure-cdk-peptides/</guid>
				<description>&lt;p&gt;&lt;em&gt;tl;dr don&amp;rsquo;t write your own chemistry library if a good one exists and CDK is a good one; clojure has good java interop but it still requires you to learn the classes/interfaces in that library; start simple and small&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;I work in a field at the crossroads of chemistry and biology. The powerful tools of molecular genetics and biochemistry have led to an understanding of how genes and their &amp;ldquo;gene-products&amp;rdquo; (proteins) alter and combine basic chemicals to make all of the components that living beings require. In the microbial world, the understanding of these gene-protein-metabolite networks is driving several areas of science where the major conceptual ideas are to either engineer the metabolic systems to maximize the output of a particular metabolite (biofuels, pharmaceutical precursors) or to use the genetic diversity that exists in nature to try to find novel metabolites. Our lab is interested in the latter: we hope to use naturally occurring genetic diversity to find collections of genes making new molecules. While there are lots of tools for visualizing genes, and great tools for plotting particular compounds, there is a neglected middle ground for visualizing all of these things together and I wanted to write a little visualization tool for that purpose.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Python to Clojure: Getting Used to Immutability</title>
				<link>http://zachcp.org/blog/python-to-clojure/</link>
				<pubDate>Tue, 06 Jan 2015 08:03:00 +0000</pubDate>
				<guid>http://zachcp.org/blog/python-to-clojure/</guid>
				<description>&lt;p&gt;&lt;em&gt;tl;dr clojure is an interesting language emphasizing immutable data and higher order functions. While these offer some tangible benefits, effective use requires a style of thinking about programming that is quite different from the imperative style many of us know&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;I have been following the &lt;a href=&#34;http://clojure.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Clojure&lt;/a&gt; community for a little while and have been interested in their way of doing things. Not only are there a lot of smart people who have been involved in designing the language, but the support for both the JVM and for Javascript means that Clojure is a language that may yield a single language to &amp;ldquo;rule them all&amp;rdquo;, or at least to allow portability to just about any platform. JVM plus JS is a pretty nice combo. That Clojure is a lisp is also appealing since hearing of how lisp was Paul Graham&amp;rsquo;s &amp;ldquo;secret weapon&amp;rdquo; in &lt;a href=&#34;http://www.paulgraham.com/avg.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Beating the Averages&lt;/a&gt;. But in addition to being a lisp, Clojure prides itself on immutable data and functional programming. These two are interesting concepts that are catching on in many areas of programming and are in the same spirit of reproducible research where the processing and analysis of data should be as transparent as possible and should focus on what we are ultimately interested in: the values themselves.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
