Connect with us

Bioinformatics Programming

How to execute Unix/shell commands in PHP?

Published

on

programming in php

Besides, Python & Perl, PHP is another language mostly used in bioinformatics programming. In this article, we provide a simple command to execute shell commands in a PHP script.

shell_exec()

It runs command via shell and returns the output as a string.

syntax: $output = shell_exec($command);

If you are using variables inside your command, you need to use escapeshellarg().

syntax: $output = shell_exec($command);

Let’s assume, if you are running the blastp command on a query file with a variable filename, then it could be run like this:

$output = shell_exec("blastp -query ".escapeshellarg($filename.'.fasta')." -db /path/to/db -out output.txt");


 

Dr. Muniba is a Bioinformatician based in New Delhi, India. She has completed her PhD in Bioinformatics from South China University of Technology, Guangzhou, China. She has cutting edge knowledge of bioinformatics tools, algorithms, and drug designing. When she is not reading she is found enjoying with the family. Know more about Muniba

Advertisement
Click to comment

You must be logged in to post a comment Login

Leave a Reply

Bioinformatics Programming

vs_analysis_compound.py: Python script to search for binding affinities based on compound names.

Published

on

vs_analysis_compound.py: Python script to search for binding affinities based on compound names.

Previously, we have provided the vs_analysis.py script to analyze virtual screening (VS) results obtained from Autodock Vina. In this article, we have provided another script to search for binding affinity associated with a compound. (more…)

Continue Reading

Bioinformatics Programming

How to download files from an FTP server using Python?

Published

on

How to download files from an FTP server using Python?

In this article, we provide a simple Python script to download files from an FTP server using Python. (more…)

Continue Reading

Bioinformatics Programming

How to convert the PDB file to PSF format?

Published

on

How to convert the PDB file to PSF format?

VMD allows converting PDB to PSF format but sometimes it gives multiple errors. Therefore, in this article, we are going to convert PDB into PSF format using a different method. (more…)

Continue Reading

LATEST ISSUE

ADVERT