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/JH_TCV_lateSL.clones.filtered.23_1_2008.fa', -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; #rint "seq: $seq\n"; } foreach my $seq_id (keys %srna){ my $srnas = $srna{$seq_id}; print "srnas: $srnas\n"; foreach($srnas){ my $blast = Bio::Tools::Run::StandAloneBlast->new(program=>'blastn',database=>'/home/jayakuma/script/graphics/TCV-jagger.fna'); my $input = Bio::Seq->new(-seq=> $srnas); print $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 "$srnas\t$id\n"; } } } } } } } #### srnas: TTTGCAGTATTGGACAAGCC TTTGCAGTATTGGACAAGCC Use of uninitialized value in pattern match (m//) at /usr/share/perl5/Bio/SeqIO/fasta.pm line 193, line 81643. Use of uninitialized value in print at /usr/share/perl5/Bio/Root/IO.pm line 407, line 81643. -------------------- WARNING --------------------- MSG: cannot find path to blastall --------------------------------------------------- Can't call method "next_result" on an undefined value at aligning.pl line 34, line 81643.