<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Proteins on zachcp</title>
		<link>http://zachcp.org/categories/proteins/</link>
		<description>Recent content in Proteins on zachcp</description>
		<generator>Hugo</generator>
		<language>en-us</language>
		
		
		
			<copyright>© 2007- {year}</copyright>
		
		
			<lastBuildDate>Tue, 10 Dec 2024 00:00:00 +0000</lastBuildDate>
		
			<atom:link href="http://zachcp.org/categories/proteins/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Local-First PLM</title>
				<link>http://zachcp.org/blog/ferritin_local_app/</link>
				<pubDate>Tue, 10 Dec 2024 00:00:00 +0000</pubDate>
				<guid>http://zachcp.org/blog/ferritin_local_app/</guid>
				<description>&lt;h1 id=&#34;macos-builds&#34;&gt;MacOS Builds&lt;a class=&#34;anchor&#34; href=&#34;#macos-builds&#34; aria-label=&#34;Link to this section&#34;&gt;#&lt;/a&gt;&lt;/h1&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve reached an MVP of building the AMPLIFY model in Rust and distributing it as a small binary application for Mac AARCH64. Here I am showing an example protein&#xA;returning the contact map as calculated by the AMPLIFY 120M model. Running the example proteins, Heme, through the 120M model takes ~0.4 seconds.&#xA;The 350M model takes ~4 seconds.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;del&gt;Download for MacOS M-series chips here: &lt;a href=&#34;http://zachcp.org/apps/fennec/v0.0.1/fennec-toolkit_0.0.1_aarch64.dmg&#34;&gt;mac-app&lt;/a&gt;&lt;/del&gt;. Edit: app can&amp;rsquo;t be distributed this way&amp;hellip;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;img src=&#34;http://zachcp.org/pics/blog/2024/Ferritin/fennec_01.png&#34; alt=&#34;&#34;&gt;&#xA;&lt;img src=&#34;http://zachcp.org/pics/blog/2024/Ferritin/fennec_02.png&#34; alt=&#34;&#34;&gt;&#xA;&lt;img src=&#34;http://zachcp.org/pics/blog/2024/Ferritin/fennec_03.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;</description>
			</item>
			<item>
				<title>PLM-Local</title>
				<link>http://zachcp.org/blog/ferritin_amplify_04/</link>
				<pubDate>Mon, 09 Dec 2024 00:00:00 +0000</pubDate>
				<guid>http://zachcp.org/blog/ferritin_amplify_04/</guid>
				<description>&lt;p&gt;&lt;em&gt;Note: this is cross posted from &lt;a href=&#34;https://zachcp.github.io/ferritin/posts/20241209_local/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;ferritin&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h1 id=&#34;plm-local&#34;&gt;PLM-Local&lt;a class=&#34;anchor&#34; href=&#34;#plm-local&#34; aria-label=&#34;Link to this section&#34;&gt;#&lt;/a&gt;&lt;/h1&gt;&#xA;&lt;p&gt;This is a quick update post.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Release of &lt;a href=&#34;https://www.evolutionaryscale.ai/blog/esm-cambrian&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;ESMC&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Began to port ESMC model in subcrate &lt;a href=&#34;https://github.com/zachcp/ferritin/tree/main/ferritin-esm&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;ferritin-esm&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Ported the model in &lt;a href=&#34;https://github.com/zachcp/ferritin/pull/66&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;this PR&lt;/a&gt;, and &lt;a href=&#34;https://github.com/zachcp/ferritin/pull/67&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;this PR&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;However, when I went to implement the tokenizer, I ended up encountering some issues. Although ESMC is similar to ESM2 in that it is trained only on sequences, it shares a common codebase with ESM3 which uses structural information&lt;/li&gt;&#xA;&lt;li&gt;The major implication is that the tokenizer is not as simple and self-contained, and porting requires either:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a full minimal reimplementation of ESM functionality or&lt;/li&gt;&#xA;&lt;li&gt;a simpler tokenization scheme that deviates from the current codebase&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;While brainstorming on ESMC, I remembered that I hadn&amp;rsquo;t implemented METAL for AMPLIFY; so &lt;a href=&#34;https://github.com/zachcp/ferritin/pull/69&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;I did&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;This makes AMPLIFY really pleasantly fast!&lt;/li&gt;&#xA;&lt;li&gt;I was therefore inspired to build and serve the binary via a new project, &lt;a href=&#34;https://github.com/zachcp/plm-local&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;plm-local&lt;/a&gt;, and can build and deploy to a Conda channel&lt;/li&gt;&#xA;&lt;li&gt;h/t to &lt;a href=&#34;https://bsky.app/profile/luizirber.bsky.social/post/3lcss7hz6v22k&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;luizirber&lt;/a&gt; for showing me this nice trick&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-shell&#34;&gt;pixi exec -c https://repo.prefix.dev/protein-language-local-public \&#xA;    plm-local --protein-string MSVVGIDLGFQSCYVAVARAGGIETIANEYSDRCTPACISFGPKNR&#xA;&#xA;# that&#39;s pretty awesome.&#xA;time pixi exec ... &amp;lt;as above&amp;gt;   0.53s user 0.65s system 42% cpu 2.800 total&#xA;time pixi exec ... &amp;lt;as above&amp;gt;  0.53s user 0.27s system 172% cpu 0.464 total&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2 id=&#34;what-it-looks-like-at-the-moment&#34;&gt;What it looks like at the moment.&lt;a class=&#34;anchor&#34; href=&#34;#what-it-looks-like-at-the-moment&#34; aria-label=&#34;Link to this section&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Current CLI simply encodes and decodes the protein. But it can do it in half a second with no compilation step&#xA;or dependencies! Boom.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Return to LigandMPNN</title>
				<link>http://zachcp.org/blog/ferritin_ligandmpnn_01/</link>
				<pubDate>Mon, 02 Dec 2024 00:00:00 +0000</pubDate>
				<guid>http://zachcp.org/blog/ferritin_ligandmpnn_01/</guid>
				<description>&lt;p&gt;&lt;em&gt;Note: this is cross posted from &lt;a href=&#34;https://zachcp.github.io/ferritin/posts/20241202_lmpnn_01/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;ferritin&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h1 id=&#34;returning-to-ligandmpnn&#34;&gt;Returning to LigandMPNN&lt;a class=&#34;anchor&#34; href=&#34;#returning-to-ligandmpnn&#34; aria-label=&#34;Link to this section&#34;&gt;#&lt;/a&gt;&lt;/h1&gt;&#xA;&lt;p&gt;The original motivating goal of this project was a pure-rust-WASM ProteinMPNN/LigandMPNN&#xA;implementation for fast local design. In previous posts I discussed:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Core Protein Data Structures for efficient protein representation using the Struct-of-Arrays style. &lt;a href=&#34;https://zachcp.github.io/ferritin/posts/20241029_first_post/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;link&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;The LigandMPNN Trait to define functions for extracting features from a protein representation. &lt;a href=&#34;https://zachcp.github.io/ferritin/posts/20241105_lmpnnfeaturizer/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;link&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;The Candle implementation of the Amplify model (parts &lt;a href=&#34;https://zachcp.github.io/ferritin/posts/20241111_amplify/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;1&lt;/a&gt;, &lt;a href=&#34;https://zachcp.github.io/ferritin/posts/20241114_amplify_02/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;2&lt;/a&gt;, and &lt;a href=&#34;https://zachcp.github.io/ferritin/posts/20241115_amplify_03/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;3&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Now that I was able to get my feet wet on a protein language model implementation, I am ready to return to the more architecturally challenging problem of {Protein/Ligand}-MPNN. This post will describe a few of the challenges faced&#xA;in porting that library over and the current state of the model.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Amplify Pytorch-&gt;Candle Conversion Part 3</title>
				<link>http://zachcp.org/blog/ferritin_amplify_03/</link>
				<pubDate>Fri, 15 Nov 2024 00:00:00 +0000</pubDate>
				<guid>http://zachcp.org/blog/ferritin_amplify_03/</guid>
				<description>&lt;p&gt;&lt;em&gt;Note: this is cross posted from &lt;a href=&#34;https://zachcp.github.io/ferritin/posts/20241115_amplify_03/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;ferritin&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Now that we&amp;rsquo;ve got the model together, I want to start shaping the API. We&amp;rsquo;d like&#xA;to make it easy to download/invoke the model, and to do stuff with the outputs. In&#xA;this code, I&amp;rsquo;ve taken a piece of the tests as of Nov15 which show:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;an easy loading of the model which returns:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;a Tokenizer which can take protein sequences and convert to and from integers&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;ol start=&#34;2&#34;&gt;&#xA;&lt;li&gt;the 120M AMPLIFY model with weights loaded.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;a functions on the output that will retrieve the contact maps&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;::: {.callout-note}&#xA;Internally I am using &lt;code&gt;candle_hf_hub&lt;/code&gt; which will download and cache the model weights to&#xA;&lt;code&gt;~/.cache/huggingface/hub&lt;/code&gt;. See &lt;a href=&#34;https://huggingface.co/docs/datasets/en/cache&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;cache docs&lt;/a&gt;&#xA;:::&lt;/p&gt;</description>
			</item>
			<item>
				<title>Amplify Pytorch-&gt;Candle Conversion Part 2</title>
				<link>http://zachcp.org/blog/ferritin_amplify_01/</link>
				<pubDate>Thu, 14 Nov 2024 00:00:00 +0000</pubDate>
				<guid>http://zachcp.org/blog/ferritin_amplify_01/</guid>
				<description>&lt;p&gt;&lt;strong&gt;Cross posted on &lt;a href=&#34;https://zachcp.github.io/ferritin/posts/20241114_amplify_02/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Ferritin&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;h1 id=&#34;intro&#34;&gt;Intro&lt;a class=&#34;anchor&#34; href=&#34;#intro&#34; aria-label=&#34;Link to this section&#34;&gt;#&lt;/a&gt;&lt;/h1&gt;&#xA;&lt;p&gt;In the previous post I had created the Candle version of the Amplify pytorch model. However, when&#xA;I started to use it It was immedietly clear that my model was wrong. This post briefly recounts&#xA;the troubleshooting process to get the models to reach parity as measured&#xA;by identical outputs in the sequence encoding and attention weight outputs.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;The Problem&lt;/strong&gt; My base Rust/Candle model looked like crap. Encode + run + decode should return the same sequence.&#xA;Something is wrong and needs to be fixed&lt;/p&gt;</description>
			</item>
			<item>
				<title>Amplify Pytorch-&gt;Candle Conversion Part 2</title>
				<link>http://zachcp.org/blog/ferritin_amplify_02/</link>
				<pubDate>Thu, 14 Nov 2024 00:00:00 +0000</pubDate>
				<guid>http://zachcp.org/blog/ferritin_amplify_02/</guid>
				<description>&lt;p&gt;&lt;em&gt;Note: this is cross posted from &lt;a href=&#34;https://zachcp.github.io/ferritin/posts/20241111_amplify/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;ferritin&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;h1 id=&#34;intro&#34;&gt;Intro&lt;a class=&#34;anchor&#34; href=&#34;#intro&#34; aria-label=&#34;Link to this section&#34;&gt;#&lt;/a&gt;&lt;/h1&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;spin up GPU&lt;/li&gt;&#xA;&lt;li&gt;setup remote dev env&lt;/li&gt;&#xA;&lt;li&gt;clone HF repo locally&lt;/li&gt;&#xA;&lt;li&gt;get intial tests running for Candle and Pytorch&lt;/li&gt;&#xA;&lt;li&gt;add print statements in both and watch where the divergence happens&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;start&#34;&gt;Start&lt;a class=&#34;anchor&#34; href=&#34;#start&#34; aria-label=&#34;Link to this section&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-shell&#34;&gt;# roundtrip test&#xA;# cargo test -p ferritin-featurizers test_amplify_round_trip -- --exact&#xA;# python run.py&#xA;#&#xA;# sequence   MSVVGIDLGFQSCYVAVARAGGIETIANEYSDRCTPACISFGPKNR&#xA;# py        AMSVVGIDLGTTSCRVAVARAGGIETIANEYSDRKTPACISFGPKNRA&#xA;# rust      CECVACVMGKRGGVNTSPYQSAATRMKTWKRIRNPHFNCVIVPFISPC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h3 id=&#34;freqs_cis&#34;&gt;Freqs_Cis&lt;a class=&#34;anchor&#34; href=&#34;#freqs_cis&#34; aria-label=&#34;Link to this section&#34;&gt;#&lt;/a&gt;&lt;/h3&gt;&#xA;&lt;p&gt;Rotary encoding.&lt;/p&gt;</description>
			</item>
			<item>
				<title>LMPNN Featurizers</title>
				<link>http://zachcp.org/blog/ferritin_featurize_00/</link>
				<pubDate>Tue, 05 Nov 2024 00:00:00 +0000</pubDate>
				<guid>http://zachcp.org/blog/ferritin_featurize_00/</guid>
				<description>&lt;p&gt;&lt;em&gt;Note: this is crossposted to &lt;a href=&#34;https://zachcp.github.io/ferritin/posts/20241105_lmpnnfeaturizer/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Github&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h1 id=&#34;intro&#34;&gt;Intro&lt;a class=&#34;anchor&#34; href=&#34;#intro&#34; aria-label=&#34;Link to this section&#34;&gt;#&lt;/a&gt;&lt;/h1&gt;&#xA;&lt;p&gt;One of the motivating reasons for creating &lt;code&gt;ferritin&lt;/code&gt; was to be able to recreate and run protein language&#xA;models in the browser via WASM. This post describes a work-in-progress effort to port&#xA;the &lt;a href=&#34;https://github.com/dauparas/LigandMPNN&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;ligand-mpnn&lt;/a&gt; protein model from python/pytorch to Rust/&lt;a href=&#34;https://github.com/huggingface/candle&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Candle&lt;/a&gt;.&#xA;My general strategy was to nibble at the model from both ends: begin a naive translation of the Model,&#xA;and begin to recreate in Rust the protein processing portion.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Ferritin Init</title>
				<link>http://zachcp.org/blog/ferritin_init/</link>
				<pubDate>Tue, 29 Oct 2024 00:00:00 +0000</pubDate>
				<guid>http://zachcp.org/blog/ferritin_init/</guid>
				<description>&lt;p&gt;&lt;em&gt;Note: this is crossposted to &lt;a href=&#34;https://zachcp.github.io/ferritin/posts/20241029_first_post/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Github&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h1 id=&#34;intro-to-ferritin&#34;&gt;Intro to Ferritin&lt;a class=&#34;anchor&#34; href=&#34;#intro-to-ferritin&#34; aria-label=&#34;Link to this section&#34;&gt;#&lt;/a&gt;&lt;/h1&gt;&#xA;&lt;p&gt;This is an introduction to Ferritin, a set of Rust crates for working with proteins. At the moment&#xA;ferritin is very much in alpha stage but I am pleased with the current progress and wanted to give&#xA;a high level overview of the project as it currently stands.&lt;/p&gt;&#xA;&lt;p&gt;At the moment I have in place what I think to be a reasonably well architected core data structure, an &lt;code&gt;AtomCollection&lt;/code&gt; struct that is inspired by how pymol and biotite internally represent atomic information.&#xA;Most of the current and future features should be able to extend functionality via traits/methods while hopefully presenting s relatively small API that, because it is built on Rust, is nonetheless performant and portable.  Additionally I have a few nascent crates that 1) handle inputs from pymol via it&amp;rsquo;s PSE binary file, 2) an initial implementation of a Rust version of molviewspec that can export json and/or self-contained HTML, and 3) an early set of visualizations built on top of &lt;a href=&#34;https://bevyengine.org&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Bevy&lt;/a&gt;.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Foray into Molecular Nodes</title>
				<link>http://zachcp.org/blog/molecular_nodes/</link>
				<pubDate>Wed, 28 Aug 2024 00:00:00 +0000</pubDate>
				<guid>http://zachcp.org/blog/molecular_nodes/</guid>
				<description>&lt;p&gt;&lt;em&gt;TL;DR: &lt;a href=&#34;https://github.com/zachcp/wobble&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Wobble&lt;/a&gt; is a Python cli Library that can currently be used to generate an animation  where residues wiggle based&#xA;on a PDB&amp;rsquo;s B-factor. It is a proof of principle library demonstrating one way in which we might use Blender and a rendering engine&#xA;for fun/interesting protein visualizations.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;br&gt;&#xA;&lt;div style=&#34;display: flex; justify-content: space-between;&#34;&gt;&#xA;    &lt;img src=&#34;http://zachcp.org/pics/blog/2024/MolecularNodes/wobble_readme.png&#34; style=&#34;width: 45%;&#34;&gt;&#xA;    &lt;img src=&#34;http://zachcp.org/pics/blog/2024/MolecularNodes/1FAP_animation.gif&#34; style=&#34;width: 45%;&#34;&gt;&#xA;&lt;/div&gt;&#xA;&lt;br&gt;&#xA;&lt;h2 id=&#34;background&#34;&gt;Background&lt;a class=&#34;anchor&#34; href=&#34;#background&#34; aria-label=&#34;Link to this section&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Protein animations are awesome and I&amp;rsquo;ve been interested in them for a long time (see PCR Rap below). And in the last month&#xA;or so a few things rekindled the interest: I saw the absolutely beautiful &lt;a href=&#34;https://www.evolutionaryscale.ai&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Evolutionary Scale&lt;/a&gt; website and I attended&#xA;a local meetup at &lt;a href=&#34;https://www.vant.ai&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;VantAI&lt;/a&gt; where Brady Johnson gave a walkthrough of &lt;a href=&#34;https://github.com/BradyAJohnston/MolecularNodes&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Molecular Nodes&lt;/a&gt;.  It was pretty clear that&#xA;a skilled animator could replicate each of the EvoScale animations using Molecular Nodes and watching how Brady operated inspired me to&#xA;take a crack at a few visualizations that I had wanted to make in the past but where I thought a dynamic environment like Blender would&#xA;be really beneficial:&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
