Author Archives: Daniel Cuevas

Introducing BioJava!

To put it simply (and in the words of the creators), “BioJava is an open-source project dedicated to providing a Java framework for processing biological data”. It is a package that contains class files and objects that implement Java code to be used for a variety of things. It is a great toolbox for those in the bioinformatics field that want to use Java to do “bioinformatics stuff” on their data, like analyzing and manipulating sequences. You can check out the wiki at if you would like to get more details about BioJava. In this post I will be explaining the installation procedure to add BioJava to the Eclipse(Ganymede) platform on Windows Vista. If you already had the experience of adding library files to Eclipse this will probably be a bit of a review for you. Also, the BioJava wiki offers an installation guide if you would like to just follow this, although it does not explain the Eclipse work that must be done but only the part to add the .jar files to your machine’s CLASSPATH. Click the Read More for install help. Continue reading

Testing Network Connection For Android Phones

After deciding to take a hold off of OpenSocial Metagenomics and the headaches that came along with it, I began to finally sit down and figure out how Josh and I could test network connection with our Android apps. Although we attempted to find the solution a few weeks into the development of GenomeSearch, we didn’t find anything that worked. But with a new determination to produce some results I discovered the solution using the NetworkInfo class and ConnectivityManager class that Android supplies. Here is the code for a test application I wrote which displays text on the screen saying whether there is a connection via wifi or phone service provider (3g):

public void onCreate(Bundle savedInstanceState) {

TextView tv = new TextView(this);
ConnectivityManager cm = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);

if ( cm.getNetworkInfo(cm.TYPE_MOBILE).isConnectedOrConnecting() ||
cm.getNetworkInfo(cm.TYPE_WIFI).isConnectedOrConnecting() )
tv.setText("Network available!");
tv.setText("No network available!");

Now we can implement this code into our applications to check and ensure users have network connection before performing any actions that require internet connection.

Cross Domain Access and Web Services

Through my readings on trying to find out why my OpenSocial Metagenomics application hasn’t been working last week, I discovered something I probably should have known/seen when I first started. Security issues with Javascript are well known to anyone who has tried to code with it, but I never truly understood what issues they were until now. First of all, the application is attempting to make service calls to Rob Edward’s cellphone-based Real Time Metagenomics site to submit a fasta file in order to receive a JSON object. Now, the problem is that I’ve been using Javascript’s XMLHttpRequest object to make calls to the website from the application and this is causing a cross domain security problem in which the call doesn’t go through. This is a huge disconcern for web app developers because cross domain service calls are becoming more and more necessary with the increase in popularity of social networks. But it makes sense for a browser to implement this type of security because allowing anyone to freely open a web service connection could allow hackers and others to intercept the connection.

So, after reading other’s blogs on this issue I am finding that there currently isn’t a set custom in working around this problem but there are some workaround solutions available, such as getting Javascript to call a proxy program, having the desired server to call a proxy program, implementing a script tag hack, and more. I am hoping to soon find a solution that doesn’t come with any downfalls so I would not have to use any of these methods, but I am not counting these out just yet. These may be the only solution right now but I’ll keep looking for something that sounds more suitable for me.

Metagenomics on Open Social

I am beginning to create an application for Open Social platforms that mimics the Real Time Metagenomics website and Josh’s Mobile Metagenomics android application. I have not gotten very far in developing the app, only that I have the format of the application written in code. I plan on figuring out how to make a request to parse the test file and to display the results in a meaningful manner this week.

GenomeSearch Android App Update

The code is looking much better after Josh cleaned up it up and organized it. The current code is not displaying the genomes from the SEED and after testing it and trying to figure out exactly what the problem is, I’m finding that it has something to do with how we’re retrieving the text from the website and storing it. I was trying to find another way in reading in text from a website and then storing it because I’m not 100% sure on the method that’s being used right now so I need to talk to Josh to fully understand it. Other than that it seems the route we’re taking is working. I tested the setup of the code by using our test list and it performed perfectly.

Add SVN project to Eclipse

So far Josh and I have discovered how to copy and save a project from the SVN repository into our own machine. We found two ways of doing so (I find the second method much faster):

1) Go to the Java Perspective and right-click in the Package Explorer. Click Import…, then in the Import screen click on the SVN folder and click on Checkout Projects from SVN. Click Next and then choose the correct repository location. Click Next and choose the folder containing the project and click Next (if you wish to change the project name, workspace, or other revisions) or you can click Finish. This will import the project and its contents into your machine.

2) Go to the SVN Repositories Perspective and right-click on the folder containing the project and choose Checkout…. This will bring you to the screen where you can edit the Project Name and workspace location. Afterwards, click Finish and your project will be imported into your machine.


The other problem I was having was after I would import the project into Eclipse is that I would get these errors showing on my Console tab. The error would say something about “Classfiles missing” and under my Problems tab an error saying “Path files not found” would also show. I resolved the issue by simply clicking on Project at the top of the screen and then choose Clean… So far it has been successful but I am looking for any other consequences this may have caused.

So far with Genome Search…

So I’m going to go ahead and write what I’ve been working on today so far. Not sure if this is exactly what the lab-blog is for but here it goes:

Finally it seems as though the SVN problem has been fixed. The previous problem was that I did not know how to import the project into eclipse but I figured out two ways to do so. Also, I was receiving a sort of “classfile missing” and “path files were not found” type of error but I just did a few simple actions which fixed it. I will post a separate blog describing these.

Other than that, I have been researching different methods to add the list of names to the spinner-drop-down-menu. One method that I’m set on that might work is using the ArrayAdapter constructor instead of the createFromResource method to fill in the spinner. I successfully displayed arbitrary Strings to display on it using the constructor and now I’m attempting to parse the String from the genomes website into an array and then putting only the names into a String array. That is where I am stuck. It seems as though the myString variable that’s supposed to be holding the content from the genomes website is either not parsing correctly or the content isn’t being stored in myString variable correctly. I’m planning on continuing this tomorrow so Josh and I could figure this out.