[Bioperl-guts-l] [15068] bioperl-live/trunk: [bug 2450]

Christopher John Fields cjfields at dev.open-bio.org
Tue Dec 2 17:09:38 EST 2008


Revision: 15068
Author:   cjfields
Date:     2008-12-02 17:09:38 -0500 (Tue, 02 Dec 2008)

Log Message:
-----------
[bug 2450]
* add -source
* more tests

Modified Paths:
--------------
    bioperl-live/trunk/Bio/AlignIO/Handler/GenericAlignHandler.pm
    bioperl-live/trunk/t/AlignIO/stockholm.t

Modified: bioperl-live/trunk/Bio/AlignIO/Handler/GenericAlignHandler.pm
===================================================================
--- bioperl-live/trunk/Bio/AlignIO/Handler/GenericAlignHandler.pm	2008-12-02 21:46:58 UTC (rev 15067)
+++ bioperl-live/trunk/Bio/AlignIO/Handler/GenericAlignHandler.pm	2008-12-02 22:09:38 UTC (rev 15068)
@@ -25,7 +25,6 @@
 use Bio::Annotation::DBLink;
 use Bio::Annotation::Reference;
 use Bio::SimpleAlign;
-use Data::Dumper;
 
 use base qw(Bio::Root::Root Bio::HandlerBaseI);
 
@@ -235,7 +234,7 @@
     $self->process_seqs;
     my $param = $self->get_params;
     if (defined $param->{-seqs}) {
-        return Bio::SimpleAlign->new(%$param);
+        return Bio::SimpleAlign->new(%$param, -source => $self->format);
     }
 }
 

Modified: bioperl-live/trunk/t/AlignIO/stockholm.t
===================================================================
--- bioperl-live/trunk/t/AlignIO/stockholm.t	2008-12-02 21:46:58 UTC (rev 15067)
+++ bioperl-live/trunk/t/AlignIO/stockholm.t	2008-12-02 22:09:38 UTC (rev 15068)
@@ -7,7 +7,7 @@
 	use lib 't/lib';
     use BioperlTest;
     
-    test_begin(-tests => 61);
+    test_begin(-tests => 75);
 	
 	use_ok('Bio::AlignIO');
 }
@@ -27,6 +27,7 @@
 isa_ok($str,'Bio::AlignIO');
 $aln = $str->next_aln();
 isa_ok($aln,'Bio::Align::AlignI');
+is($aln->source, 'stockholm');
 is($aln->get_seq_by_pos(1)->get_nse, 'Z11765.1/1-89');
 is($aln->accession, 'RF00006');
 is($aln->id, 'Vault');
@@ -48,7 +49,9 @@
 
 $aln = $str->next_aln();
 isa_ok($aln,'Bio::Align::AlignI');
+is($aln->source, 'stockholm');
 is($aln->get_seq_by_pos(1)->get_nse, 'L43844.1/2-149');
+is($aln->get_seq_by_pos(1)->version, '1');
 is($aln->accession, 'RF00007');
 is($aln->id, 'U12');
 is($aln->description,'U12 minor spliceosomal RNA');
@@ -72,6 +75,7 @@
    '<<<<<.......>>>>>...........<<<<<<<...<<<<<<<.....>>>>>>>.>>>>>>>..<<<'.
    '<<<<<<.........>>>>>>>>>...', 'Rfam meta data');
 $aln = $str->next_aln();
+is($aln->source, 'stockholm');
 isa_ok($aln,'Bio::Align::AlignI');
 is($aln->get_seq_by_pos(1)->get_nse, 'AJ295015.1/1-58');
 is($aln->accession, 'RF00008');
@@ -92,6 +96,7 @@
     '-format'	=> 'stockholm');
 isa_ok($str,'Bio::AlignIO');
 $aln = $str->next_aln();
+is($aln->source, 'stockholm');
 isa_ok($aln,'Bio::Align::AlignI');
 is($aln->get_seq_by_pos(1)->get_nse, 'RAD25_SCHPO/5-240');
 is($aln->accession, 'PF00244.9');
@@ -101,6 +106,7 @@
 isa_ok($ann, 'Bio::Annotation::SimpleValue');
 is($ann->display_text, '25.00 25.00; 25.00 25.00;', 'Pfam annotation');
 $aln = $str->next_aln();
+is($aln->source, 'stockholm');
 isa_ok($aln,'Bio::Align::AlignI');
 is($aln->get_seq_by_pos(1)->get_nse, 'COMB_CLOAB/6-235');
 is($aln->accession, 'PF04029.4');
@@ -108,6 +114,7 @@
 is($aln->description,'2-phosphosulpholactate phosphatase');
 $aln = $str->next_aln();
 isa_ok($aln,'Bio::Align::AlignI');
+is($aln->source, 'stockholm');
 is($aln->get_seq_by_pos(1)->get_nse, 'Y278_HAEIN/174-219');
 is($aln->accession, 'PF03475.3');
 is($aln->id, '3-alpha');
@@ -134,3 +141,15 @@
     }
 }
 
+# sequence-specific alignments
+# this is a kludge for now until we can get a better class system in place (but
+# it works for now)
+my ($seqann) = $aln->annotation->get_Annotations('seq_annotation');
+isa_ok($seqann, 'Bio::AnnotationCollectionI');
+ at anns = $seqann->get_all_Annotations();
+is(scalar(@anns),6);
+isa_ok($anns[0], 'Bio::AnnotationI');
+is($anns[1]->comment, 'NSE: YIIM_ECOLI/168-214 Start: 178 End: 224');
+is($anns[2]->database, 'PDB');
+is($anns[2]->primary_id, '1o65');
+is($anns[2]->optional_id, 'C');




More information about the Bioperl-guts-l mailing list