<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Oldspeak Ministry &#187; William</title>
	<atom:link href="http://www.free2fall.net/blog/archives/author/admin/feed" rel="self" type="application/rss+xml" />
	<link>http://www.free2fall.net/blog</link>
	<description>Sufficient to stand, though free to fall.</description>
	<lastBuildDate>Sun, 30 May 2010 20:36:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>So long, and thanks for all the fish!</title>
		<link>http://www.free2fall.net/blog/archives/356</link>
		<comments>http://www.free2fall.net/blog/archives/356#comments</comments>
		<pubDate>Fri, 16 Apr 2010 22:56:37 +0000</pubDate>
		<dc:creator>William</dc:creator>
				<category><![CDATA[Public]]></category>

		<guid isPermaLink="false">http://www.free2fall.net/blog/?p=356</guid>
		<description><![CDATA[Dear Readers, Well, it&#8217;s been wonderful, but I&#8217;m taking a break from personal blogging for the near future. I have also removed nearly all of my previous posts from public dissemination. Several posts that might be of more general interest than my life have been retained, in the hopes that others will find them useful. [...]]]></description>
			<content:encoded><![CDATA[<p>Dear Readers,</p>
<p>Well, it&#8217;s been wonderful, but I&#8217;m taking a break from personal blogging for the near future. I have also removed nearly all of my previous posts from public dissemination. Several posts that might be of more general interest than my life have been retained, in the hopes that others will find them useful.</p>
<p>There are several reasons for this decision, but the primary one is identity management in this age of Google. I might make more of my past posts public in the future, but for now, <a href="http://www.facebook.com">facebook</a> or email me if you want to know more.</p>
<p>Thanks for reading!</p>
<p>~William~</p>
]]></content:encoded>
			<wfw:commentRss>http://www.free2fall.net/blog/archives/356/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gromacs Genion Fix</title>
		<link>http://www.free2fall.net/blog/archives/180</link>
		<comments>http://www.free2fall.net/blog/archives/180#comments</comments>
		<pubDate>Mon, 25 Jan 2010 20:36:35 +0000</pubDate>
		<dc:creator>William</dc:creator>
				<category><![CDATA[Public]]></category>
		<category><![CDATA[Readable Reads]]></category>
		<category><![CDATA[genion]]></category>
		<category><![CDATA[gromacs]]></category>
		<category><![CDATA[hack]]></category>

		<guid isPermaLink="false">http://www.free2fall.net/blog/?p=180</guid>
		<description><![CDATA[Gromacs is a wonderful open source molecular dynamics simulation package that I will be using for some of my research here at Imperial. However, as is oftentimes the case with scientific packages (both open and closed source), there are some minor quirks that I&#8217;ve had to learn to deal with. One of those quirks was [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.gromacs.org">Gromacs</a> is a wonderful open source molecular dynamics simulation package that I will be using for some of my research here at Imperial. However, as is oftentimes the case with scientific packages (both open and closed source), there are some minor quirks that I&#8217;ve had to learn to deal with. One of those quirks was elusive and irritating enough that I&#8217;ve decided to write a short howto so that someone elsewhere might not have to spend as long as I did trying to solve it.</p>
<p><strong>Warning:</strong> I am not a computer scientist or programmer, and barely even a scientist. There is no guarantee that this code will not destroy your data, so be sure to backup all files before attempting this fix (which you should be doing anyways)! Having said that, it worked for me, and I can only hope for the best.</p>
<p><strong>Version:</strong> This behaviour is seen on Gromacs 4.0.7. The proposed fix uses standard unix command line utilities (and is a very ugly but working hack).</p>
<p><strong>Symptoms:</strong> While trying to neutralize the charge on a solvated system using genion to add <strong>X</strong> ions, genion insists on instead adding <strong>kX</strong> ions, where k is an integer. Additionally, attempts to use genion&#8217;s own &#8220;-neutral&#8221; option also fail, with it calculating the correct number of ions to add, but then adding it multiple times.</p>
<p><strong>Cause:</strong> The reason this happens is due to the way the topology files are constructed. Near the end of the topology file is a section that details the type and number of molecules in the system. For instance, it might look something like this:</p>
<blockquote><p><code>[ molecules ]<br />
; Compound        #mols<br />
Protein_A           1<br />
Protein_B           1<br />
SOL             27550<br />
</code></p></blockquote>
<p>When genion runs, if one selects option 12, &#8220;solvent&#8221;, genion will replace some of the solvent &#8220;SOL&#8221; molecules with the specified ions, perhaps resulting in the following, where we specified the addition of 8 NA+ ions:</p>
<blockquote><p><code>[ molecules ]<br />
; Compound        #mols<br />
Protein_A           1<br />
Protein_B           1<br />
SOL         27542<br />
NA+         8<br />
CL-         0<br />
</code></p></blockquote>
<p>However, sometimes, due to prior processing with other tools, there will be multiple &#8220;SOL&#8221; lines, like so:</p>
<blockquote><p><code>[ molecules ]<br />
; Compound        #mols<br />
Protein_A           1<br />
Protein_B           1<br />
SOL         72<br />
SOL         75<br />
SOL         27403<br />
</code></p></blockquote>
<p>Notice that the total number of solvent molecules is the same in both examples. However, genion gets confused when multiple solvent lines are present, and <em>seemingly acts on each line</em>! This causes the resulting topology file to look like this:</p>
<blockquote><p><code>[ molecules ]<br />
; Compound        #mols<br />
Protein_A           1<br />
Protein_B           1<br />
SOL         64<br />
NA+         8<br />
CL-         0<br />
SOL         67<br />
NA+         8<br />
CL-         0<br />
SOL         27395<br />
NA+         8<br />
CL-         0<br />
</code></p></blockquote>
<p>Notwithstanding the fact that the resulting topology file is decidedly <em>not</em> neutral, the topology file also then for some reason does not match up with the .gro file, which causes additional problems down the line.</p>
<p>Of course, by now, you&#8217;ve probably figured out how to solve the problem yourself: just make sure to consolidate multiple SOL lines before running genion, and you&#8217;re golden! Since I am lazy and do not like doing that by hand (and because I&#8217;ll probably need to bulk process many proteins sometime in the future), I hacked together a really ugly but working bash script to do just that. Following:</p>
<blockquote><p><code>#!/bin/bash<br />
# Consolidate the solvent molecules in the topology file.<br />
filename=example.top<br />
sol_mol=0<br />
cp $filename $filename-new<br />
while read line; do<br />
	sed "/$line/d" $filename-new > $filename-new2<br />
	mv $filename-new2 $filename-new<br />
	add=$(echo $line | sed 's/SOL//')<br />
	sol_mol=$(($sol_mol+$add))<br />
done < <( tail -n $(( $(cat $filename | wc -l) - $(grep " molecules " $filename  -n | sed 's/:\[ molecules \]//') + 1 )) $filename | grep SOL )<br />
echo "SOL          $sol_mol" >> $filename-new<br />
mv $filename-new $filename</code></p></blockquote>
<p>If anyone actually stumbles across this page and finds it useful (which I rather doubt, but you never know), I&#8217;d love to hear about it.</p>
<p>~William~</p>
]]></content:encoded>
			<wfw:commentRss>http://www.free2fall.net/blog/archives/180/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Natural Gas vs Electric Heating</title>
		<link>http://www.free2fall.net/blog/archives/114</link>
		<comments>http://www.free2fall.net/blog/archives/114#comments</comments>
		<pubDate>Sun, 06 Sep 2009 01:47:49 +0000</pubDate>
		<dc:creator>William</dc:creator>
				<category><![CDATA[Public]]></category>
		<category><![CDATA[Readable Reads]]></category>

		<guid isPermaLink="false">http://www.free2fall.net/blog/?p=114</guid>
		<description><![CDATA[This past Winter, one of the ongoing discussions that my housemates and I would have dealt with the amount of money that we were wasting keeping on electric appliances in the house unnecessarily. Everyone knows that keeping the lights on is a waste of money, but exactly how much? At first glance, it seems a [...]]]></description>
			<content:encoded><![CDATA[<p>This past Winter, one of the ongoing discussions that my housemates and I would have dealt with the amount of money that we were wasting keeping on electric appliances in the house unnecessarily. Everyone knows that keeping the lights on is a waste of money, but exactly how much? At first glance, it seems a simple enough calculation: just multiply the power rating (<a href="http://en.wikipedia.org/wiki/Watt">wattage</a>) by time by cost of electricity and you have a simple answer. However, one factor that would then be missing is the fact that the &#8220;wasted&#8221; energy of the light bulb goes then to a large extent to heating the house (this is why compact fluorescent bulbs and LEDs are so much more efficient: they don&#8217;t generate as much waste heat).</p>
<p>My housemates and I never got around to actually doing the calculations for us in particular, but the question again occurred to me today, so I sat down and did a quick back of the envelope calculation (with extensive use of google and wikipedia). Following:</p>
<p><strong>Cost per Joule of Heat from Electricity</strong></p>
<p>The average residential cost of electricity for 2009 so far is 11.38 cents / kWh (<a href="http://www.eia.doe.gov/cneaf/electricity/epm/table5_6_b.html">http://www.eia.doe.gov/cneaf/electricity/epm/table5_6_b.html</a>). 1 kWh = 3.6 * 10^6 J. Hence, it costs 3.16111111 * 10^-6 cents / J to heat your house using electricity.</p>
<p><strong>Cost per Joule of Heat from Natural Gas</strong></p>
<p>The average residential cost for natural gas in January 2009 was 12.41 dollars / thousand cubic feet of natural gas (<a href="http://tonto.eia.doe.gov/dnav/ng/ng_pri_sum_dcu_nus_m.htm">http://tonto.eia.doe.gov/dnav/ng/ng_pri_sum_dcu_nus_m.htm</a>). 1000 ft^3 = 2.83168466 * 10^4 liters.<br />
At <a href="http://en.wikipedia.org/wiki/Standard_conditions_for_temperature_and_pressure">STP</a>, 1 mol of gas = 22.4 liters, so 1000 ft^3 = 1264.14494 moles.<br />
Assume that natural gas is 100% methane (not <em>quite</em> true, but close enough).<br />
Heat of combustion for <a href="http://en.wikipedia.org/wiki/Methane#Combustion">methane</a>: 890 kJ/mol.<br />
Therefore, 1241 cents produces 1125089 kJ of heat<br />
==> 906.598711 kJ / cent<br />
= 906598.711 J / cent<br />
= 1.10302385 * 10^-6 cents / J.</p>
<p>Thus, it costs almost three times as much to heat your house using electricity than natural gas. Of course, this calculation is only partially relevant for such things as light bulbs, Xboxes, computers, etc., because some of the energy is lost (radiation from the house, energy used to send information over wires or the wireless, etc.), but even in the perfectly efficient scenario (which is only likely to occur with space heaters), it&#8217;s still considerably cheaper to use natural gas.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.free2fall.net/blog/archives/114/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Freerice.com</title>
		<link>http://www.free2fall.net/blog/archives/25</link>
		<comments>http://www.free2fall.net/blog/archives/25#comments</comments>
		<pubDate>Wed, 28 Nov 2007 06:10:21 +0000</pubDate>
		<dc:creator>William</dc:creator>
				<category><![CDATA[Fair Finds]]></category>
		<category><![CDATA[Public]]></category>

		<guid isPermaLink="false">http://www.freetofall.net/blog/archives/25</guid>
		<description><![CDATA[FreeRice is a sister site of the world poverty site, Poverty.com. FreeRice has two goals: 1. Provide English vocabulary to everyone for free. 2. Help end world hunger by providing rice to hungry people for free. [...] Perhaps even greater is the investment your donated rice makes in hungry human beings, enabling them to function [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>
FreeRice is a sister site of the world poverty site, Poverty.com.</p>
<p>FreeRice has two goals:</p>
<p>   1. Provide English vocabulary to everyone for free.<br />
   2. Help end world hunger by providing rice to hungry people for free.</p>
<p>[...]</p>
<p>Perhaps even greater is the investment your donated rice makes in hungry human beings, enabling them to function and be productive. Somewhere in the world, a person is eating rice that you helped provide. Thank you.
</p></blockquote>
<p>So many others have already blogged about this site, but it really is a win-win situation; you get both the satisfaction of improving your word repertoire and the knowledge that you&#8217;re helping fight hunger. So, <a href="http://freerice.com">check it out</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.free2fall.net/blog/archives/25/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
