Thursday, November 21, 2013

Comment out block of code in bash shell script

Credit goes to this post on Stack Overflow. I don't fully understand the syntax, but it works.
#!/bin/bash
echo "Before commented block"
: <<'END'
command 1 # Doesn't get executed
command 2 # Doesn't get executed
END
echo "After commented block"
Another commenter pointed out that the string 'END' does not have a specific meaning and any string can be used. In fact, it may be advantageous to use a different string that you know won't be present in your block of code. Much to my amusement, he suggested SNURFLE_BURGERS:
: <<'SNURFLE_BURGERS'
echo this is not executed
SNURFLE_BURGERS
I'm torn as to which naming convention to adopt.

Unarchive and decompress .tar.bz2 and .tar.gz (Ubuntu 12.04)

Archived and compressed files can be unarchived and decompressed with tar:
tar -xjvf targetfile.tar.bz2

tar -xzvf targetfile.tar.gz
Archived files can be unarchived with tar:
tar -xvf targetfile.tar
Compressed files can be decompressed with bunzip2 or gunzip:
bunzip2 targetfile.bz2

gunzip targetfile.gz

Saturday, November 16, 2013

Texas A&M ENG-LIFE Workshop + Journal Club

The Llama and I attended the first Texas A&M University ENG-LIFE Workshop: At the Interface of Engineering and Life Sciences. I think it was a successful and productive workshop, with strong attendance from multiple disciplines and a fair amount of research that I consider to be interdisciplinary.

The talks were all short, 15 minute talks on a wide range of topics, ranging from bioenergy to microfluidics to biological pathways modeled as logic circuits. I think this format was successful because it allowed researchers from different departments on campus to get a brief overview of the work going on elsewhere at the university to identify new potential collaborators.

The Llama and I were fortunate to have a brief discussion with Professor Aniruddha Datta about his work on modeling biological systems using pathway logic after his talk. I suspect the relaxed format of the conference along with the relatively small size encouraged many such introductions and discussions.

One of the presentations was from Professor Arum Han, a collaborator of one of the professors who heads our journal club, Professor Tim Devarrene, and Professor Han spoke on his work with microfluidic devices tailored for biological research. His talk was relevant to this week's journal club paper.

This week's journal club paper: In vivo lipidomics using single-cell Raman spectroscopy by Wu et al. (2011). The presenters were two members of the Devarrene lab, and so my comment was directed to them.

My comment:
"At the ENG-LIFE Workship today, one of your collaborators, Professor Arum Han, spoke on microfluidic platforms for oil production analysis. Are you all considering combining Raman spectroscopy or something similar with a microfluidics platform for high-throughput screening?"


Journal club: the trend towards rapid "high-throughput" development


Comment:
I think their method is a nice demonstration of where life science research strives to go, since it quickly samples in vivo conditions. But, I have a question concerning their proposal to scale this analysis to a rapid "high-throughput" method. It seems like their characterization is limited to what they already have in their training data, sort of like a microarray can only assay what we already know. Is this true, or did I misunderstand the technique?

Saturday, November 9, 2013

OpenGL vs Direct3D: A history

I've been searching around for some information to compare and contrast OpenGL and Direct3D (a component of DirectX). I happened upon this post at the programmers Stack Exchange. The accepted answer contributed by Nicol Bolas is a wonderfully written tale of the origins of OpenGL vs Direct3D, and how Direct3D has risen to dominance.

Here is an excerpt from the answer:
"
So, the OpenGL development environment was fractured for a time. No cross-hardware shaders, no cross-hardware GPU vertex storage, while D3D users enjoyed both. Could it get worse? 

You... you could say that. Enter 3D Labs. 

Who are they, you might ask? They are a defunct company whom I consider to be the true killers of OpenGL. Sure, the ARB's general ineptness made OpenGL vulnerable when it should have been owning D3D. But 3D Labs is perhaps the single biggest reason to my mind for OpenGL's current market state. What could they have possibly done to cause that? 

They designed the OpenGL Shading Language.
"

Friday, November 8, 2013

Journal club: One happy epigenetic family

This week's journal club paper: A SWI/SNF Chromatin-Remodeling Complex Acts in Noncoding RNA-Mediated Transcriptional Silencing by Zhu et al. (2013).

This paper was great.

My comment:
"I thought this paper was excellent. It painted a great story showing that the three major elements typically implicated in epigenetic regulation are elements of the same pathway. I don't think they made a very strong case that this regulatory pathway is important for elements other than transposons and repeats, but seeing as how transposons are such a large component of genomes, I think this work is important. This was good stuff."

Saturday, November 2, 2013

Using Emscripten to compile C++ to JavaScript on Windows 8

Small victories.

Credit goes to this post from Joshua Granick for providing the guidance for doing this.

Joshua Granick's post pointed to where the brilliant mind behind Emscripten (Alon Zakai) put up a guide for Using Emscripten on Windows.

His post also pointed to his code for drawing an image in C++ and compiling it to JavaScript found as a gist here.

Successful compilation of the code in his gist produces the image that he posted here of a red triangle on a black background.

I don't know anything about the Simple DirectMedia Layer yet, but I was able to change the colors and size of the image and display it in the browser. Below is a screenshot of the JavaScript produced image.


This means that C++ code was turned to JavaScript that was then executed in a browser. Magnificent.

Friday, November 1, 2013

Journal Club: Ugly dogs

This week's journal club paper: Integration of responses within and across Arabidopsis natural accessions uncovers loci controlling root systems architecture by Rosas et al. (2013)

This paper was like one of those dogs that's so ugly it's cute.

My comment:
"I think this is a flawed paper, but the authors' logic was so strange that I liked it. I think the idea that phenotypic plasticity is a mechanism leading to fixed genetic diversity is an odd one, and I don't think that they demonstrated that their candidate genes mediate phenotypic plasticity. However, I can't propose a better way to convincingly test their proposed hypothesis."

Journal club wonkiness

I think their hypothesis is entirely wonko as it aims to answer a question on the origin of natural variance. #ihatefrogs

This paper introduces an interesting experimental approach to identify genes that both enable phenotypic plasticity and underlie adaptive changes across natural variants. I think that the authors should have defended the significance of their Principal Component phenotypes with respect to how those phenotypes are relevant in natural settings, otherwise there isn't a good reason to actually use the PC phenotypes in the downstream analyses.