1 # -*-Perl-*- Test Harness script for Bioperl
9 test_begin(-tests => 14);
11 use_ok('Bio::Factory::SeqAnalysisParserFactory');
15 my ($seqio,$seq,$factory,$parser, $gene_seen, $exon_seen);
17 $seqio = Bio::SeqIO->new('-format'=>'fasta', '-file' => test_input_file('genomic-seq.fasta'));
18 isa_ok $seqio, 'Bio::SeqIO';
19 $seq = $seqio->next_seq;
20 isa_ok $seq, 'Bio::PrimarySeqI';
22 $factory = Bio::Factory::SeqAnalysisParserFactory->new();
24 # let's test the genscan factory
25 $parser = $factory->get_parser(-input => test_input_file('genomic-seq.genscan'),
26 -method => 'genscan');
27 isa_ok $parser, 'Bio::SeqAnalysisParserI';
28 while( my $feat = $parser->next_feature() ){
29 $seq->add_SeqFeature($feat);
31 ($gene_seen, $exon_seen) = (0,0);
32 foreach my $feat ( $seq->top_SeqFeatures() ) {
33 if( $feat->isa("Bio::Tools::Prediction::Gene") ) {
34 foreach my $exon ( $feat->exons ) {
43 # let's test the mzef factory
44 $parser = $factory->get_parser(-input => test_input_file('genomic-seq.mzef'),
46 $seqio = Bio::SeqIO->new('-format'=>'fasta', '-file' => test_input_file('genomic-seq.fasta'));
47 ok $seq = $seqio->next_seq();
48 isa_ok $seq, 'Bio::PrimarySeqI';
50 isa_ok $parser, 'Bio::SeqAnalysisParserI';
51 while( my $feat = $parser->next_feature() ){
52 $seq->add_SeqFeature($feat);
54 ($gene_seen, $exon_seen) = (0,0);
55 foreach my $feat ( $seq->top_SeqFeatures() ) {
56 if( $feat->isa("Bio::Tools::Prediction::Gene") ) {
57 foreach my $exon ( $feat->exons ) {
66 # let's test the ePCR factory
68 $parser = $factory->get_parser(-input => test_input_file('genomic-seq.epcr'),
71 $seq->flush_SeqFeatures;
73 isa_ok $parser, 'Bio::SeqAnalysisParserI';
74 while( my $feat = $parser->next_feature() ){
75 $seq->add_SeqFeature($feat);
78 is $seq->top_SeqFeatures(), 7;