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);
70 $seq_object = get_sequence('swissprot',"ROA1_HUMAN");
73 skip("problem connecting to SwissProt:$@",2);
76 isa_ok $seq_object, 'Bio::SeqI';
83 $seq_object = get_sequence('embl',"BUM");
86 skip("problem connecting to EMBL:$@",2);
89 isa_ok $seq_object, 'Bio::SeqI';
96 $seq_object = get_sequence('genbank',"AI129902");
99 skip("problem connecting to GenBank:$@",2);
102 isa_ok $seq_object, 'Bio::SeqI';
109 $seq_object = get_sequence('genbank',"NM_006732");
112 skip("problem connecting to RefSeq:$@",2);
115 isa_ok $seq_object, 'Bio::SeqI';
122 $seq_object = get_sequence('genpept',"AAC06201");
125 skip("problem connecting to RefSeq:$@",2);
128 isa_ok $seq_object, 'Bio::SeqI';
135 $blast_report = blast_sequence($seq_object, 0);
138 skip("problem connecting to NCBI BLAST:$@",2);
141 isa_ok $blast_report, 'Bio::Search::Result::ResultI';