1 # -*-Perl-*- Test Harness script for Bioperl
10 test_begin(-tests => 31,
11 -requires_module => 'IO::String');
16 # Bio::Perl isn't OO so we don't see Bio::Perl->new() here
18 my ($seq_object,$filename,$blast_report,@seq_object_array);
20 # will guess file format from extension
21 $filename = test_input_file('cysprot1.fa');
22 ok ($seq_object = read_sequence($filename));
23 isa_ok $seq_object, 'Bio::SeqI';
25 # forces genbank format
26 $filename = test_input_file('AF165282.gb');
27 ok ($seq_object = read_sequence($filename,'genbank'));
28 isa_ok $seq_object, 'Bio::SeqI';
30 # reads an array of sequences
31 $filename = test_input_file('amino.fa');
32 is (@seq_object_array = read_all_sequences($filename,'fasta'), 2);
33 isa_ok $seq_object_array[0], 'Bio::SeqI';
34 isa_ok $seq_object_array[1], 'Bio::SeqI';
36 $filename = test_output_file();
37 ok write_sequence(">$filename",'genbank',$seq_object);
38 ok ($seq_object = new_sequence("ATTGGTTTGGGGACCCAATTTGTGTGTTATATGTA","myname","AL12232"));
39 isa_ok $seq_object, 'Bio::SeqI';
43 ok ($trans = translate($seq_object));
45 isa_ok $trans, 'Bio::SeqI';
47 ok ($trans = translate("ATTGGTTTGGGGACCCAATTTGTGTGTTATATGTA"));
49 isa_ok $trans, 'Bio::PrimarySeqI';
51 ok ($trans = translate_as_string($seq_object));
53 is $trans, 'IGLGTQFVCYM';
57 ok ($trans = translate_as_string("ATTGGTTTGGGGACCCAATTTGTGTGTTATATGTA"));
59 is $trans, 'IGLGTQFVCYM';
61 # we need to keep tests that depend on net connection at the end
62 # these now run only with BIOPERLDEBUG set
65 test_skip(-tests => 12, -requires_networking => 1, -requires_module => 'LWP::UserAgent');
69 test_skip(-tests => 2, -requires_module => 'Data::Stag');
71 $seq_object = get_sequence('swissprot',"ROA1_HUMAN");
74 skip("problem connecting to SwissProt:$@",2);
77 isa_ok $seq_object, 'Bio::SeqI';
84 $seq_object = get_sequence('embl',"HSFOS");
87 skip("problem connecting to EMBL:$@",2);
90 isa_ok $seq_object, 'Bio::SeqI';
97 $seq_object = get_sequence('genbank',"AI129902");
100 skip("problem connecting to GenBank:$@",2);
103 isa_ok $seq_object, 'Bio::SeqI';
110 $seq_object = get_sequence('genbank',"NM_006732");
113 skip("problem connecting to RefSeq:$@",2);
116 isa_ok $seq_object, 'Bio::SeqI';
123 $seq_object = get_sequence('genpept',"AAC06201");
126 skip("problem connecting to RefSeq:$@",2);
129 isa_ok $seq_object, 'Bio::SeqI';
136 $blast_report = blast_sequence($seq_object, 0);
139 skip("problem connecting to NCBI BLAST:$@",2);
142 isa_ok $blast_report, 'Bio::Search::Result::ResultI';