Posts

Showing posts with the label Perl

Biological Sequence Pattern Matching using Perl

Image
This article is a simple Perl programming tutorial for matching patterns in the biological sequence using regular expressions. In this tutorial, I have used ActiveState Perl 5.24.3 software for compiling the Perl script. Pattern Matching In Bioinformatics, string matching or pattern matching is a fundamental and popular method used in a wide range of applications ranging from sequence alignment to functional prediction. Pattern matching is classified into exact pattern matching and approximate pattern matching. The exact pattern matching method does not allow any insertion, deletion, or substitution of characters while matching with the target sequence, whereas the approximate pattern matching method allows with certain limitations. In Computational Biology, a pattern is an expression as a sequence of characters with a defined set of symbolic representation. Example: N{P}-[ST]{P}A(2,3). Source Code system('cls'); print "\n+-----------------------------------+...

Converting XAMPP into XAMPPP

Image
This tutorial explains about a simple method to configure Apache, PHP, MySQL, Perl and Python in windows platform. In this tutorial, I have used the latest operating system (Windows 8.1 Enterprise Edition 64-bit) and latest softwares - XAMPP 1.8.3 and Python 3.3.0. Refer official site of XAMPP and Python for installation instructions. XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. The XAMPP 1.8.3 contains of Apache, MySQL, PHP + PEAR, Perl, mod_php, mod_perl, mod_ssl, OpenSSL, phpMyAdmin, Webalizer, Mercury Mail Transport System for Win32 and NetWare Systems v3.32, Ming, FileZilla FTP Server, mcrypt, eAccelerator, SQLite, and WEB-DAV + mod_auth_mysql. The default configuration of Apache is perfectly linked with MySQL, PHP and Perl. Since Perl and Python run under common gateway interface (CGI), configuring Python CGI with XAMPP is very easy. To convert XAMPP into XAMPPP, we have to change the existing AddHandler Apache configuration command to AddHa...

Addition, Subtraction, Multiplication, and Transpose of Matrices using Perl

Image
This is a Perl programming tutorial for computing addition, subtraction, multiplication, and the transpose of matrices with custom dimension ( row × column ). In this tutorial, I have used addition() , subtraction() , multiplication() , and transpose() subroutines to perform matrix manipulation by user's choice. Moreover, the input and output of data processing is done through getmatrix() and display() subroutines. The output of the matrix result is formatted in rows and columns mimic to an array. Matrix Manipulation In mathematics, a matrix is a rectangular array of numbers/symbols/expressions arranged in rows and columns. The individual items (elements or entries) in an m × n matrix A , often denoted by a i , j , where i and j represents the dimension. The rule for addition ( A + B ) or subtraction ( A − B ) of two matrices is that it must have an equal number of rows and columns. However, the rule for matrix multiplication ( A...

Embedding Perl into Perl

This article describes embedding a Perl script into a Perl script. The program executes through Common Gateway Interface (CGI), which reads ASCII file through file upload method and displays content of the file. The Perl script upload.pl is called through the Perl script file-upload.pl using function eval{} . This program can be modified to call by reference function, to access other system programs too. file-upload.html <html> <head> <title>File Upload</title> </head> <body> <form method="post" action="/cgi-bin/file-upload.pl" enctype="multipart/form-data"> Enter the file to upload:<br> <input name="file" size="45" type="file"><br> <p> <input name="reset" type="reset"> <input name="submit" value="Upload" type=...

Addition using Perl/CGI in Ubuntu

Image
If Apache web server has installed in your system, you can run Perl/CGI script successfully. Create a HTML file and Perl script using following steps. Step 1: Creating a web page add.html 1. Open your console and type: $ sudo gedit /var/www/add.html 2. Copy the lines below in the file and save it. <html> <head> <title>Addition of two numbers.</title> </head> <body> <br><br><br><br><br> <form action='cgi-bin/add.pl' method='post' enctype='multipart/form_data'> <table border='0' align='center'> <tr><td colspan='2' align='center'> <b>Adding Two Numbers</b> </td></tr> <tr> <td>Enter the first value:</td> <td><INPUT TYPE ='text' NAME='n1'></td> </tr> <tr> ...