Monthly Archives: June 2009

Uploading Files from Android (progress update)

After I left the lab last night I realized I haven’t posted as to my activities in a while…

Basically, I’ve spent the past week+ researching various methods of achieving this task. I’ve looked into using CGI, JSP, and PHP for the server-side of the code. I had to scrap my CGI/JSP attempts as I couldn’t find any client side / server side code that meshed well (or tutorials to help me figure it out). I’ve been looking into a thread on using PHP, and it seems a lot more promising. I hope to have some results to show for all of this effort soon.

As a neat little side project (for when I need to take little breaks away from this upload thing), I’ve been working on that pseudo-tethering thing you can do with gphones and netbooks. I think it’d be useful for those of us with gphones to be able to (ab)use our 3G to get internet on our laptops where there isn’t any wifi. My last attempt at getting it to run crashed and burned though, so I’m going to go back to that one some other time.

GWT+Linux conflict quick fix

GWT was having trouble talking to mozilla on linux, producing this ugly error:


** Unable to load Mozilla for hosted mode **
java.lang.UnsatisfiedLinkError: /home/nick/eclipse/plugins/ cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(
at java.lang.ClassLoader.loadLibrary(
at java.lang.Runtime.load0(
at java.lang.System.load(



turns out this is a lot less of a problem then I initially thought from scouring forums. Fiddling with permissions on Mozilla files is not needed, just revert your standard C library back to 5 from 6:

sudo apt-get install libstdc++5

Easy peasy, GWT hosted mode back in business on Linux.


More Google

Google have released fusion: that allows you to upload ~250 MB of data and share it. There are some interesting uses we could explore with that. At least its more than the 1 MB limit on apps.

They also got to see the cell phone bioinformatics video today. No word yet on the response 🙂


GenomeSearch Video Online!

I created a demonstration video of the GenomeSearch application. This video is taken in the Android Emulator running on my desktop, so the mouse cursor in this video simulates my touch input on a real phone. The GenomeSearch application is definitely still unfinished, and is not perfect, but we feel good enough now about what it does do, that we feel comfortable releasing the .apk and the demonstration video. (See my previous post for .apk link!)

Watch the video here

Real Time Metagenomics

It’s finally live. Here’s the real time metagenomics site I’ve been working on. Bit of a crunch, because I need to use it in my course in Hawaii next week, and Liz is going to present it to the 454 User’s Meeting in Lisbon.

Its very text based. Yes, there are lots of percents floating around, and most of them should be made into javascript bars, but I left it like it is to emphasize that it’s a beta site. Maybe I should leave it in beta for the next 5 years.

Real time metagenomics, and the help site with documentation.

Enjoy, and let me know if you have suggestions, comments, or ideas.

Learning to “map”

Before I start, I have to use the usual disclaimer (I’m trained as a biologist- don’t be surprised I didn’t know “map”).

Rob directed me today to Perl’s “map,” a little function that I didn’t know about, and that seems to have the potential to solve many of my problems.

Map is documented here.

So, why do I need it?

Let’s say, for example, I have this list of protein pairs that are similar to each other: @sims = (1115.1, 1116.1, 1116.1, 1115.1, 1115.1, 1118.2, 1118.2, 1115.1, 1118.2, 1116.1, 1116.1, 1118.2). These are simply 4 homologs that hit each other reciprocally. To get a set of unique IDs of these homologs using Perl, my options are:

Option 1:

my %hash;
for my $k (@sims) {
     $hash {$k} = 1
print join “t”, keys %hash; 

Option 2:

my %hash;
for (@sims) {
     $hash {$_} = 1
print join “t”, keys %hash; 

Option 3: really shorter

my %hash;
map {$hash{$_} =1} @sims;
print join “t”, keys %hash; 

They all return:

1118.2 1115.1 1116.1

Changing Android SDK Versions in Eclipse mid-development

First of all, let me say that you should definitely avoid being in a position to need this guide if at all possible. I would highly reccomend ignoring anything that tells you to use a version older than that absolute newest one possible, because you’ll probably end up doing a lot of work to fix it later. Should you end up in this unfortunate circumstance like I did, here is how you change your SDK version in Eclipse the ugly “I don’t actually know how to fix this but I can hack it” way:

1) Create a new project (you can’t name it the same as your old one, name it something similar). This time use the new SDK version.

2) Delete the following files out of your new project, and copy-paste the ones from your old project in their place: all src->’’ files, all res->layout and res->value files, and finally, your Android manifest. Note that you may want to double check your Android manifest to see that the min SDK version variable updates itself. It did so for Daniel, but it may not for everyone.

3) Right click your old project, Refactor->Rename to old[ProjectName]. Right click your new project, Refactor->Rename to [ProjectName].

4) (Optional) if you’re using subclipse, it is now mad at you. You will still have a connection between your repository and what is new old[ProjectName]. To correct this, just do a commit of the newly made [ProjectName] directory, by going through all the steps associated with that. (Right-click, Team->Share Project, set up repository info, write commit comment etc). It will warn you that it needs to check out the most recent version, this should be fine since you likely have the most recent anyway, it does some magic and you get your pretty black asterisk back. Hurray!

Note that I am 100% sure all of this hackery is completely unncessary and that Eclipse has in it some magical function which would’ve just upgraded the SDK cleanly. However, I spent about an hour looking for said magic button and didn’t find it. In a pinch, you can use my foolish method to change your Android SDK version over!

GenomeSearch Demo Online!

I’ve uploaded a sneak peek of GenomeSearch in case anybody would like a look at the work we’re doing. To install it, first download it here, or use the QR code behind the read more cut (not working just yet, there are some issues with the .apk not being signed or something which prevent direct-to-phone installs), then follow the instructions here.What worked for me were the steps in the “How to Non-Market .Apk Application on Google Android G1 Phone” section. I connected my Ion to the Ubuntu PC I use in the lab via USB, typed adb install GenomeSearch.apk in a terminal window (from the correct directory), and it “just worked”. Note that I already have the SDK installed on this machine, had enabled applications from unknown sources, and that my Ion did not automatically mount itself as a USB storage device. Your mileage may vary on how much of that you already took care of for yourself!

A few words of warning for this version, beceause it is very alpha; if your internet connection is bad/nonexistant when you first launch the app, you will get a JSONParse error and the app won’t work (ever… I think). This is obviously a major cause for concern and a top priority for us at the moment. Assuming you have a decent connection and perform a valid search, there isn’t anything else that we know that will break the app. By all means though, when you find one, shoot Daniel or myself an email!


Continue reading

Finding sets of paralogs in phages

Input: BlastP files (all versus all)


1) Lists of proteins with nearly exact paralogs (nearly exact is up to you; E value < e-10 or 70% similarity or both or whatever) in each genome

2) Sets of paralogs (pairs or triplicates or more)

3) Number of sets per genomes. This allows later to ask the question of which genomes tend to have more paralogs and what factors control this.