[Bioperl-guts-l] [15036] bioperl-live/trunk/t: move into directory structure (DaveM++)

Christopher John Fields cjfields at dev.open-bio.org
Thu Nov 27 23:38:01 EST 2008


Revision: 15036
Author:   cjfields
Date:     2008-11-27 23:38:01 -0500 (Thu, 27 Nov 2008)

Log Message:
-----------
move into directory structure (DaveM++)

Added Paths:
-----------
    bioperl-live/trunk/t/AlignIO/
    bioperl-live/trunk/t/AlignIO/AlignIO.t
    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/po.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.pm
    bioperl-live/trunk/t/AlignIO/xmfa.t

Removed Paths:
-------------
    bioperl-live/trunk/t/AlignIO.t
    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_po.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

Copied: bioperl-live/trunk/t/AlignIO/AlignIO.t (from rev 15022, bioperl-live/trunk/t/AlignIO.t)
===================================================================
--- bioperl-live/trunk/t/AlignIO/AlignIO.t	                        (rev 0)
+++ bioperl-live/trunk/t/AlignIO/AlignIO.t	2008-11-28 04:38:01 UTC (rev 15036)
@@ -0,0 +1,76 @@
+# -*-Perl-*- Test Harness script for Bioperl
+# $Id$
+
+use strict;
+
+BEGIN {
+	use lib 't/lib';
+    use BioperlTest;
+    
+    test_begin(-tests => 28);
+	
+	use_ok('Bio::AlignIO');
+}
+
+my $DEBUG = test_debug();
+
+my ($str,$aln,$strout,$status);
+
+# general filehandle tests
+# not all parsers support output (noted as 0)
+my %files = (
+    # file                   format       I  O
+	'testaln.phylip' 	=> ['phylip',     1, 1],
+	'testaln.psi'	 	=> ['psi',        1, 1],
+	'testaln.arp'       => ['arp',        1, 0],
+	'rfam_tests.stk'    => ['stockholm',  1, 1],
+	'testaln.pfam'      => ['pfam',       1, 1],
+	'testaln.msf'       => ['msf',        1, 1],
+	'testaln.fasta'     => ['fasta',      1, 1],
+	'testaln.selex'     => ['selex',      1, 1],
+	'testaln.mase'      => ['mase',       1, 0],
+	'testaln.prodom'    => ['prodom',     1, 0],
+	'testaln.aln'       => ['clustalw',   1, 1],
+	'testaln.metafasta' => ['metafasta',  1, 1],
+	'testaln.nexus'     => ['nexus',      1, 1],
+	'testaln.po'        => ['po',         1, 1],
+	'testaln.xmfa'      => ['xmfa',       1, 1],
+ );
+
+# input file handles
+
+while (my ($file, $fdata) = each %files) {
+    my ($format, $in, $out) = @{$fdata};
+    if ($in) {
+        my $fhin = Bio::AlignIO->newFh(
+           '-file'  => test_input_file($file), 
+                           '-format' => $format);
+        my $fhout = Bio::AlignIO->newFh(
+           '-file' => ">".test_output_file(), 
+                        '-format' => 'clustalw');
+        while ( $aln = <$fhin>) {
+            cmp_ok($aln->no_sequences, '>=', 2, "input filehandle method test : $format");
+            last;
+        }
+    }
+}
+
+# output file handles
+
+while (my ($file, $fdata) = each %files) {
+    my ($format, $in, $out) = @{$fdata};
+    if ($out) {
+        my $status = 0;
+        my $fhin = Bio::AlignIO->newFh(
+           '-file' => test_input_file('testaln.aln'), 
+                        '-format' => 'clustalw');
+        my $fhout = Bio::AlignIO->newFh(
+           '-file'  => '>'.test_output_file(), 
+                           '-format' => $format);
+        while ( $aln = <$fhin> ) {
+            $status = print $fhout $aln;
+            last;
+        }
+        is $status, 1, "filehandle output test : $format";
+    }
+}

Copied: bioperl-live/trunk/t/AlignIO/arp.t (from rev 15025, bioperl-live/trunk/t/AlignIO_arp.t)
===================================================================
--- bioperl-live/trunk/t/AlignIO/arp.t	                        (rev 0)
+++ bioperl-live/trunk/t/AlignIO/arp.t	2008-11-28 04:38:01 UTC (rev 15036)
@@ -0,0 +1,93 @@
+# -*-Perl-*- Test Harness script for Bioperl
+# $Id: AlignIO_arp.t 14971 2008-10-28 16:08:52Z cjfields $
+
+use strict;
+
+BEGIN {
+	use lib 't/lib';
+    use BioperlTest;
+    
+    test_begin(-tests => 48);
+	
+	use_ok('Bio::AlignIO');
+}
+
+my $DEBUG = test_debug();
+
+my ($str,$aln,$strout,$status);
+
+# 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);
+

Copied: bioperl-live/trunk/t/AlignIO/bl2seq.t (from rev 15025, bioperl-live/trunk/t/AlignIO_bl2seq.t)
===================================================================
--- bioperl-live/trunk/t/AlignIO/bl2seq.t	                        (rev 0)
+++ bioperl-live/trunk/t/AlignIO/bl2seq.t	2008-11-28 04:38:01 UTC (rev 15036)
@@ -0,0 +1,27 @@
+# -*-Perl-*- Test Harness script for Bioperl
+# $Id: AlignIO_bl2seq.t 14971 2008-10-28 16:08:52Z cjfields $
+
+use strict;
+
+BEGIN {
+	use lib 't/lib';
+    use BioperlTest;
+    
+    test_begin(-tests => 3);
+	
+	use_ok('Bio::AlignIO');
+}
+
+my $DEBUG = test_debug();
+
+my ($str,$aln,$strout,$status);
+
+# BL2SEQ
+$str = Bio::AlignIO->new(
+   '-file'   => test_input_file("bl2seq.out"),
+			 '-format' => 'bl2seq',
+			 '-report_type' => 'blastp');
+$aln = $str->next_aln();
+isa_ok($aln,'Bio::Align::AlignI');
+is $aln->get_seq_by_pos(2)->get_nse, 'ALEU_HORVU/60-360', 
+    "BLAST bl2seq format test";
\ No newline at end of file

Copied: bioperl-live/trunk/t/AlignIO/clustalw.t (from rev 15025, bioperl-live/trunk/t/AlignIO_clustalw.t)
===================================================================
--- bioperl-live/trunk/t/AlignIO/clustalw.t	                        (rev 0)
+++ bioperl-live/trunk/t/AlignIO/clustalw.t	2008-11-28 04:38:01 UTC (rev 15036)
@@ -0,0 +1,44 @@
+# -*-Perl-*- Test Harness script for Bioperl
+# $Id: AlignIO_clustalw.t 14971 2008-10-28 16:08:52Z cjfields $
+
+use strict;
+
+BEGIN {
+	use lib 't/lib';
+    use BioperlTest;
+    
+    test_begin(-tests => 6);
+	
+	use_ok('Bio::AlignIO');
+}
+
+my $DEBUG = test_debug();
+
+my ($str,$aln,$strout,$status);
+
+# CLUSTAL
+my $io = Bio::AlignIO->new(
+   -file => test_input_file("testaln.aln") );
+$aln = $io->next_aln();
+isa_ok($aln,'Bio::Align::AlignI');
+is $aln->consensus_string, "MNEGEHQIKLDELFEKLLRARKIFKNKDVLRHSWEPKDLPHRHEQIEA".
+"LAQILVPVLRGETMKIIFCGHHACELGEDRGTKGFVIDELKDVDEDRNGKVDVIEINCEHMDTHYRVLPNIAKLF".
+"DDCTGIGVPMHGGPTDEVTAKLKQVIDMKERFVIIVLDEIDKLVKKSGDEVLYSLTRINTELKRAKVSVIGISND".
+"LKFKEYLDPRVLSSLSEEEVVFPPYDANQLRDILTQRAEEAFYPGVLDEGVIPLCAALAAREHGDARKALDLLRV".
+"AGEIAEREGASKVTEKHVWKAQEKIEQDMMEEVIKTLPLQSKVLLYAIVLLDENGDLPANTGDVYAVYRELCEYI".
+"DLEPLTQRRISDLINELDMLGIINAKVVSKGRYGRTKEIRLMVTSYKIRNVLRYDYSIQPLLTISLKSEQRRLI",
+"clustalw consensus_string test";
+
+my $outfile = test_output_file();
+$strout = Bio::AlignIO->new(
+   '-file' => ">$outfile", 
+			      '-format' => 'clustalw');
+$status = $strout->write_aln($aln);
+is $status, 1, "clustalw (.aln) output test";
+undef $strout;
+$str = Bio::AlignIO->new(
+   '-file'=> $outfile, 
+			   '-format' => 'clustalw');
+$aln = $str->next_aln($aln);
+isa_ok($aln,'Bio::Align::AlignI');
+is $aln->get_seq_by_pos(1)->get_nse, 'P84139/1-420', "clustalw (.aln) input test";

Copied: bioperl-live/trunk/t/AlignIO/emboss.t (from rev 15025, bioperl-live/trunk/t/AlignIO_emboss.t)
===================================================================
--- bioperl-live/trunk/t/AlignIO/emboss.t	                        (rev 0)
+++ bioperl-live/trunk/t/AlignIO/emboss.t	2008-11-28 04:38:01 UTC (rev 15036)
@@ -0,0 +1,89 @@
+# -*-Perl-*- Test Harness script for Bioperl
+# $Id: AlignIO_emboss.t 14971 2008-10-28 16:08:52Z cjfields $
+
+use strict;
+
+BEGIN {
+	use lib 't/lib';
+    use BioperlTest;
+    
+    test_begin(-tests => 37);
+	
+	use_ok('Bio::AlignIO');
+}
+
+my $DEBUG = test_debug();
+
+my ($str,$aln,$strout,$status);
+
+# EMBOSS water
+$str = Bio::AlignIO->new('-format' => 'emboss',
+		 '-file'   => test_input_file('cysprot.water'));
+$aln = $str->next_aln();
+isa_ok($aln,'Bio::Align::AlignI');
+is($aln->score,'501.50');
+is($aln->get_seq_by_pos(1)->get_nse,'PAPA_CARPA/3-342');
+is($aln->get_seq_by_pos(2)->get_nse,'CATL_HUMAN/1-331');
+is(sprintf("%.1f",$aln->overall_percentage_identity),33.8);
+is(sprintf("%.1f",$aln->average_percentage_identity),40.1);
+
+is($aln->get_seq_by_pos(1)->start, 3);
+is($aln->length,364);
+
+
+# EMBOSS needle
+$str = Bio::AlignIO->new('-format' => 'emboss',
+	  '-file'   => test_input_file('cysprot.needle'));
+$aln = $str->next_aln();

@@ Diff output truncated at 10000 characters. @@



More information about the Bioperl-guts-l mailing list