[Bioperl-l] Automate Fasta34.exe

Merchant Farid farid at vt.edu
Wed Jan 26 20:03:28 EST 2005


Hi guys.

I am trying to find the exhaustive homologous match of a given sequence
against a given library. 

I run the fasta34.exe from my perl script,input the sequence & library
file name which is stored in the perl folder and other input value.i got
a output in the fasta format, which I parse thru and get the best
sequence match above a given threshold value and store the match each at
a time in a file. Now use this extracted sequence file to run the fasta
again against the same library and inputs and try to call the fasta34
again and repeat the same procedure till u get the homologous match. If
u find any new sequence comparded to the original one, append to the
original fasta file.

Using my code I am able to extract the sequence from the orginal file
which fits the criteria above a threshold but callign the fasta34.exe
would means that I have to sequence file name manually each time the
fasta34.exe is called

Can anybody please help me to solve the problem

Following is my code

#!usr/bin/perl -w

print"\n********Running Fasta34**********  \n \n";
print"\n Please enter the file sequence and library present in your path
\n\n";
$result = system("c:/perl/sam/fasta34.exe");
print"\n\n*****enter the output file name you have given***\n";
$output = <STDIN>;
open(FASTA,"c:/perl/sam/$output") or die "cant open the output file \n";


my $seqname;
my $iteration;
print "Enter your cut off percentage";
$cut = <STDIN>;
while (<FASTA>)
{
	#compare the line of matching sequence 
	if(m/>>(.{4,6})(.*)/)
	{
		$seqname = $1;
		$laterhalf = $2;
	}
	#print "SKIP A LINE iF A MATCH \n";
	next if /^ini/;
	if (m/(\d+\.\d+)% identity/) 
	{
		$per = $1;
		#check if match is above the cutoff percentage  
		if ($per > $cut)
		{
			#print "\n\n$seqname$laterhalf \n";\
			#print "identity match $per % \n";
			#store the first line of the input file 
			open(ORG,">>c://perl/sam/orginal.fasta");
			open(OUT2IN,">c:/perl/sam/output1.aa");
			print OUT2IN "$seqname$laterhalf \n";
			print ORG "$seqname$laterhalf \n";
			while(<FASTA>)
			{
				if (m/^($seqname)(.*)/)
				{
					#store the match sequence
					print OUT2IN "$2 \n";
					print ORG "$2 \n";
				}
				if(m/>>/)
				{
					seek(FASTA,-100,1);
					last;
				}
			}close(OUT2IN);
			close(ORG);
		}
	}
}
close (FASTA);
print $result;




More information about the Bioperl-l mailing list