Multiple Sequence Alignment In Javascript
5
4
Entering edit mode
13.8 years ago
Cafxx ▴ 50

I know it may seem kind of strange but I was wondering if anybody has ever seen some javascript code for the multiple sequence alignment problem. If not (as I suppose) also some easily portable code (i.e. I need no kitchen sink) will do. Keep in mind that I won't be aligning more than 4-5 sequences less than 100-200 symbols long.

Note: I know javascript is not really the best choice for this kind of things. Trust me, there are good reasons why I have to do it in javascript (if curious, see below in the comments).

(crossposted from stackoverflow)

multiple • 8.9k views
ADD COMMENT
2
Entering edit mode

Frankly, I am really surprised at the number of people commenting here being so judgmental about the idea of a multiple sequence alignment implemented in JavaScript. 2.2 years ago, maybe I can see it. But not really. There is so much you could do with a dynamic JavaScript implementation - zoom in/out; scroll; add/remove sequences from the alignment; highlight regions; adjust colors; mouseovers; etc. If I get an image from a web server, it's a static image. If I get the data from the web server, the UI can do anything.

ADD REPLY
1
Entering edit mode

Being in a situation that forces you to use the wrong tool for the job is not really "a good reason", in my experience.

ADD REPLY
0
Entering edit mode

I already explained (see below, in the comments) why it's not that bad of a choice. Also, I'm volunteering my time to this project: I have to stick with the solution that works, is easily maintenable and doesn't add further dependencies. Hopefully this can help understand why JS in this case is the right tool for the job.

ADD REPLY
0
Entering edit mode

I must say that I agree with Neil. Even after having read the comments below, I cannot see a good reason why you would need to run something in a web browser, yet not have access to use web services.

ADD REPLY
0
Entering edit mode

Because it's not a web browser. It's something built on top of the same platform (xulrunner) as Firefox but it's not a web browser. And, besides, the user base would probably be too big for anything less than a whole data center to handle. Now, if we could all go back to the question...

ADD REPLY
0
Entering edit mode

Also, keep in mind (as I already wrote below) I'm not talking about bioinformatics here: the sequences I need to align are not DNA/protein/codons sequences. They are generic sequences, and I'm almost sure that none of the servers you're talking about would 1) accept arbitrary sequences 2) allow me to use their computing power for something totally unrelated to bioninformatics.

ADD REPLY
6
Entering edit mode
13.8 years ago
Lee Katz ★ 3.2k

The Sequence Manipulation Suite might be your answer. It's the closest thing I know of to "BioJavaScript." It looks like a pairwise alignment but I'm sure you can modify it for a multiple sequence alignment.

http://www.bioinformatics.org/sms2/pairwise_align_dna.html

ADD COMMENT
0
Entering edit mode

Thanks, that's a good starting point. I'll try it and see if I can hammer it into place.

ADD REPLY
0
Entering edit mode

I'm curious if you were able to do something with this? It might be a benefit for the community if you are turning it into something larger.

ADD REPLY
0
Entering edit mode

comment deleted by author.

ADD REPLY
6
Entering edit mode
13.8 years ago

I think you should look at this project

They have compiled BioJava using GWT - so in theory you should be able to run multiple alignments in the browser. They have already implemented Needleman-Wunsch. I suppose the other algorithms may be implemented.

GWT allows writing of code in Java and then compilation into javascript. They have run their server on the google app engine - pretty neat!

ADD COMMENT
3
Entering edit mode
13.8 years ago

You could also try to take a multiple sequence alignment algorithm implemented in another language, and try to compile it to JavaScript. For example, you might try JAligner and GWT.

ADD COMMENT
1
Entering edit mode
13.8 years ago

I know you say there is a good reason why you have to do it in JavaScript, but have you considered using an AJAX solution instead? That would allow you to do the alignment server-side using any one of the many existing multiple alignment programs?

ADD COMMENT
2
Entering edit mode

I guess you are the first who have such a need, which means you have to implement by yourself. A standard progressive alignment is not that hard to implement, probably within several hundred lines of javascript source code. Take it as an exercise.

ADD REPLY
0
Entering edit mode

There's no server involved. This has to run in a stand-alone application built on xulrunner and I don't want to ship binary components for multiple platforms, so this leaves me with no choice, i.e. using javascript.

ADD REPLY
0
Entering edit mode

You might be creating something like an extension for firefox ? but as far as I know you can link some C++ components to your XUL application.

ADD REPLY
0
Entering edit mode

@Pierre, yes it's something like a Firefox extension. But as I said, I'd rather not have to build and ship binary components for all the supported platforms. Javascript, on the contrary, will run everywhere. Also, as I said in the question, I don't need a fully-fledged library capable of handling huge datasets... this will work on small inputs, so computational complexity should be of no concern.

ADD REPLY
0
Entering edit mode

@lh3: I'll try Lee's suggestion, if it doesn't work well I'll probably try to implement some MSA unsing simulated annealing.

ADD REPLY
0
Entering edit mode
13.8 years ago
Paulo Nuin ★ 3.7k

I don't understand why?

ADD COMMENT
0
Entering edit mode

Why I need this or why am I using JS? I already explained the latter; the former is because I have multiple "noisy" input sequences and I need to find out which parts are "noise" and which part are legitimate data. And that's pretty much what MSA is for. Bear in mind that I'm not talking about bioinformatics here, I was just redirected here from stackoverflow.

ADD REPLY
0
Entering edit mode

This should have been posted as a comment and not an answer.

ADD REPLY
0
Entering edit mode

You have to admit that's a pretty good answer, anyway. It has 0 points, but it could have been -20.

ADD REPLY

Login before adding your answer.

Traffic: 1694 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6