#!/usr/bin/perl -w use strict; use Bio::SeqIO; use Bio::Tools::Run::StandAloneBlast; my %srna; my %genome; my $seqio_srna = Bio::SeqIO->new(-file=>'/home/jayakuma/script/graphics/model2.fasta', -format=>'fasta') or die "cannot open file\n"; my $seqio_large = Bio::SeqIO->new(-file => '/home/jayakuma/script/graphics/TCV-jagger.fna', -format =>'fasta') or die " cannot opne the file\n"; while (my $large_seq = $seqio_large->next_seq()){ my $id = $large_seq->display_id; my $seq = $large_seq->seq; $genome{$id} = $seq; } while (my $seq_srna = $seqio_srna->next_seq()){ my $display_id = $seq_srna->display_id; my $seq = $seq_srna->seq; $srna{$display_id} = $seq; } foreach my $seq_id (keys %srna){ my $srnas = $srna{$seq_id}; #print "srnas: $srnas\n"; foreach($srnas){ print "the small rnas:$srnas", "\n"; my $blast = Bio::Tools::Run::StandAloneBlast->new(program => 'blastn', database => 'var/common/CGI-BIN/TCV-jagger.fna'); my $input = Bio::Seq->new(-seq=> $srnas); print "the sequnce thats being worked is ", $input->seq, "\n"; my $blast_report = $blast->blastall($input); while (my $result = $blast_report->next_result()){ my $query_length = $result->query_length(); while (my $hit = $result->next_hit()){ my $id = $hit->accession(); while (my $hsp = $hit->next_hsp()){ if($hsp->frac_identical ==1 && $hsp ->length ==$query_length){ print "srna:$srnas\t$id\n"; } } } } } }