view genephys/mergeAllBestBlast.pl @ 0:448b10ffb095 draft

Uploaded
author mcharles
date Tue, 12 Aug 2014 05:49:33 -0400
parents
children
line wrap: on
line source

#!/usr/bin/perl
my $inputblastn = $ARGV[0];
my $inputtblastx = $ARGV[1];
my $inputblastx = $ARGV[2];
my $inputblastp = $ARGV[3];

open(IN, $inputblastn) or die ("Can't open $inputblastn \n");
open(ITX, $inputtblastx) or die ("Can't open $inputtblastx \n");
open(IX, $inputblastx) or die ("Can't open $inputblastx \n");
open(IP, $inputblastp) or die ("Can't open $inputblastp \n");

my %blastx;
my %tblastx;
my %blastp;

while (my $ligne = <ITX>){
	my @fields = split (/\t/,$ligne);
	chomp($ligne);
	$tblastx{$fields[0]} = $ligne;
}
close (ITX);

while (my $ligne = <IX>){
	my @fields = split (/\t/,$ligne);
	chomp($ligne);
	$blastx{$fields[0]} = $ligne;
}
close (IX);

while (my $ligne = <IP>){
	my @fields = split (/\t/,$ligne);
	chomp($ligne);
	$blastp{$fields[0]} = $ligne;
}
close (IP);


while (my $ligne = <IN>){
	my @fields = split (/\t/,$ligne);
	my $query = $fields[0];
	print "BLASTN\t$ligne";
	print "TBLASTX\t",$tblastx{$query},"\n";
	print "BLASTX\t",$blastx{$query},"\n";
	print "BLASTP\t",$blastp{$query},"\n\n";
	
}
close (IN);