Notepad++ and Regular Expressions

A few years ago I wrote a post on making Notepad++ your default text editor, wherein I expressed my extreme love for this little piece of open source software. To date, I use it for just about everything and, after extensive use in a computational biology lab rotation, I figured I should share one of its most amazing features: Regular Expressions.

I’m not going to take the time to define Regular expressions (“REs” from now on) and will instead send you to Wikipedia. Just know that they are totally badass. In a nutshell, REs let you do really fancy search-and-replace in a text document. Perhaps that doesn’t excite you, but let me give some hypothetical situations in which you may find yourself:

  • You have a file of contact information for everyone you know (say, 1000 people) and want to get just the email addresses so that you can spam everyone.
  • You have a large FASTA file and want to pull out all of the organism names.
  • You want to convert a file from one format to another.
  • You want to combine multiple lines into a single line.
  • You want to separate a line into multiple lines.
  • Other pain-in-the-ass sounding stuff.

Sure, you could manually copy-paste all of those email addresses or organism names, and you could go through and hit the ENTER key to put things on separate lines. OR, you could write a few characters into NP++’s Find & Replace box. I think an example is the best way to make this work.

As a biologist, I’m rather fond of FASTA files. FASTA is simply a way to format DNA or protein sequence data so that people and programs can easily do stuff with that data. The format is:

Continue reading

Comp Bio is complicated

I finished up my first lab rotation two Fridays ago, here at UT Southwestern. It was a pleasant few months with an interesting project, consisting mostly of starting at a computer screen and writing Python scripts, running BLAST searches, and so on. To summarize, but leaving things vague (both for most-people-don’t-care reasons and the-data-is-unpublished reasons), the project was this:

There are currently a crap-ton (“crap-ton” is a standard scientific prefix) of bacterial and archaeal genomes published and available on NCBI‘s servers. Archaea, like bacteria, are single-celled prokaryotic organisms. However, they differ from bacteria genomically (and therefore metabolically) in many ways. Some archaeal properties are like those in eukaryotes (like us!), while others are like those in bacteria. So one of the huge unanswered questions in evolution is: how are bacteria, archaea, and eukaryotes related to each other? Or, how would we make a tree of life relating these three domains?

Continue reading

More Puzzling

In a previous post, I discussed my attempt to write a program to solve a puzzle. I never updated that post because, well, I ran the program all night and it didn’t find the solution!

I had made up a fake puzzle that I knew had a solution for testing, and the program could solve it in 15 minutes. But it couldn’t solve the one I had recorded for the real puzzle. I figured (and hoped) that I had simply recorded it wrong and to check, I re-recorded the pieces and tried again. And it worked! Here’s how:

Continue reading

Homeopathy: Belly Flop to a Cure!

Homeopathy says essentially this: Something that causes disease can be made to cure that same ailment if the something is diluted into water so much that it is no longer present. For example, if you were to take one molecule of cyanide and dilute it into a swimming pool, then drink some pool water, you would be cured of cyanide poisoning! Sound too simple to be true? Well, that’s because you must first release the Energy of the cyanide. Personally, I do this via belly-flopping into the swimming pool, though any kind of concussion of the water will do. Punching the water is also a pretty good way to do it.

Another example: it is clear that humans are basically a disease of the earth. We’re polluting the crap out of it, killing all the wildlife, etc. Now, this should be easy to fix with homeopathy. Since people are causing these bad things on Earth, all we need to do is have someone go swim in the ocean, concuss the ocean, and then distribute ocean water all over the world. In the same way that you can dilute a cyanide molecule into a pool, you can dilute one person into the ocean. You still need to release the Energy of that person, though. I would suggest the concussion be from underground faults leading to earthquakes and tsunamis, though enough belly flops would likely also do the trick. I feel quite certain that there have been a few people in the various oceans when these kinds of concussive events have occurred, therefore it is clear that Sea Water can already fix global warming!

And while we’re thinking about it, just imagine how many things have been diluted into the oceans: people, animals, plants, drugs, chemicals, pesticides, fish nets, volcanoes, tsunamis, airplanes, boats, etc, etc, ETC! This means that sea water can stop volcanoes from erupting, release fish from nets, repair damaged boats and aircraft, fix broken bones caused by tsunamis and downed aircraft, release the hallucinogenic hold of LSD, cure various cancers, and so on. In fact, if you have a disease, all you have to do is jump into the ocean, and then you will be diluted to homeopathic levels, meaning your disease will be diluted to homeopathic levels.

Belly flop into the ocean. Then drink up. Any disease you have will be cured!


My mother gave the fam a new game for Xmas called “The Impossible Puzzle.” Or maybe that was the company name. Either way, the label is certainly apt.

The puzzle is composed of nine, 4-sided pieces with interlocking parts in the shapes of the 4 card suits (hearts, diamonds, etc). There is only one way to lock the 9 pieces into a 3X3 square, and the game touts the fact that “there are over 300,000 combinations, only one of which is correct.”

Fig.1: An example of the puzzle pieces.

My mother, her bf, and myself all fiddled with this puzzle for a while before becoming too frustrated. There seemed to be no way to logically sort through the options of all possible arrangements and rotations of the pieces and clearly a brute-force method of trying all combinations would take way too long by hand. But maybe not for a computer. So, I figured this would be an excellent opportunity to try out my programming skills.

Continue reading