Firefox Keywords + Javascript = Magic!

Here is something particularly useful that I keep rediscovering for various reasons. Firefox allows you to refer to any bookmark with a keyword, and use that keyword as a shortcut in the address bar to access it. For example, if I create a bookmark that points to "http://www.google.com", and go to "Show all Bookmarks", and click on that bookmark, then I can modify the "Keyword" field, and I will then be able to simply type "google" in the address bar and go there. This has been in Firefox since a very early version.

This gets cooler in that you can easily set up these keywords to actually bookmark search services that will then take a search string following the keyword and redirect you to the search results.

From a Bioinformatics perspective, I could set up a custom search on the UCSC Genome browser that uses this string as the location:

And then give this bookmark the keyword "ratgenome". I could then search for genes in the Rat genome from the Firefox address "ratgenome 'genename'". For example, I could do the query 'ratgenome brca1' to search for "brca1" in Rat.

Now, how often do you look in just one place for something though? What if I wanted to search NCBI's gene database, Ensembl, GeneCards, and UCSC Genome browser? Now we create a simple javascript command, and save that as our bookmark with a keyword:

If I supply the keyword "genesearch", now I can simply do "genesearch brca1" and have all four windows open as tabs with my search results. This can be set up for almost any site as long as you can figure out what the search string parameters are, replacing the part of the URL that defines your query with "%s".

Inspiration from here.


Bioconductor, Git and SVN multiple branches

So the Bioconductor SVN repo is set up in the standard trunk / branches way, but as a developer, you only have write access to your package directory, which is either in "trunk/x/x/packageName" (dev) or "branches/releaseNum/x/x/packageName" (release). This is not what Git is expecting if you want to enable keeping track of release and dev in the same Git repository. How do you set it up so you can keep track of everything in a single repository like you might normally want?

I found some suggestions here, and show them below:

Clone your SVN repo:
git svn clone https://svnRepo/trunk/x/x/packageName packageName
Now add information about the branches:
git config --add svn-remote.releaseNum.url https://svnRepo/branches/releaseNum/x/x/packageName/
git config --add svn-remote.releaseNum.fetch :refs/remotes/releaseNum/
Now fetch and create a local branch tied to the remote:
git svn fetch releaseNum
git checkout -b local-releaseNum -t releaseNum
From these two branches, you should be able to create normal Git branches, work and modify them, and then go back and merge changes, rebase, and dcommit as usual. Although I'm sure you could clone each of these into separate git repos, you would then lose the ability to do a diff between them. I hope this saves someone else from searching over the web for a couple of hours.

Originally posted on my Wiki.