Monthly Archives: July 2009

Android: Nuts and Bolts IV

Android: Nuts and Bolts IV could easily be titled “The Right Way To Do Android: Nuts and Bolts III”. Since writing my last entry discussing Relative versus Linear Layout, I have made an important discovery! Table Layout actually solves the problem much better than my previous hokey tinkering did. (In fact, just bookmark that page, or print it out and frame it or something, it’ll save you a lot of time.) I also learned some really cool stuff about phone orientation changes, alternate layouts, and alternate resources in general.

For a more detailed description of TableLayout and other neat stuff I’ve learned since N&B III, check behind the Read More cut.

 

Continue reading

Dealing with Variant counts

Here is a sample of the data I collated for Actinobacillus_pleuropneumoniae_L20_(416269.5). This data is for the compound C00025, which is L-Glutamate.  Only the first 6 reactions are shown; there are about 150.

C00025:R00021:
Glutamine,_Glutamate,_Aspartate_and_Asparagine_Biosynthesis     Ferredoxin-dependent glutamate synthase (EC 1.4.7.1)            1.24
cAMP_signaling_in_bacteria      Ferredoxin-dependent glutamate synthase (EC 1.4.7.1)            0
Gamma-aminobutyrate_(GABA)_shunt        Ferredoxin-dependent glutamate synthase (EC 1.4.7.1)            0
Photorespiration_(oxidative_C2_cycle)   Ferredoxin-dependent glutamate synthase (EC 1.4.7.1)            -1
Ammonia_assimilation    Ferredoxin-dependent glutamate synthase (EC 1.4.7.1)            0
C00025:R00093:

C00025:R00114:
Glutamine,_Glutamate,_Aspartate_and_Asparagine_Biosynthesis     Glutamate synthase [NADPH] small chain (EC 1.4.1.13)            1.24
Glutamine,_Glutamate,_Aspartate_and_Asparagine_Biosynthesis     Glutamate synthase [NADPH] large chain (EC 1.4.1.13)            1.24
Iron-sulfur_experimental        Glutamate synthase [NADPH] small chain (EC 1.4.1.13)            0
Iron-sulfur_experimental        Glutamate synthase [NADPH] large chain (EC 1.4.1.13)            0
Ammonium_metabolism_H._pylori   Glutamate synthase [NADPH] large chain (EC 1.4.1.13)
YgfZ    Glutamate synthase [NADPH] small chain (EC 1.4.1.13)            0
Ammonia_assimilation    Glutamate synthase [NADPH] small chain (EC 1.4.1.13)            0
Ammonia_assimilation    Glutamate synthase [NADPH] large chain (EC 1.4.1.13)            0
CBSS-155864.1.peg.3753  Glutamate synthase [NADPH] small chain (EC 1.4.1.13)
C00025:R00239:
Proline_Synthesis       Glutamate 5-kinase (EC 2.7.2.11)        fig|416269.5.peg.849    1
Iojap   Glutamate 5-kinase (EC 2.7.2.11)        fig|416269.5.peg.849    0
Proline,_4-hydroxyproline_uptake_and_utilization        Glutamate 5-kinase (EC 2.7.2.11)        fig|416269.5.peg.849    1
CBSS-316058.9.peg.23    Glutamate 5-kinase (EC 2.7.2.11)
YggW    Glutamate 5-kinase (EC 2.7.2.11)        fig|416269.5.peg.849    0
PROSC   Glutamate 5-kinase (EC 2.7.2.11)        fig|416269.5.peg.849    0
C00025:R00240:

C00025:R00241:


In the data you can see examples of positive variant counts, negative variant counts, zero variant counts, and reactions that don’t exist in the genome.

The data eventually ‘simplifies down’ into:

C00025: 1.02    0.0001  2.03    2.01    0.0001  0.0001  …

Looking at the first reaction(1.02) the total gets +1 for the first subsystem ‘Glutamine,_Glutamate..’. It gets a +0.01 for the next subsystem ‘cAMP_signaling’.  Nothing is added for the next subsystem since it comes back as experimental.  Then nothing is added for ‘Phosorespiration’ since it is a negative variant count.  And a +0.01 is added for the last ammonium assimilation. Giving a 1.02, which is eventually simplified into a 1.

 

The second reaction returns a NULL and is empty, thus it gets a +0.0001.  Which ends up being 0.0001, which ends up as a 0.

MM Update – Share Button Options

I recently tested the code for the share options on my Ion and I’m proud to say they work perfectly! Well, with the exception of the browse button not working yet… (that is next on my list!). Now, users are able to press the share button, and choose an output format: .mmr for sending results to other phones, or .txt for sending results to computers. The text version has been tested in Windows, Linux, and Mac environments and is viewable in all three. One application that has problems with the output is Notepad in Windows; the WordPad application works fine, and is an acceptable alternative.

Another thing I’m happy to have done is the registration for the Android Market. In the future I’ll be able to upload our lab applications to the market where they will be available as free downloads to anyone with an Android phone. It was a pretty simple process to go through, and would’ve been really quick, but I decided it was probably a good idea to actually read the license agreement… Either way, I am now set up to upload our apps! Big thanks to Rob for paying my Market fees! (I’ll be sure to remember you when I make my imaginary millions on MtgHelper…)

I’ll have to talk it over with Rob, but I think there are only a few adjustments I’d like to make before releasing initial versions of GenomeSearch and Mobile Metagenomics. Both applications currently have no provision for warning the user of poor/no internet connection – this results in application failure and is unnacceptable for Market-deployed apps. The other issue is that MM needs to have the browse button coded, which requires me to either code a file browser by hand or somehow incorporate one which has been written by others. Once I complete these features, we can consider deploying the apps on the Market.

Android: Nuts and Bolts III

This Nuts and Bolts is going to be relatively limited in scope; I am actually deviating from the topic I planned for the third installment. Over the past few weeks, you’ve probably seen me say something to the effect of “Google says RelativeLayout is more efficient, but I don’t really get why” several times. It has irked me that I didn’t understand it, but I didn’t really see any means of finding out, either. Today I can finally say I at least have a guess as to what they meant when they told us about this elusive inefficiency. Curious? Look behind the “Read More“!

 

Continue reading

MM Preview Release

I’ve created a preview release of MM in case Rob or anyone else needs/wants to show off the app to anyone. You can download it via directly typing in the download link, by doing an “adb install mobilemetagenomics.apk” if you have the sdk set up on your PC, or you can just use the Barcode Scanner app to scan and download directly from the QR-code behind the read-more cut. As I stated, this is a preview version of the code so many things are incomplete. I’ll try to update the .apk when I make signifcant changes, so check back for the latest version!

NOTE: Daniel just pointed out to me that you need to have a fasta file in the root directory of your SD Card for MM to actually do anything. You can transfer the file most easily by connecting your phone to a computer via USB, mounting the phone as a removable storage device, and then clicking and dragging the file from your PC to your phone. I’m unsure of where files are placed when a phone directly downloads a file, so the safest bet is to use the USB method.

Update (7/24/09): As far as I’m able to test (bioseed went down just before I could try it on a real phone), I have the dialog and the .txt and .mmr outputs both working! I’m pretty excited to finally have this section of the app coded; I actually agonized over the newlines for quite a while before realizing it was just Notepad displaying my results wrong… The .txt outputs display just fine in Wordpad and should also work for Mac and Linux (though linux may have those pesky ^M characters after each line). Unfortunately the java environment variables don’t help us in Android to determine what type of newlines the user will want when they email their file. I had to write the code with /r/n both in, because the file could be emailed to any operating system.

Continue reading

MM Rough Demo Video

Rob asked me for a demo of Mobile Metagenomics, and this is what we were able to cook up! The software is still in a rough stage, and we actually aren’t able to demo the Share feature on the emulator (which I find particularly disappointing…) due to some technical Android issues. Huge credit goes to Ramy for staying late at work to upload the file since he had access to pipe2  and I didn’t, and also a big thanks to Rob for doing the video editing on the fly while he’s on a trip! All of the Linux video editors that I found distorted the movie size, which was obviously no good for our purposes. The video is still a rough cut, but we wanted to have something for Rob to present today. Thanks again to everybody who helped make that happen!

MM Demo

And now.. Cell phone microscopy!!

I thought this article may be of particular interest to the lab.

Here is the abstract:

Light microscopy provides a simple, cost-effective, and vital method for the diagnosis and screening of hematologic and infectious diseases. In many regions of the world, however, the required equipment is either unavailable or insufficiently portable, and operators may not possess adequate training to make full use of the images obtained. Counterintuitively, these same regions are often well served by mobile phone networks, suggesting the possibility of leveraging portable, camera-enabled mobile phones for diagnostic imaging and telemedicine. Toward this end we have built a mobile phone-mounted light microscope and demonstrated its potential for clinical use by imaging P. falciparum-infected and sickle red blood cells in brightfield and M. tuberculosis-infected sputum samples in fluorescence with LED excitation. In all cases resolution exceeded that necessary to detect blood cell and microorganism morphology, and with the tuberculosis samples we took further advantage of the digitized images to demonstrate automated bacillus counting via image analysis software. We expect such a telemedicine system for global healthcare via mobile phone – offering inexpensive brightfield and fluorescence microscopy integrated with automated image analysis – to provide an important tool for disease diagnosis and screening, particularly in the developing world and rural areas where laboratory facilities are scarce but mobile phone infrastructure is extensive.

And now.. Cell phone microscopy!!

I thought this article may be of particular interest to the lab.

Here is the abstract:

Light microscopy provides a simple, cost-effective, and vital method for the diagnosis and screening of hematologic and infectious diseases. In many regions of the world, however, the required equipment is either unavailable or insufficiently portable, and operators may not possess adequate training to make full use of the images obtained. Counterintuitively, these same regions are often well served by mobile phone networks, suggesting the possibility of leveraging portable, camera-enabled mobile phones for diagnostic imaging and telemedicine. Toward this end we have built a mobile phone-mounted light microscope and demonstrated its potential for clinical use by imaging P. falciparum-infected and sickle red blood cells in brightfield and M. tuberculosis-infected sputum samples in fluorescence with LED excitation. In all cases resolution exceeded that necessary to detect blood cell and microorganism morphology, and with the tuberculosis samples we took further advantage of the digitized images to demonstrate automated bacillus counting via image analysis software. We expect such a telemedicine system for global healthcare via mobile phone – offering inexpensive brightfield and fluorescence microscopy integrated with automated image analysis – to provide an important tool for disease diagnosis and screening, particularly in the developing world and rural areas where laboratory facilities are scarce but mobile phone infrastructure is extensive.

Android: Nuts and Bolts II

In this Nuts and Bolts entry, I’ll be discussing user interaction with User Interface elements, and how to code for it. Examples of most of these can be found in the Notepad Tutorial. There are several pieces of UI functionality that can be coded for, but the simplest and most obvious is the notion of “making the buttons work”. I imagine that, for most people new to Android, the obvious next step after laying out a fancy UI is to actually do something when the user interacts with it.

Check out the read more to find out how to do this and other UI related things!

Continue reading