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.
16.4.12
2.4.12
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:
Originally posted on my Wiki.
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.
14.3.12
Tweetdeck oddities
I've started using Tweetdeck to keep track of multiple twitter accounts and Facebook, and it's pretty cool. One thing that seems to be odd though, is that if you add multiple accounts, the "Home" column will show the feed from the first twitter account added and the Facebook feed, but not a second twitter feed. It took me a while to figure this out. I decided the easiest thing to do then was to have three columns, a timeline for each twitter account, and the facebook news feed.
I didn't see anything about this in the help, and there don't appear to be any options to change what appears in the "Home" column.
I didn't see anything about this in the help, and there don't appear to be any options to change what appears in the "Home" column.
9.3.12
Pushing to GitHub as two different users
So I recently decided to start using GitHub for both some personal and professional-related stuff. As these two areas can be very different, I decided that I wanted two separate GitHub accounts, but I wanted to be able to clone and push changes from either my work computer or my home computer (i.e. I might work on stuff either at work or at home, especially the professional-related items).
This can be done, but it took a bit of work. First, install and set-up Git on your machine. Test it, and make sure it works. Assuming this is the machine that you will be using two different accounts on, go back and generate a new set of ssh-keys, using the email address for your other GitHub account, and a different file name.
Probably try to give it some descriptive name so you know what it is
Now, in the ".ssh" directory, generate a file "config" if it doesnt exist, and set up a new host:
When you clone the repository you want to work on, use the ssh command like so:
cd into the directory, and also set your username and email address to correspond with that GitHub account for that local directory:
Now when you commit, the changes will be committed with the correct user, and more importantly when you "push" your changes back to GitHub, it will now use the alternative key that is set from the hosts file.
Based on information I found here: http://superuser.com/questions/232373/tell-git-which-private-key-to-use
Edit: GitHub assigns which user made which commit based on the user email address attached to the commit, so make sure you set the "user.email" correctly. If you are using GMail, you can add a "." anywhere in your email address and mail will still get to you, but GitHub (and Twitter, and others) will see it as a different address.
This can be done, but it took a bit of work. First, install and set-up Git on your machine. Test it, and make sure it works. Assuming this is the machine that you will be using two different accounts on, go back and generate a new set of ssh-keys, using the email address for your other GitHub account, and a different file name.
Probably try to give it some descriptive name so you know what it is
Now, in the ".ssh" directory, generate a file "config" if it doesnt exist, and set up a new host:
When you clone the repository you want to work on, use the ssh command like so:
cd into the directory, and also set your username and email address to correspond with that GitHub account for that local directory:
Now when you commit, the changes will be committed with the correct user, and more importantly when you "push" your changes back to GitHub, it will now use the alternative key that is set from the hosts file.
Based on information I found here: http://superuser.com/questions/232373/tell-git-which-private-key-to-use
Edit: GitHub assigns which user made which commit based on the user email address attached to the commit, so make sure you set the "user.email" correctly. If you are using GMail, you can add a "." anywhere in your email address and mail will still get to you, but GitHub (and Twitter, and others) will see it as a different address.
6.3.12
VizBi 2012 - Visualizing Biological Data
If you are interested in visualizing biological data, the 2012 Visualizing Biological Data conference is currently on. On the website they have videos of talks from previous years. In addition, there is an issue of Nature Methods from the 2010 conference that is probably worth checking out.
Follow the hashtag #vizbi
Follow the hashtag #vizbi
23.2.12
Software Carpentry
An article in this weeks edition of Nature on providing source code for journal articles that depend on new or original computer programs to analyze data (link) led to the discovery of two new resources:
1 - An article on scientists ability to write code (link)
2 - An actual course focused on teaching scientists how to write computer code, known as "Software Carpentry". The materials for the course are posted on-line, with full lecture content, as well as videos. If all you have is a basic introduction to programming, this might be useful.
My own programming experience, I have one intro to programming course from my Masters, and then did a lot of Matlab programming during my PhD (including GUI development), and then learned R, object-oriented and R packages during my PostDoc, and I think I am going to work through this course. I have finally been implementing unit-tests and using version control, but I am sure there are lessons to be learned from this course.
1 - An article on scientists ability to write code (link)
2 - An actual course focused on teaching scientists how to write computer code, known as "Software Carpentry". The materials for the course are posted on-line, with full lecture content, as well as videos. If all you have is a basic introduction to programming, this might be useful.
My own programming experience, I have one intro to programming course from my Masters, and then did a lot of Matlab programming during my PhD (including GUI development), and then learned R, object-oriented and R packages during my PostDoc, and I think I am going to work through this course. I have finally been implementing unit-tests and using version control, but I am sure there are lessons to be learned from this course.
Labels:
instruction,
software
17.2.12
Debugging R using "recover"
I just discovered today that one way to easily insert oneself into a mis-performing function in R is to use "recover", via options(error=recover).
This allows you to enter any of the functions involved in the error, at the point where the error occurred. Hope someone else finds this useful.
This allows you to enter any of the functions involved in the error, at the point where the error occurred. Hope someone else finds this useful.
Subscribe to:
Posts (Atom)