<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>kylebarlow.com</title><link href="https://www.kylebarlow.com/" rel="alternate"></link><link href="https://www.kylebarlow.com/feeds/all.atom.xml" rel="self"></link><id>https://www.kylebarlow.com/</id><updated>2016-09-16T13:00:00-07:00</updated><entry><title>How to print a large image on multiple pages, using Python!</title><link href="https://www.kylebarlow.com/how-to-print-a-large-image-on-multiple-pages-using-python.html" rel="alternate"></link><published>2013-11-19T01:26:00-08:00</published><updated>2013-11-19T01:26:00-08:00</updated><author><name>Kyle Barlow</name></author><id>tag:www.kylebarlow.com,2013-11-19:/how-to-print-a-large-image-on-multiple-pages-using-python.html</id><summary type="html">&lt;html&gt;&lt;body&gt;&lt;p&gt;I recently received a high-resolution image of a famous historical
figure (details to come soon...). Naturally, my roommates and I wanted
to print this famous person out and create a life-size cardboard cutout.
Since I only have the capability to print on standard 8.5 x 11 inch
paper, I …&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</summary><content type="html">&lt;html&gt;&lt;body&gt;&lt;p&gt;I recently received a high-resolution image of a famous historical
figure (details to come soon...). Naturally, my roommates and I wanted
to print this famous person out and create a life-size cardboard cutout.
Since I only have the capability to print on standard 8.5 x 11 inch
paper, I needed a way to split the image onto multiple pages to print.&lt;/p&gt;
&lt;p&gt;I found web-based tools that can do this, or you could use Photoshop
or some other proprietary software, but I didn't find any good tools I
could use on Ubuntu to maintain resolution. I whipped up a Python script
that can do this, relying on the
&lt;a class="reference external" href="http://pillow.readthedocs.org/en/latest/"&gt;Pillow&lt;/a&gt; implementation of
PIL (Python Image Library). You can download it from
&lt;a class="reference external" href="https://github.com/kylebarlow/image-splitter"&gt;Github&lt;/a&gt;. Feel free to
submit pull requests if you flesh it out further, as it is rather basic
right now (it's licensed under GPLv3).&lt;/p&gt;
&lt;p&gt;&lt;a class="reference external" href="https://github.com/kylebarlow/image-splitter"&gt;https://github.com/kylebarlow/image-splitter&lt;/a&gt;&lt;/p&gt;
&lt;/body&gt;&lt;/html&gt;</content></entry><entry><title>Installing Ubuntu 13.04 Raring Ringtail on a MacBook Pro for Dual Booting</title><link href="https://www.kylebarlow.com/installing-ubuntu-1304-raring-ringtail-on-a-macbook-pro-for-dual-booting.html" rel="alternate"></link><published>2013-05-22T06:06:00-07:00</published><updated>2013-05-22T06:06:00-07:00</updated><author><name>Kyle Barlow</name></author><id>tag:www.kylebarlow.com,2013-05-22:/installing-ubuntu-1304-raring-ringtail-on-a-macbook-pro-for-dual-booting.html</id><summary type="html">&lt;html&gt;&lt;body&gt;&lt;p&gt;I recently installed Ubuntu onto my MacBook alongside OSX for dual
booting, and learned a few lessons throughout the process. Below are the
steps that I took. I have a MacBookPro 8,1 but these instructions might
be applicable to other models as well. Be sure to also read
the …&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</summary><content type="html">&lt;html&gt;&lt;body&gt;&lt;p&gt;I recently installed Ubuntu onto my MacBook alongside OSX for dual
booting, and learned a few lessons throughout the process. Below are the
steps that I took. I have a MacBookPro 8,1 but these instructions might
be applicable to other models as well. Be sure to also read
the&lt;a class="reference external" href="https://help.ubuntu.com/community/MacBookPro"&gt;"official" Ubuntu installation
guide&lt;/a&gt;. I also found &lt;a class="reference external" href="http://randomtutor.blogspot.com/2013/02/installing-ubuntu-1304-on-retina.html"&gt;a
post by James
Jesudason&lt;/a&gt;
to be helpful.&lt;/p&gt;
&lt;p&gt;These instructions are fairly sparse, but should help point you in the
right direction if you are less experienced with any of the steps.&lt;/p&gt;
&lt;ol class="arabic"&gt;
&lt;li&gt;&lt;p class="first"&gt;Reduce partition size in the OSX "disk utility" tool. I dragged the
partition size until I had enough free space left on the disk for my
Ubuntu partition (I wanted 50gb but less should be ok). This took
several hours.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Install the &lt;a class="reference external" href="http://www.rodsbooks.com/refind/"&gt;rEFInd boot
manager&lt;/a&gt;. I downloaded the most
recent binary file (0.6.11) and ran install.sh, which worked without
any other options. rEFInd was installed into the /EFI on my root
filesystem.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Install the &lt;a class="reference external" href="http://www.rodsbooks.com/refind/drivers.html"&gt;ext4
driver&lt;/a&gt; in rEFInd.
The driver is packaged with the binaries, but must be copied into
/EFI/refind/drivers in order to be active. I had to create the
drivers directory in /EFI with "sudo mkdir /EFI/refind/drivers" as it
did not already exist. I then copied (as root) "ext4_x64.efi"
from refind-bin-0.6.11/refind/drivers_x64 into the newly created
drivers directory.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Load the Ubuntu installer CD (must be the special Mac &lt;a class="reference external" href="http://releases.ubuntu.com/raring/"&gt;version of
Ubuntu&lt;/a&gt; - labeled on that page
as "64-bit Mac (AMD64) desktop image"). Instead of choosing to
install Ubuntu, choose to try it out instead. Open up a terminal and
run "ubiquity -b" and then proceed with the installation. Running
with the -b flag tells Ubuntu not to install a bootloader, which
won't be necessary as rEFInd can boot a kernel directly. During the
install process, the default option should be to install in the disk
free space, but you should verify this. I chose to manually create an
ext4 partition for my root mount point and a 2gb swap partition
instead of using the automatic option.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;After the installation finishes, select the option to continue to try
Ubuntu. In the terminal, run something like "sudo blkid /dev/sda*".
Look for the UUID corresponding to your Ubuntu root mount point.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;With Ubuntu still loaded off the LiveCD, find the /boot partition in
your new install. This should probably be mounted somewhere in
/media. In /media/.../boot, create a file called refind_linux.conf.
Save the below options (from the &lt;a class="reference external" href="http://www.rodsbooks.com/refind/linux.html"&gt;rEFInd
documentation&lt;/a&gt;),
replacing the UUID with the one you noted in the last step
corresponding to your Ubuntu install, into this
file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="s2"&gt;"Boot with standard options"&lt;/span&gt; &lt;span class="s2"&gt;"root=/dev/sda3 ro quiet splash vt.handoff=7"&lt;/span&gt;
&lt;span class="s2"&gt;"Boot to single-user mode"&lt;/span&gt;   &lt;span class="s2"&gt;"root=UUID=1cd95082-bce0-494c-a290-d2e642dd82b7 ro single"&lt;/span&gt;
&lt;span class="s2"&gt;"Boot with minimal options"&lt;/span&gt;  &lt;span class="s2"&gt;"root=UUID=1cd95082-bce0-494c-a290-d2e642dd82b7 ro"&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;When you restart, Ubuntu should automatically be detected and
available to use in the rEFInd boot menu. You can make it the default
boot option by setting default_selection in /EFI/refind/refind.conf
accordingly&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I modified these steps slightly from the ones that I took, so let
me know in the comments if you run into any problems. Hope this helps!&lt;/p&gt;
&lt;/body&gt;&lt;/html&gt;</content><category term="ubuntu"></category></entry><entry><title>March madness python bracket generator</title><link href="https://www.kylebarlow.com/march-madness-python-bracket-generator.html" rel="alternate"></link><published>2013-03-20T02:48:00-07:00</published><updated>2013-03-20T02:48:00-07:00</updated><author><name>Kyle Barlow</name></author><id>tag:www.kylebarlow.com,2013-03-20:/march-madness-python-bracket-generator.html</id><summary type="html">&lt;html&gt;&lt;body&gt;&lt;p&gt;I created a simple python script to read in &lt;a class="reference external" href="http://www.nytimes.com/interactive/2013/03/18/sports/ncaabasketball/nate-bracket.html"&gt;Nate Silver's march
madness
predictions&lt;/a&gt; and
generate random brackets based on his given probabilities. This will
give a diverse, non-deterministic, set of potential brackets as results.
You can also run the simulation until you get a desired champion.&lt;/p&gt;
&lt;p&gt;If you are …&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</summary><content type="html">&lt;html&gt;&lt;body&gt;&lt;p&gt;I created a simple python script to read in &lt;a class="reference external" href="http://www.nytimes.com/interactive/2013/03/18/sports/ncaabasketball/nate-bracket.html"&gt;Nate Silver's march
madness
predictions&lt;/a&gt; and
generate random brackets based on his given probabilities. This will
give a diverse, non-deterministic, set of potential brackets as results.
You can also run the simulation until you get a desired champion.&lt;/p&gt;
&lt;p&gt;If you are interested in the script, it is available on
&lt;a class="reference external" href="https://github.com/kylebarlow/marchmadness"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Go bears...hopefully&lt;/p&gt;
&lt;/body&gt;&lt;/html&gt;</content><category term="python"></category><category term="gobears"></category></entry><entry><title>Of mice and men: an Alzheimer’s cure for our murine brethren</title><link href="https://www.kylebarlow.com/of-mice-and-men-an-alzheimers-cure-for-our-murine-brethren.html" rel="alternate"></link><published>2012-05-02T22:55:00-07:00</published><updated>2016-09-16T13:00:00-07:00</updated><author><name>Kyle Barlow</name></author><id>tag:www.kylebarlow.com,2012-05-02:/of-mice-and-men-an-alzheimers-cure-for-our-murine-brethren.html</id><summary type="html">&lt;html&gt;&lt;body&gt;&lt;p&gt;Alzheimer's disease is the most common form of dementia, and is
predicted to affect 1 in 85 people by the year 2050. And unlike stroke,
prostate cancer, heart disease, and HIV, diseases in which we have made
progress in treating, Alzheimer's disease has been increasing in
prevalence as a cause …&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</summary><content type="html">&lt;html&gt;&lt;body&gt;&lt;p&gt;Alzheimer's disease is the most common form of dementia, and is
predicted to affect 1 in 85 people by the year 2050. And unlike stroke,
prostate cancer, heart disease, and HIV, diseases in which we have made
progress in treating, Alzheimer's disease has been increasing in
prevalence as a cause of death. While this is probably partly due to the
fact that we have been living longer and Alzheimer's is typically (but
not always) a disease of the elderly, there is no denying that
Alzheimer's is a disease in need of attention.&lt;/p&gt;
&lt;p&gt;There are a few existing Alzheimer's treatments that can provide mild
relief of symptoms, but none halt or even slow disease progression. Why
have we not been able to come up with an effective treatment for this
increasingly common disease? Here's one reason - we're not even sure
what causes the disease!&lt;/p&gt;
&lt;p&gt;A prime suspect in the disease are amyloid-beta proteins. These
proteins may have accomplices that also cause Alzheimer's, but
amyloid-beta proteins play a definite, if not starring role.
Amyloid-beta proteins are misfolded chunks of another protein,
creatively named APP for amyloid precursor protein. I use the word
"chunks" because the bits of the protein that misfold and form
aggregates are made up of pieces of a larger protein that gets cut up by
enzymes, as shown below.&lt;/p&gt;
&lt;div class="figure align-center" style="width: 2844px; height: auto; max-width: 100%;"&gt;
&lt;img alt="Amyloid Plaque Formation Mechanism" src="https://www.kylebarlow.com/images/Amyloid-plaque_formation-big.jpg" style="width: 2844px; height: auto; max-width: 100%;"/&gt;
&lt;p class="caption"&gt;Image credit: &lt;a class="reference external" href="https://commons.wikimedia.org/wiki/File:Amyloid-plaque_formation-big.jpg"&gt;ADEAR: Alzheimer's Disease Education and Referral Center, a service of the National Institute on Aging&lt;/a&gt;&lt;/p&gt;
&lt;div class="legend"&gt;
Enzymes act on the APP (Amyloid precursor protein) and cut it into fragments of protein, one of which is called beta-amyloid and its crucial in the formation of senile plaques in Alzheimer's&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;What does the full-lenth amyloid precursor do as it's chilling outside
the cell, all floppy and blue? (Note: proteins are not actually blue and
cartoony as shown in the above figure. They are very tiny.) We don't
even know that! We do know that when amyloid-beta begins to misfold, it
aggregates with other proteins and that these aggregates probably cause
neuron damage. Other neurodegenerative diseases such
as Creutzfeldt-Jakob disease or Parkinson's are also linked to these
aggregates of misfolded proteins, generally called amyloids.&lt;/p&gt;
&lt;p&gt;Get out your tarp, because this might blow your mind: what we call
protein "misfolding" in Alzheimer's and other diseases may actually be
related to the normal activity of these proteins! What else besides
protein misfolding and neurodegneration ties together Alzheimer's, CJD,
and Parkinson's? We don't know what any of the precursor proteins in
those diseases as their normal functions. It COULD (big emphasis on the
could) be possible that some of these proteins are meant to be sometimes
be folded in the amyloid state, and that these neurodegenerative
diseases are caused by an upset in the natural equilibrium of "normally
folded" and "misfolded" amyloid states. I plan to blog more on protein
folding and amyloids but here's a teaser for another paper I will cover
- amyloid proteins may help explain how memory works.&lt;/p&gt;
&lt;p&gt;Now that I have not-definitively-at-all covered the background of
Alzheimer's, let's get to the paper I want to talk about today. This
paper, "ApoE-Directed Therapeutics Rapidly Clear Β-Amyloid and Reverse
Deficits in AD Mouse Models," [@cramer_apoe-directed_2012] was published in March as a ScienceExpress
article. This means that the editors of the journal Science thought it
was important enough to rush out and publish online. Added bonus for
overworked grad students like myself - ScienceExpress papers are short!&lt;/p&gt;
&lt;div class="section" id="punchline"&gt;
&lt;h2&gt;Punchline&lt;/h2&gt;
&lt;p&gt;The authors of this paper do something kind of amazing - they find a
drug, bexarotene, that they can give to mice with Alzheimer's and almost
immediately clear out the deposits of aggregated amyloid-beta protein
that build up in the brains of people and mice with Alzheimer's. Even
better - this drug is already FDA approved for the treatment of cancer.
And as chemotherapy drugs go, its side-effects aren't that bad, so we
know we can give it to humans relatively safely.&lt;/p&gt;
&lt;p&gt;How amazing is this drug? The authors take images of brain slices from
mice pre and post treatment. Aggregates of amyloid-beta can be
visualized and counted by adding a florescent antibody. After only three
days, the amount of aggregated protein in both the cortex and
hippocampus of affected mice has decreased by nearly half, and the
decrease continues for several weeks. This is great!&lt;/p&gt;
&lt;p&gt;The authors also show that not only do the plaques that may cause the
disease dissipate, the mice also experience restored memory and
cognition, which would be an amazing result if it holds in humans. In
mice, building nests is a social behavior that healthy mice can perform
but that Alzheimer's-affected mice cannot. After treatment with
bexarotene, nest-making ability in diseased mice was restored.
Bexarotene treatment also restores the sense of smell in Alzheimer's
mice, another great sign because humans with Alzheimer's also experience
loss of smell.&lt;/p&gt;
&lt;p&gt;How does the drug work? There is a protein called apoE naturally
expressed in your neurons. This protein gets secreted out, attaches
itself to amyloid-beta aggregates, and helps break down these
aggregates. apoE encourages microglia, helper cells in your brain, to
eat up through phagocytosis amyloid-beta aggregates and then to break
down the aggregates. Everyone's brain, even in people with Alzheimer's,
already makes apoE and breaks down amyloid-beta aggregates. Alzheimer's
could be caused by an inability to break down amyloid-beta fast enough
(like healthy people do), so making more apoE could reverse the disease.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="so-we-have-a-cure-for-alzheimer-s-right"&gt;
&lt;h2&gt;So we have a cure for Alzheimer's right?&lt;/h2&gt;
&lt;p&gt;Right! ... for mice. Anyone who's ever read about an amazing cure for a
disease found in mice already knows that this cure is not likely to work
in humans. Although mice have
&lt;a class="reference external" href="http://en.wikipedia.org/wiki/Homology_(biology)"&gt;versions&lt;/a&gt; of 99% of
the proteins we have, we also share a majority of our genome with
plants. And as much as I try, laying in the sun does not make me full,
just sleepy and full of vitamin D, so simply sharing similar genes does
not make me the same as a mouse or plant. It's particularly tricky to
translate a therapy for a neurodegenerative disease from mice to humans,
since we think so differently than they do, at least based on my
conversations with mice.&lt;/p&gt;
&lt;p&gt;A further complication are the mice we perform Alzheimer's research on.
In order to do this research, scientists had to create mice that could
serve as models for the human disease. This was done by inserting in
human genes that cause Alzheimer's, creating an imperfect model. Mice
models of disease do not show all of the symptoms that humans with
Alzheimer's do and may in fact be better models for early stages of
disease progression than late. If so, bexarotene may be able to be used
as a preventative therapy, but not as a cure.&lt;/p&gt;
&lt;p&gt;Even with these grains of salt in mind, I still found this paper very
exciting. I look forward to seeing what the results of ongoing clinical
trials of bexarotene as an Alzheimer's therapy in humans will be. With a
little luck, this drug can succeed where so many other promising drugs
in mice have failed and become a useful therapy in humans.  If a loved
one of mine had Alzheimer's, I would be watching the clinical trial
results &lt;em&gt;very&lt;/em&gt; closely.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="update-2016-09-16"&gt;
&lt;h2&gt;Update (2016-09-16):&lt;/h2&gt;
&lt;p&gt;Multiple groups ([@fitz_comment_2013], [@price_comment_2013], [@tesseur_comment_2013], [@veeraraghavalu_comment_2013]) have since tried to replicated the results of this study, with only mixed success, at best (see &lt;a class="reference external" href="http://www.nature.com/news/studies-cast-doubt-on-cancer-drug-as-alzheimer-s-treatment-1.13058?WT.ec_id=NEWS-20130528"&gt;Nature News&lt;/a&gt; for a good summary).
Since the results of the study can't even be replicated consistently in mice, I have further doubts about the chances of bexarotene working in humans.&lt;/p&gt;
&lt;/div&gt;
&lt;/body&gt;&lt;/html&gt;</content><category term="prions"></category><category term="research"></category></entry><entry><title>Dearth and taxes</title><link href="https://www.kylebarlow.com/dearth-and-taxes.html" rel="alternate"></link><published>2012-04-23T02:30:00-07:00</published><updated>2012-04-23T02:30:00-07:00</updated><author><name>Kyle Barlow</name></author><id>tag:www.kylebarlow.com,2012-04-23:/dearth-and-taxes.html</id><summary type="html">&lt;html&gt;&lt;body&gt;&lt;p&gt;Although I am quite fortunate to receive a stipend to help me get
through graduate school, I wouldn’t exactly call my lifestyle luxurious.
I consider rice and beans to be an easy, cheap, nutritious meal, but for
some reason my non-grad student friends (let’s call them "real adults …&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</summary><content type="html">&lt;html&gt;&lt;body&gt;&lt;p&gt;Although I am quite fortunate to receive a stipend to help me get
through graduate school, I wouldn’t exactly call my lifestyle luxurious.
I consider rice and beans to be an easy, cheap, nutritious meal, but for
some reason my non-grad student friends (let’s call them "real adults")
think that it is strange for me to want to eat this dish continuously.
Shouldn’t we all be restricting our meat intake, anyways?&lt;/p&gt;
&lt;p&gt;A further financial complication arises from the fact that Uncle Sam
feels that we grad students are responsible enough to manage our
finances and pay our taxes without any help from him in the form of
withholdings. This makes sense, because the tax code is not difficult at
all to understand and we all have lots of free time to figure it out –
NOT. Unfortunately, my school does not seem to provide much in the way
of resources to help us decipher our fiduciary obligations.&lt;/p&gt;
&lt;p&gt;In an effort to help future generations of grad students figure out
their tax situation, below is some of the meager knowledge I have gained
by searching through the intertubes and reading IRS pdfs. Note: I am not
a "professional" in any sense of the term, so the usual legal disclaimer
applies that you should not consider this to be tax advice; it is
general information only. Also note that my first year funding comes
from a NIH training grant. Different funding sources may result in
different tax scenarios.&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Grad students receiving scholarship money are not "self-employed" and
do not need to pay the higher self-employment tax rate, even though
there is at least &lt;a class="reference external" href="http://scienceblogs.com/sciencewoman/2008/01/the_taxman_cometh_not_1.php"&gt;one
example&lt;/a&gt; of
the IRS auditing a grad student and trying to get them to do so. This
means that I am not currently contributing to social security or
medicare and am just paying income taxes, which sucks because I think
those programs are important.&lt;/li&gt;
&lt;li&gt;"Taxable income" for me is the difference between box 5 and box 1 on
my 1098-T tuition statement form. This is higher than my stipend
because it includes money which pays for my health insurance, which
should also be taxed. 1098-T forms can be viewed online
at &lt;a class="reference external" href="https://www.1098t.com/"&gt;https://www.1098t.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Scholarship income is not "earned income" and thus I cannot make any
IRA contributions using my stipend.  See this &lt;a class="reference external" href="http://www.bogleheads.org/forum/viewtopic.php?f=1&amp;amp;t=58606&amp;amp;sid=f93454473a48ad06c451a04c24f49c11"&gt;forum
thread&lt;/a&gt;
and &lt;a class="reference external" href="http://www.irs.gov/pub/irs-pdf/p590.pdf"&gt;IRS publication 590&lt;/a&gt;
for details. The bottom-line from Pub 590: "Scholarship and
fellowship payments are compensation for IRA purposes only if shown
in box 1 of Form W-2"&lt;/li&gt;
&lt;li&gt;Since there is no witholding from my stipend, I must
make &lt;a class="reference external" href="http://www.irs.gov/businesses/small/article/0,,id=110413,00.html"&gt;estimated
tax&lt;/a&gt; payments
quarterly, both to the IRS and to California's Franchise Tax Board.&lt;/li&gt;
&lt;/ul&gt;
&lt;/body&gt;&lt;/html&gt;</content><category term="gradlife"></category></entry><entry><title>How to limit degrees of freedom when generating small molecule conformers with Confab in Open Babel</title><link href="https://www.kylebarlow.com/limited-freedom-conformer-generation.html" rel="alternate"></link><published>2012-04-23T02:30:00-07:00</published><updated>2012-04-23T02:30:00-07:00</updated><author><name>Kyle Barlow</name></author><id>tag:www.kylebarlow.com,2012-04-23:/limited-freedom-conformer-generation.html</id><summary type="html">&lt;html&gt;&lt;body&gt;&lt;p&gt;&lt;a class="reference external" href="https://www.rosettacommons.org/"&gt;Rosetta&lt;/a&gt;, the macromolecular software modeling suite (which I contribute to as a developer), is great at modeling proteins, but not always so great at dealing with non-protein chemistry, including small molecules.&lt;/p&gt;
&lt;p&gt;I've worked on several projects that used Rosetta with the intent of designing a protein to bind a novel …&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</summary><content type="html">&lt;html&gt;&lt;body&gt;&lt;p&gt;&lt;a class="reference external" href="https://www.rosettacommons.org/"&gt;Rosetta&lt;/a&gt;, the macromolecular software modeling suite (which I contribute to as a developer), is great at modeling proteins, but not always so great at dealing with non-protein chemistry, including small molecules.&lt;/p&gt;
&lt;p&gt;I've worked on several projects that used Rosetta with the intent of designing a protein to bind a novel small molecule.
At the beginning of the workflow, I usually download a two-dimensional representation of the small molecule that, when visualized, looks something like this:&lt;/p&gt;
&lt;div class="figure align-center"&gt;
&lt;object data="https://www.kylebarlow.com/images/Acetyl-CoA-2D_colored.svg" type="image/svg+xml"&gt;
2-dimensional representation of acetyl coenzyme A (acetyl-CoA) structure&lt;/object&gt;
&lt;p class="caption"&gt;&lt;a class="reference external" href="https://en.wikipedia.org/wiki/Acetyl-CoA"&gt;Acetyl coenzyme A / acetyl-CoA&lt;/a&gt; (2D)&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Rosetta needs to be given a parameter file specifying the chemistry of a small molecule in order to
score it. Recent design algorithms such as coupled moves [@@ollikainen_coupling_2015] also require
input of "conformers", a set of low-energy, three-dimensional states that the molecule is likely to access. Appropriate conformer input, when visualized, looks like this:&lt;/p&gt;
&lt;div class="figure align-center" style="width: 700px; height: auto; max-width: 100%;"&gt;
&lt;img alt="3-dimensional representation of acetyl coenzyme A (acetyl-CoA) structure" src="https://www.kylebarlow.com/images/Acetyl-CoA-3D.png" style="width: 100px;width: 700px; height: auto; max-width: 100%;"/&gt;
&lt;p class="caption"&gt;&lt;a class="reference external" href="https://en.wikipedia.org/wiki/Acetyl-CoA"&gt;Acetyl coenzyme A / acetyl-CoA&lt;/a&gt; (3D)&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Note that since acetyl-CoA is a large (small) molecule, the conformers I generated only access rotamer
degrees of freedom at one end of the acetyl-CoA molecule.
If I did not limit degrees of freedom in this way, the number of conformers to generate and then sample
in Rosetta would be intractable.
Additionally, if I were going to design a catalytic interaction between acetyl-CoA and a protein of interest, only the portion of the small molecule that is near the active site would need to be modeled as flexible in a coupled moves design simulation.&lt;/p&gt;
&lt;p&gt;As my lab does not currently license any of the commercially available software (which can be
quite expensive) commonly used to generate small molecule conformers, I needed to find free for
academic use(and preferably open source) software to do the job.
Fortunately, several good options exist, such as the Confab [@@oboyle_confab_2011] algorithm within the
Open Babel [@@oboyle_open_2011] chemical toolbox.
Even better, the performance of Confab has been compared with other open-source and paid software [@@ebejer_freely_2012], and it compares favorably, especially when used on flexible molecules (those with 10 or more rotatable bonds).&lt;/p&gt;
&lt;p&gt;I then ran into a snag: I couldn't find an off-the-shelf way with Confab's command line interface to generate conformers/rotamers for only a subset of rotatable bonds in a small molecule.
Fortunately, Open Babel has powerful bindings for scripting available, including in Python.
I wrote a script that takes in a small molecule as input and an optional argument of atoms allowed
to move in conformer generation. Rotatable bonds will only be sampled by Confab if they involve these specified "unfrozen" atoms.&lt;/p&gt;
&lt;p&gt;You can view the script embedded below, &lt;a class="reference external" href="https://gist.github.com/kylebarlow/1756ea399ba6bfee3c2d3d054c17c3a3#file-generate_limited_rotamer_set-py"&gt;at the gist page at Github with formatting and the ability to comment&lt;/a&gt;, or &lt;a class="reference external" href="https://gist.githubusercontent.com/kylebarlow/1756ea399ba6bfee3c2d3d054c17c3a3/raw/414914e3bcebeb21942c3eff9910f2cb911a2aca/generate_limited_rotamer_set.py"&gt;as a raw file ready to download&lt;/a&gt;. I hope it's useful! Improvements are welcome as well; I've licensed the script under the MIT license.&lt;/p&gt;
&lt;script src="https://gist.github.com/kylebarlow/1756ea399ba6bfee3c2d3d054c17c3a3.js"&gt;&lt;/script&gt;&lt;/body&gt;&lt;/html&gt;</content><category term="compbio"></category></entry></feed>