#! /usr/bin/perl -w
# *************************************************************
# This Programme does the following in sequence
# -> Performs regular Blast
# -> Modyfy the infile and outfile
# Author : Rajkumar (itc@rajkumar.in)
# Release: APR 2010
# *************************************************************
# Libraries
use strict;
# At the top: Time Start
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
# Variables
my $path = "/home/raj/bio";
my $db = "$path/sorghum/db/sgdna";
my $query = "$path/user/rk/pmapping/est_sorghum.fa";
my $outfile = "$path/user/rk/pmapping/est_sorghum.blast.out";
my $cpu = "4";
# Functions
print "\n\tInitiated Blast on $query .. ";
`blastall -p blastn -d $db -i $query -e 10 -m 8 -q -5 -v 5 -o $outfile -a $cpu`;
# -p program
# -d database
# -i query file
# -e evalue
# -m 8 tab delimited out
# -o outfile
# -a number of CPUs
# -q Penalty for a nucleotide mismatch (blastn only) default = -3
# -v Number of database sequences to show one-line
# -K Number of best hits from a region to keep
print "All Done!\n\n";
# At the End: Time Calculation
my ($sec_,$min_,$hour_,$mday_,$mon_,$year_,$wday_,$yday_,$isdst_) = localtime(time);
my $days = $mday_-$mday;
my $hours = $hour_-$hour;
my $mins = $min_-$min;
my $secs = $sec_-$sec;
print "\n------------------------\nDuration: ";
if ($days>0) { print "$days days";}
if ($hours>0) { print ": $hours hours";}
if ($mins>0) { print ": $mins mins";}
if ($secs>0) { print ": $secs secs";}
print "\n------------------------\n";
# END