BioPerl-Run

 view release on metacpan or  search on metacpan

t/Tools/Run/StandAloneBlast.t  view on Meta::CPAN

		is $blast_report->num_hits, $testresults[$testcount++];
		
		$factory->_READMETHOD('blast_pull');  # Note required leading underscore in _READMETHOD
		my $str = Bio::SeqIO->new('-file' => test_input_file('dna2.fa'),
								  '-format' => 'fasta');
		$seq1 = $str->next_seq();
		$seq2 = $str->next_seq();
		
		my $pull_report = $factory->blastall($seq1);
		my $sbjct = $pull_report->next_result->next_hit;
		my $hsp = $sbjct->next_hsp;
		is $hsp->score, $testresults[$testcount];
		
		$factory->_READMETHOD('Blast');
		my $searchio_report = $factory->blastall($seq1);
		$sbjct = $searchio_report->next_result->next_hit;
		$hsp = $sbjct->next_hsp;
		is $hsp->score, $testresults[$testcount++];
		
		my @seq_array =($seq1,$seq2);
		my $seq_array_ref = \@seq_array;
		$factory->_READMETHOD('blast_pull');
		$pull_report = $factory->blastall($seq_array_ref);
		$sbjct = $pull_report->next_result->next_hit;
		$hsp = $sbjct->next_hsp;
		is $hsp->score, $testresults[$testcount];
		
		$factory->_READMETHOD('Blast');
		$searchio_report = $factory->blastall($seq_array_ref);
		$sbjct = $searchio_report->next_result->next_hit;
		$hsp = $sbjct->next_hsp;
		is $hsp->score, $testresults[$testcount++];
		
		ok $sbjct = $searchio_report->next_result->next_hit;
		$hsp = $sbjct->next_hsp;
		is $hsp->score, $testresults[$testcount++];
		
		@params = ('-verbose' => $verbose, 'program'  => 'blastp'); 
		$factory = Bio::Tools::Run::StandAloneBlast->new(@params);
		
		$str = Bio::SeqIO->new(-file => test_input_file('amino.fa'),
							   -format => 'Fasta' );
		$seq3 = $str->next_seq();
		$seq4 = $str->next_seq();
		
		$factory->_READMETHOD('Blast');
		my $bl2seq_report = $factory->bl2seq($seq3, $seq4);
		$hsp = $bl2seq_report->next_result->next_hit->next_hsp;
		is $hsp->hit->start, $testresults[$testcount++], "creating/parsing SearchIO bl2seq report object";
	}
	
	# use swissprot
	my $amino_database_file = File::Spec->catfile($Bio::Tools::Run::StandAloneBlast::DATADIR, $amino_database);
	SKIP: {
		skip "Database $amino_database not found, skipping tests on it", 3 unless -e $amino_database_file;
		
		@params = ('database' => $amino_database, '-verbose' => $verbose);
		$factory = Bio::Tools::Run::StandAloneBlast->new(@params);
		
		my $iter = 2;
		$factory->j($iter);    # 'j' is blast parameter for # of iterations
		my $new_iter = $factory->j();
		is $new_iter, 2, "set blast parameter";
		
		my $blast_report = $factory->blastpgp($seq3)->next_result;
		is $blast_report->number_of_iterations, $testresults[$testcount];
		
		$factory->_READMETHOD('blast_pull');
		$iter = 2;
		$factory->j($iter);    # 'j' is blast parameter for # of iterations
		$new_iter = $factory->j();
		is $new_iter, $iter, "set blast parameter";
		
	}
}



( run in 0.546 second using v1.01-cache-2.11-cpan-71847e10f99 )