[Bioperl-guts-l] [15020] bioperl-live/trunk/t: split up AlignIO tests

Christopher John Fields cjfields at dev.open-bio.org
Tue Nov 25 17:03:14 EST 2008


Revision: 15020
Author:   cjfields
Date:     2008-11-25 17:03:14 -0500 (Tue, 25 Nov 2008)

Log Message:
-----------
split up AlignIO tests

Modified Paths:
--------------
    bioperl-live/trunk/t/AlignIO.t

Added Paths:
-----------
    bioperl-live/trunk/t/AlignIO_arp.t
    bioperl-live/trunk/t/AlignIO_bl2seq.t
    bioperl-live/trunk/t/AlignIO_clustalw.t
    bioperl-live/trunk/t/AlignIO_emboss.t
    bioperl-live/trunk/t/AlignIO_fasta.t
    bioperl-live/trunk/t/AlignIO_largemultifasta.t
    bioperl-live/trunk/t/AlignIO_maf.t
    bioperl-live/trunk/t/AlignIO_mase.t
    bioperl-live/trunk/t/AlignIO_mega.t
    bioperl-live/trunk/t/AlignIO_meme.t
    bioperl-live/trunk/t/AlignIO_metafasta.t
    bioperl-live/trunk/t/AlignIO_msf.t
    bioperl-live/trunk/t/AlignIO_nexus.t
    bioperl-live/trunk/t/AlignIO_pfam.t
    bioperl-live/trunk/t/AlignIO_phylip.t
    bioperl-live/trunk/t/AlignIO_poa.t
    bioperl-live/trunk/t/AlignIO_prodom.t
    bioperl-live/trunk/t/AlignIO_psi.t
    bioperl-live/trunk/t/AlignIO_selex.t
    bioperl-live/trunk/t/AlignIO_stockholm.t
    bioperl-live/trunk/t/AlignIO_xmfa.t

Modified: bioperl-live/trunk/t/AlignIO.t
===================================================================
--- bioperl-live/trunk/t/AlignIO.t	2008-11-25 20:48:50 UTC (rev 15019)
+++ bioperl-live/trunk/t/AlignIO.t	2008-11-25 22:03:14 UTC (rev 15020)
@@ -7,7 +7,7 @@
 	use lib 't/lib';
     use BioperlTest;
     
-    test_begin(-tests => 322);
+    test_begin(-tests => 28);
 	
 	use_ok('Bio::AlignIO');
 }
@@ -16,813 +16,61 @@
 
 my ($str,$aln,$strout,$status);
 
-# PSI format  
-$str  = Bio::AlignIO->new(
-    '-file'	=> test_input_file("testaln.psi"),
-    '-format'	=> 'psi');
-isa_ok($str,'Bio::AlignIO');
-$aln = $str->next_aln();
-isa_ok($aln,'Bio::Align::AlignI');
-is($aln->get_seq_by_pos(1)->get_nse, 'QUERY/1-798');
-is($aln->no_sequences, 56);
-
-# ARP format
-$str  = Bio::AlignIO ->new(
-    '-file'	=> test_input_file("testaln.arp"),
-    -verbose => 1,
-    '-format'	=> 'arp');
-isa_ok($str,'Bio::AlignIO');
-$aln = $str->next_aln();
-isa_ok($aln,'Bio::Align::AlignI');
-is($aln->get_seq_by_pos(1)->get_nse, '01/1-399','ARP get_nse()');
-is($aln->get_seq_by_pos(1)->length, '407');
-is($aln->no_sequences, 60,'ARP no_sequences()');
-is($aln->id, 'Mandenka', 'ARP id()');
-is($aln->description, 'mtDNA sequences in the Senegalese Mandenka (hypervariable region 1)', 'ARP description()');
-my $coll = $aln->annotation;
-isa_ok($coll, 'Bio::AnnotationCollectionI');
-my ($ann) = $coll->get_Annotations('Samples');
-isa_ok($ann, 'Bio::AnnotationI');
-my %nodes = $ann->pairs;
-is(keys %nodes, 60);
-is($nodes{'03'}, 10);
-is(($coll->get_Annotations('DataType'))[0]->value,'DNA');
-is(($coll->get_Annotations('MissingData'))[0]->value,'?');
-
-$str  = Bio::AlignIO->new(
-    '-file'	=> test_input_file("testaln2.arp"),
-    '-format'	=> 'arp');
-isa_ok($str,'Bio::AlignIO');
-$aln = $str->next_aln();
-isa_ok($aln,'Bio::Align::AlignI');
-is($aln->get_seq_by_pos(1)->get_nse, '000/1-29','ARP get_nse()');
-is($aln->no_sequences, 3,'ARP no_sequences()');
-is($aln->id, 'Population 1', 'ARP id()');
-is($aln->description, 'An example of DNA sequence data', 'ARP description()');
-$coll = $aln->annotation;
-isa_ok($coll, 'Bio::AnnotationCollectionI');
-($ann) = $coll->get_Annotations('Samples');
-isa_ok($ann, 'Bio::AnnotationI');
-%nodes = $ann->pairs;
-is(keys %nodes, 3);
-is($nodes{'001'}, 1);
-is(($coll->get_Annotations('DataType'))[0]->value, 'DNA');
-is(($coll->get_Annotations('SampleSize'))[0]->value, 6);
-
-$aln = $str->next_aln();
-isa_ok($aln,'Bio::Align::AlignI');
-is($aln->get_seq_by_pos(2)->get_nse, '001/1-29','ARP get_nse()');
-is($aln->no_sequences, 8,'ARP no_sequences()');
-is($aln->id, 'Population 2', 'ARP id()');
-is($aln->description, 'An example of DNA sequence data', 'ARP description()');
-$coll = $aln->annotation;
-isa_ok($coll, 'Bio::AnnotationCollectionI');
-($ann) = $coll->get_Annotations('Samples');
-isa_ok($ann, 'Bio::AnnotationI');
-%nodes = $ann->pairs;
-is(keys %nodes, 8);
-is($nodes{'001'}, 1);
-is(($coll->get_Annotations('DataType'))[0]->value, 'DNA');
-is(($coll->get_Annotations('SampleSize'))[0]->value, 8);
-
-$aln = $str->next_aln();
-isa_ok($aln,'Bio::Align::AlignI');
-is($aln->get_seq_by_pos(2)->get_nse, '024/1-29','ARP get_nse()');
-is($aln->no_sequences, 6,'ARP no_sequences()');
-is($aln->id, 'Population 3', 'ARP id()');
-is($aln->description, 'An example of DNA sequence data', 'ARP description()');
-$coll = $aln->annotation;
-isa_ok($coll, 'Bio::AnnotationCollectionI');
-($ann) = $coll->get_Annotations('Samples');
-isa_ok($ann, 'Bio::AnnotationI');
-%nodes = $ann->pairs;
-is(keys %nodes, 6);
-is($nodes{'024'}, 1);
-is(($coll->get_Annotations('DataType'))[0]->value, 'DNA');
-is(($coll->get_Annotations('SampleSize'))[0]->value, 6);
-
-# STOCKHOLM (multiple concatenated files)
-# Rfam
-$str  = Bio::AlignIO->new(
-    '-file'	=> test_input_file("rfam_tests.stk"),
-    '-format'	=> 'stockholm');
-$strout = Bio::AlignIO->new('-file'  => ">".test_output_file(),
-		'-format' => 'stockholm', );
-
-isa_ok($str,'Bio::AlignIO');
-$aln = $str->next_aln();
-isa_ok($aln,'Bio::Align::AlignI');
-is($aln->get_seq_by_pos(1)->get_nse, 'Z11765.1/1-89');
-is($aln->accession, 'RF00006');
-is($aln->id, 'Vault');
-is($aln->description,'Vault RNA');
-# annotation
-($ann) = $aln->annotation->get_Annotations('alignment_comment');
-isa_ok($ann, 'Bio::Annotation::Comment');
-is($ann->text,'This family of RNAs are found as part of the enigmatic vault'.
-   ' ribonucleoprotein complex. The complex consists of a major vault protein'.
-   ' (MVP), two minor vault proteins (VPARP and TEP1), and several small '.
-   'untranslated RNA molecules. It has been suggested that the vault complex '.
-   'is involved in drug resistance. We have identified a putative novel vault '.
-   'RNA on chromosome 5 EMBL:AC005219.','Stockholm annotation');
-is($ann->tagname,'alignment_comment','Stockholm annotation');
-
-# test output
-$status = $strout->write_aln($aln);
-is $status, 1, "stockholm output test";
-
-$aln = $str->next_aln();
-isa_ok($aln,'Bio::Align::AlignI');
-is($aln->get_seq_by_pos(1)->get_nse, 'L43844.1/2-149');
-is($aln->accession, 'RF00007');
-is($aln->id, 'U12');
-is($aln->description,'U12 minor spliceosomal RNA');
-my @anns = $aln->annotation->get_Annotations('reference');
-$ann = shift @anns;
-isa_ok($ann, 'Bio::Annotation::Reference', 'Stockholm annotation');
-$ann = shift @anns;
-is($ann->pubmed,'9149533', 'Stockholm annotation');
-is($ann->title,
-   'Pre-mRNA splicing: the discovery of a new spliceosome doubles the challenge.',
-   'Stockholm annotation');
-is($ann->authors,'Tarn WY, Steitz JA;', 'Stockholm annotation');
-is($ann->location,'Trends Biochem Sci 1997;22:132-137.', 'Stockholm annotation');
-# alignment meta data
-my $meta = $aln->consensus_meta;
-isa_ok($meta, 'Bio::Seq::MetaI');
-my ($name) = $meta->meta_names;
-is($name,'SS_cons', 'Rfam meta data');
-my $meta_str = $meta->named_meta($name);
-is($meta_str, '...<<<<<..........>>>>>........<<<<......<<<<......>>>>>>>>'.
-   '<<<<<.......>>>>>...........<<<<<<<...<<<<<<<.....>>>>>>>.>>>>>>>..<<<'.
-   '<<<<<<.........>>>>>>>>>...', 'Rfam meta data');
-$aln = $str->next_aln();
-isa_ok($aln,'Bio::Align::AlignI');
-is($aln->get_seq_by_pos(1)->get_nse, 'AJ295015.1/1-58');
-is($aln->accession, 'RF00008');
-is($aln->id, 'Hammerhead_3');
-is($aln->description,'Hammerhead ribozyme (type III)');
-# alignment meta data
-$meta = $aln->consensus_meta;
-isa_ok($meta, 'Bio::Seq::MetaI');
-($name) = $meta->meta_names;
-is($name,'SS_cons', 'Rfam meta data');
-$meta_str = $meta->named_meta($name);
-is($meta_str, '.<<<<<<..<<<<<.........>>>>>.......<<<<.....................'.
-   '...........>>>>...>>>>>>.', 'Rfam meta data');
-
-# STOCKHOLM (Pfam)
-$str  = Bio::AlignIO->new(
-    '-file'	=> test_input_file("pfam_tests.stk"),
-    '-format'	=> 'stockholm');
-isa_ok($str,'Bio::AlignIO');
-$aln = $str->next_aln();
-isa_ok($aln,'Bio::Align::AlignI');
-is($aln->get_seq_by_pos(1)->get_nse, 'RAD25_SCHPO/5-240');
-is($aln->accession, 'PF00244.9');
-is($aln->id, '14-3-3');
-is($aln->description,'14-3-3 protein');
-($ann) = $aln->annotation->get_Annotations('gathering_threshold');
-isa_ok($ann, 'Bio::Annotation::SimpleValue');
-is($ann->display_text, '25.00 25.00; 25.00 25.00;', 'Pfam annotation');
-$aln = $str->next_aln();
-isa_ok($aln,'Bio::Align::AlignI');
-is($aln->get_seq_by_pos(1)->get_nse, 'COMB_CLOAB/6-235');
-is($aln->accession, 'PF04029.4');
-is($aln->id, '2-ph_phosp');
-is($aln->description,'2-phosphosulpholactate phosphatase');
-$aln = $str->next_aln();
-isa_ok($aln,'Bio::Align::AlignI');
-is($aln->get_seq_by_pos(1)->get_nse, 'Y278_HAEIN/174-219');
-is($aln->accession, 'PF03475.3');
-is($aln->id, '3-alpha');
-is($aln->description,'3-alpha domain');
-# alignment meta data
-$meta = $aln->consensus_meta;
-isa_ok($meta, 'Bio::Seq::MetaI');
-my %test_data = ('SA_cons'  => '6000320010013274....3372052026033.108303630350385563',
-                 'SS_cons'  => 'SCBHHHHHHHHHTSCC....CHHHHHHHHTSTT.CCHHHHHHHHHHHHHSSC',
-                 'seq_cons' => 'plTVtclsclhasc......stphLcphLshss.Lupsa+cohpK+lspshs',);
-for my $name ($meta->meta_names) {
-    ok(exists $test_data{$name}, 'Pfam aln meta data');
-    $meta_str = $meta->named_meta($name);
-    is($meta_str, $test_data{$name}, 'Pfam aln meta data');
-}
-%test_data = ();
-# sequence meta data
-%test_data = ('SA'  => '6000320010013274....3372052026033.108303630350385563',
-              'SS'  => 'SCBHHHHHHHHHTSCC....CHHHHHHHHTSTT.CCHHHHHHHHHHHHHSSC');
-for my $seq ($aln->each_seq) {
-    for my $name ($seq->meta_names) {
-        ok(exists $test_data{$name}, 'Pfam seq meta data');
-        is($seq->named_meta($name), $test_data{$name}, 'Pfam seq meta data');
-    }
-}
-
-# PFAM format (no annotation)
-$str = Bio::AlignIO->new(
-	  '-file' => test_input_file("testaln.pfam"));
-isa_ok($str,'Bio::AlignIO');
-$aln = $str->next_aln();
-isa_ok($aln,'Bio::Align::AlignI');
-is($aln->get_seq_by_pos(1)->get_nse, '1433_LYCES/9-246');
-
-$strout = Bio::AlignIO->new(
-   '-file' => ">".test_output_file(), 
-			    '-format' => 'pfam');
-$status = $strout->write_aln($aln);
-is($status, 1, " pfam output test");
-
-# MAF
-$str = Bio::AlignIO->new(
-	  '-file' => test_input_file("humor.maf"));
-$aln = $str->next_aln();
-isa_ok($aln,'Bio::Align::AlignI');
-is $aln->get_seq_by_pos(1)->get_nse, 'NM_006987/1-5000', "maf input test";
-is $aln->get_seq_by_pos(1)->strand, '-';
-
-# MAF - bug 2453
-$str = Bio::AlignIO->new(
-	  '-file' => test_input_file("bug2453.maf"));
-$aln = $str->next_aln();
-isa_ok($aln,'Bio::Align::AlignI');
-is $aln->get_seq_by_pos(1)->get_nse, 'hg16.chr7/27578829-27578866', "maf input test";
-is $aln->get_seq_by_pos(1)->strand, '+';
-$aln = $str->next_aln();
-is $aln->get_seq_by_pos(1)->get_nse, 'hg16.chr7/27699740-27699745', "maf input test";
-is $aln->get_seq_by_pos(1)->strand, '+';
-$aln = $str->next_aln();
-is $aln->get_seq_by_pos(1)->get_nse, 'hg16.chr7/27707222-27707234', "maf input test";
-is $aln->get_seq_by_pos(1)->strand, '+';
-
-# MSF
-$str = Bio::AlignIO->new(
-    '-file' => test_input_file("testaln.msf"));
-$aln = $str->next_aln();
-isa_ok($aln,'Bio::Align::AlignI');
-is $aln->get_seq_by_pos(1)->get_nse, '1433_LYCES/9-246', "msf input test";
-
-$strout = Bio::AlignIO->new(

@@ Diff output truncated at 10000 characters. @@



More information about the Bioperl-guts-l mailing list