1 # -*-Perl-*- Test Harness script for Bioperl
10 test_begin(-tests => 14);
12 use_ok('Bio::Factory::SeqAnalysisParserFactory');
16 my ($seqio,$seq,$factory,$parser, $gene_seen, $exon_seen);
18 $seqio = Bio::SeqIO->new('-format'=>'fasta', '-file' => test_input_file('genomic-seq.fasta'));
19 isa_ok $seqio, 'Bio::SeqIO';
20 $seq = $seqio->next_seq;
21 isa_ok $seq, 'Bio::PrimarySeqI';
23 $factory = Bio::Factory::SeqAnalysisParserFactory->new();
25 # let's test the genscan factory
26 $parser = $factory->get_parser(-input => test_input_file('genomic-seq.genscan'),
27 -method => 'genscan');
28 isa_ok $parser, 'Bio::SeqAnalysisParserI';
29 while( my $feat = $parser->next_feature() ){
30 $seq->add_SeqFeature($feat);
32 ($gene_seen, $exon_seen) = (0,0);
33 foreach my $feat ( $seq->top_SeqFeatures() ) {
34 if( $feat->isa("Bio::Tools::Prediction::Gene") ) {
35 foreach my $exon ( $feat->exons ) {
44 # let's test the mzef factory
45 $parser = $factory->get_parser(-input => test_input_file('genomic-seq.mzef'),
47 $seqio = Bio::SeqIO->new('-format'=>'fasta', '-file' => test_input_file('genomic-seq.fasta'));
48 ok $seq = $seqio->next_seq();
49 isa_ok $seq, 'Bio::PrimarySeqI';
51 isa_ok $parser, 'Bio::SeqAnalysisParserI';
52 while( my $feat = $parser->next_feature() ){
53 $seq->add_SeqFeature($feat);
55 ($gene_seen, $exon_seen) = (0,0);
56 foreach my $feat ( $seq->top_SeqFeatures() ) {
57 if( $feat->isa("Bio::Tools::Prediction::Gene") ) {
58 foreach my $exon ( $feat->exons ) {
67 # let's test the ePCR factory
69 $parser = $factory->get_parser(-input => test_input_file('genomic-seq.epcr'),
72 $seq->flush_SeqFeatures;
74 isa_ok $parser, 'Bio::SeqAnalysisParserI';
75 while( my $feat = $parser->next_feature() ){
76 $seq->add_SeqFeature($feat);
79 is $seq->top_SeqFeatures(), 7;