Clustalw In Php
3
3
Entering edit mode
12.5 years ago
Aparna ▴ 120

how to connect standalone clustalW to database using php code.Is it possible?

programming clustalw • 2.9k views
3
Entering edit mode

NOTE: When you downvote a question, it is both a form of respect for a new participant on the forum and an investment in developing sound posting habits for all participants to take a few seconds and write a comment describing why you downvoted a post and how to improve it. Cheers ;)

1
Entering edit mode

Dear @Aparna, welcome to the forum. Please take some time to write more detailed questions describing you data, needs, expected results and maybe putting an example of the code you tried. This will help other user to give you more satisfying answers. In turn, your post will become more useful to other participants. Thanks!

4
Entering edit mode
12.5 years ago
Neilfws 49k

Whether you want the output returned as a variable, or not, calling external programs can be a security hole unless you're careful. Long processes will hang the browser (if you're writing for the web), so use shell_exec() if that's an issue

EDIT: I just noticed the "connect to database" part of your question. I'm unsure what you mean. If you want to store the clustalw results in a database, I guess you need parser code too, unless you plan to store all the output in one field.

0
Entering edit mode

A note on shell_exec: the command itself is not enough to make a task run in background, the & operator is essential (see here)

0
Entering edit mode

And a note on the backtick operator: it's really nice to use to with Unix tools such as cat, grep, etc. for result file parsing; eg.:

$secondRow = cat outfile.log | awk '{print$2}'

0
Entering edit mode

and a note on the backtick operator: it's really nice to use it for result file parsing in combination with cat, grep, awk, etc; eg.: $secondRow = [backtick]cat result.file | awk '{print$2}'[backtick]

2
Entering edit mode
12.5 years ago

you can invoke any external program from PHP using a system command: see here

2
Entering edit mode
12.5 years ago

Once you have the ClustalW results using system command as explained by Pierre, I would recommend to use MView for visualization in HTML. It's a neat command line tool that can generate pretty HTML from alignment (BLAST, ClustalW and other alignment programs) files. Once you have the HTML you can be print on to your PHP code on the fly. You can download MView from sourceforge.