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

Google chrome

Who would have thought that a browser would actually make the news? It’s been on NYT and CNN! I guess this is because Google has become a massive giant of a company, and this move is interesting for the competition between Microsoft and the Goog. This makes me excited for the day when Google is making operating systems for computers and phones, and has a web app for every imaginable need that I might have. I am a happy Google minion and, at least at the moment, feel safe in the knowledge that Google will eventually take over the world (and rename it Google Earth…)

Hahahahahahha.haha….. ha….


Anyway, I just wanted to throw my thoughts on this new shiny browser into the cloud with everyone else’s. Firstly, It is no Firefox. Chrome totally lacks any frills. Seriously, it has none. All it has is a smart search/address bar (which has been combined into one, unlike in most browsers). So you only have to go to the one bar (I believe they call it the “Omnibar”) to do all of your searching and direct moving needs.

My favorite thing about Chrome is how it rearranged everything. The app is tiny and fast, and the tabs have been moved into the Title bar! I have never seen any program do this, but I absolutely love that Google used up that normally-useless space so that more screen could be dedicated to actual internet pages. Brilliant. This is especially useful for those of us with tiny laptops (the Eee PC is not known for having a large monitor).

I have mixed feelings about the lack of frills, though since the browser is still in beta I have no idea what will be added in future editions. I like that it’s kept so simple, since it is basically designed to support web apps. But it has almost no customization ability. In both Firefox and IE, you can tell the browser to delete cookies after each session. You can’t in chrome. You can’t do anything in chrome.

Granted, most of these things are a bit unnecessary, I’d still like to be able to do them.

Either way, it’s impossible to screw up while using Chrome. All tabs operate independently, so that if one crashes all of your other tabs are fine. There are no options that you can fiddle with and end up breaking something, and in fact there are nearly no buttons to confuse you in the first place.

So I definitely recommend this browser. Though it doesn’t have the feeling of being your personal browser, like Firefox does, it does its job very well. Download it here. You will download a tiny installer (half a Mb) that will then install from the internet. As you install, it will do the usual asking if you want it to import settings and bookmarks from Firefox (or, Isis forbid, IE) and if you want to make it your default browser. You’ll probably want to start with “no” for that question, though if you don’t do anything fancy with your browser you should just go ahead and say “yes.”