[Bioperl-guts-l] bioperl-live/t LargeLocatableSeq.t, 1.1, 1.2 LinkageMap.t, 1.2, 1.3 LiveSeq.t, 1.14, 1.15 LocatableSeq.t, 1.11, 1.12 LocusLink.t, 1.8, 1.9 largefasta.t, 1.8, 1.9 largepseq.t, 1.9, 1.10 lasergene.t, 1.2, 1.3

Christopher John Fields cjfields at dev.open-bio.org
Wed Apr 11 17:48:11 EDT 2007


Update of /home/repository/bioperl/bioperl-live/t
In directory dev.open-bio.org:/tmp/cvs-serv30093

Modified Files:
	LargeLocatableSeq.t LinkageMap.t LiveSeq.t LocatableSeq.t 
	LocusLink.t largefasta.t largepseq.t lasergene.t 
Log Message:
Finished L's (move to Test::More)

Index: largepseq.t
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/t/largepseq.t,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** largepseq.t	2 Nov 2001 18:48:09 -0000	1.9
--- largepseq.t	11 Apr 2007 21:48:09 -0000	1.10
***************
*** 11,26 ****
      # we include the t dir (where a copy of Test.pm is located)
      # as a fallback
!     eval { require Test; };
      if( $@ ) {
! 	use lib 't';
      }
!     use Test;
!     plan tests => 22;
  }
- use Bio::Seq::LargePrimarySeq;
- use Bio::Seq::LargeSeq;
- use Bio::Location::Simple;
- use Bio::Location::Fuzzy;
- use Bio::Location::Split;
  
  my $pseq = Bio::Seq::LargePrimarySeq->new();
--- 11,26 ----
      # we include the t dir (where a copy of Test.pm is located)
      # as a fallback
!     eval { require Test::More; };
      if( $@ ) {
! 	use lib 't/lib';
      }
!     use Test::More;
!     plan tests => 27;
! 	use_ok('Bio::Seq::LargePrimarySeq');
! 	use_ok('Bio::Seq::LargeSeq');
! 	use_ok('Bio::Location::Simple');
! 	use_ok('Bio::Location::Fuzzy');
! 	use_ok('Bio::Location::Split');
  }
  
  my $pseq = Bio::Seq::LargePrimarySeq->new();
***************
*** 29,40 ****
  $pseq->add_sequence_as_string('GTTTGGGGTTAAACCCCTTTGGGGGGT');
  
! ok $pseq->display_id('hello'), 'hello';
  
! ok $pseq->seq, 'ATGGGGTGGGGTGAAACCCTTTGGGGGTGGGGTAAATGTTTGGGGTTAAACCCCTTTGGGGGGT' , "Sequence is " . $pseq->seq;
  
! ok $pseq->subseq(3,7), 'GGGGT', "Subseq is ".$pseq->subseq(3,7);
  my $location = new Bio::Location::Simple(-start => 4, -end => 8,
  					 -strand => 1);
! ok($pseq->subseq($location), 'GGGTG');
  
  my $splitlocation = new Bio::Location::Split;
--- 29,40 ----
  $pseq->add_sequence_as_string('GTTTGGGGTTAAACCCCTTTGGGGGGT');
  
! is $pseq->display_id('hello'), 'hello';
  
! is $pseq->seq, 'ATGGGGTGGGGTGAAACCCTTTGGGGGTGGGGTAAATGTTTGGGGTTAAACCCCTTTGGGGGGT' , "Sequence is " . $pseq->seq;
  
! is $pseq->subseq(3,7), 'GGGGT', "Subseq is ".$pseq->subseq(3,7);
  my $location = new Bio::Location::Simple(-start => 4, -end => 8,
  					 -strand => 1);
! is($pseq->subseq($location), 'GGGTG');
  
  my $splitlocation = new Bio::Location::Split;
***************
*** 48,52 ****
  							    '-strand' => -1));
  
! ok( $pseq->subseq($splitlocation), 'ATGGGGTGGGGTGAACCCCCAA');
  
  my $fuzzy = new Bio::Location::Fuzzy(-start => '<10',
--- 48,52 ----
  							    '-strand' => -1));
  
! is( $pseq->subseq($splitlocation), 'ATGGGGTGGGGTGAACCCCCAA');
  
  my $fuzzy = new Bio::Location::Fuzzy(-start => '<10',
***************
*** 54,91 ****
  				     -strand => 1);
  
! ok( $pseq->subseq($fuzzy), 'GGTGAAACC');
  
  
! ok($pseq->trunc(8,15)->seq, 'GGGGTGAA', 
      'trunc seq was ' . $pseq->trunc(8,15)->seq);
  
  
! ok $pseq->alphabet('dna'), 'dna'; # so translate will not complain
! ok $pseq->translate()->seq, 'MGWGETLWGWGKCLGLNPFGG';
  
  
  my $seq = new Bio::Seq::LargeSeq(-primaryseq => $pseq );
  
! ok $seq->display_id('hello'), 'hello';
  
! ok $seq->seq, 'ATGGGGTGGGGTGAAACCCTTTGGGGGTGGGGTAAATGTTTGGGGTTAAACCCCTTTGGGGGGT' , "Sequence is " . $seq->seq;
  
! ok $seq->subseq(3,7), 'GGGGT', "Subseq is ".$seq->subseq(3,7);
! ok ($seq->trunc(8,15)->seq, 'GGGGTGAA', 
      'trunc seq was ' . $seq->trunc(8,15)->seq);
  
! ok $seq->alphabet('dna'), 'dna'; # so translate will not complain
! ok $seq->translate()->seq, 'MGWGETLWGWGKCLGLNPFGG';
  
  $seq = new Bio::Seq::LargeSeq( -display_id => 'hello');
  $seq->seq('ATGGGGTGGGGT');
! ok $seq->display_id, 'hello';
  
! ok $seq->seq, 'ATGGGGTGGGGT' , "Sequence is " . $seq->seq;
  
! ok $seq->subseq(3,7), 'GGGGT', "Subseq is ".$seq->subseq(3,7);
! ok ($seq->trunc(8,12)->seq, 'GGGGT', 
      'trunc seq was ' . $seq->trunc(8,12)->seq);
  
! ok $seq->alphabet('dna'), 'dna'; # so translate will not complain
! ok $seq->translate()->seq, 'MGWG';
--- 54,91 ----
  				     -strand => 1);
  
! is( $pseq->subseq($fuzzy), 'GGTGAAACC');
  
  
! is($pseq->trunc(8,15)->seq, 'GGGGTGAA', 
      'trunc seq was ' . $pseq->trunc(8,15)->seq);
  
  
! is $pseq->alphabet('dna'), 'dna'; # so translate will not complain
! is $pseq->translate()->seq, 'MGWGETLWGWGKCLGLNPFGG';
  
  
  my $seq = new Bio::Seq::LargeSeq(-primaryseq => $pseq );
  
! is $seq->display_id('hello'), 'hello';
  
! is $seq->seq, 'ATGGGGTGGGGTGAAACCCTTTGGGGGTGGGGTAAATGTTTGGGGTTAAACCCCTTTGGGGGGT' , "Sequence is " . $seq->seq;
  
! is $seq->subseq(3,7), 'GGGGT', "Subseq is ".$seq->subseq(3,7);
! is ($seq->trunc(8,15)->seq, 'GGGGTGAA', 
      'trunc seq was ' . $seq->trunc(8,15)->seq);
  
! is $seq->alphabet('dna'), 'dna'; # so translate will not complain
! is $seq->translate()->seq, 'MGWGETLWGWGKCLGLNPFGG';
  
  $seq = new Bio::Seq::LargeSeq( -display_id => 'hello');
  $seq->seq('ATGGGGTGGGGT');
! is $seq->display_id, 'hello';
  
! is $seq->seq, 'ATGGGGTGGGGT' , "Sequence is " . $seq->seq;
  
! is $seq->subseq(3,7), 'GGGGT', "Subseq is ".$seq->subseq(3,7);
! is ($seq->trunc(8,12)->seq, 'GGGGT', 
      'trunc seq was ' . $seq->trunc(8,12)->seq);
  
! is $seq->alphabet('dna'), 'dna'; # so translate will not complain
! is $seq->translate()->seq, 'MGWG';

Index: LocatableSeq.t
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/t/LocatableSeq.t,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** LocatableSeq.t	13 Nov 2003 13:44:56 -0000	1.11
--- LocatableSeq.t	11 Apr 2007 21:48:09 -0000	1.12
***************
*** 3,22 ****
  ## $Id$
  use strict;
! use constant NUMTESTS => 80;
  
  BEGIN {
!     eval { require Test; };
      if( $@ ) {
! 	use lib 't';
      }
!     use Test;
  
      plan tests => NUMTESTS;
  }
- use Bio::LocatableSeq;
- ok(1);
- use Bio::SimpleAlign;
- use Bio::AlignIO;
- use Bio::Root::IO;
  
  my ($str, $aln, $seq, $loc);
--- 3,21 ----
  ## $Id$
  use strict;
! use constant NUMTESTS => 84;
  
  BEGIN {
!     eval { require Test::More; };
      if( $@ ) {
! 	use lib 't/lib';
      }
!     use Test::More;
  
      plan tests => NUMTESTS;
+ 	use_ok('Bio::LocatableSeq');
+ 	use_ok('Bio::SimpleAlign');
+ 	use_ok('Bio::AlignIO');
+ 	use_ok('Bio::Root::IO');
  }
  
  my ($str, $aln, $seq, $loc);
***************
*** 27,59 ****
  			     -alphabet => 'dna'
  			     );
! ok $seq->alphabet, 'dna';
! ok $seq->start, 1;
! ok $seq->end, 6;
! ok $seq->strand, 1;
! ok $seq->no_gaps, 1;
! ok $seq->column_from_residue_number(4), 9;
  
  ok $loc = $seq->location_from_column(4);
! ok $loc->isa('Bio::Location::Simple');
! ok $loc->to_FTstring, 2;
  
  ok $loc = $seq->location_from_column(6);
! ok $loc->isa('Bio::Location::Simple');
! ok $loc->start, 3;
! ok $loc->location_type, 'IN-BETWEEN';
! ok $loc->to_FTstring, '3^4';
  
  
! ok $loc = $seq->location_from_column(2), undef;
  
  
  $str = Bio::AlignIO->new(-file=> Bio::Root::IO->catfile("t","data","testaln.pfam"));
! ok defined($str) && ref($str) && $str->isa('Bio::AlignIO');
  $aln = $str->next_aln();
  ok $seq = $aln->get_seq_by_pos(1);
! ok ref($seq), 'Bio::LocatableSeq';
  
! ok $seq->get_nse, '1433_LYCES/9-246';
! ok $seq->id, '1433_LYCES';
  
  # test revcom and trunc
--- 26,59 ----
  			     -alphabet => 'dna'
  			     );
! is $seq->alphabet, 'dna';
! is $seq->start, 1;
! is $seq->end, 6;
! is $seq->strand, 1;
! is $seq->no_gaps, 1;
! is $seq->column_from_residue_number(4), 9;
  
  ok $loc = $seq->location_from_column(4);
! isa_ok $loc,'Bio::Location::Simple';
! is $loc->to_FTstring, 2;
  
  ok $loc = $seq->location_from_column(6);
! isa_ok $loc,'Bio::Location::Simple';
! is $loc->start, 3;
! is $loc->location_type, 'IN-BETWEEN';
! is $loc->to_FTstring, '3^4';
  
  
! is $loc = $seq->location_from_column(2), undef;
  
  
  $str = Bio::AlignIO->new(-file=> Bio::Root::IO->catfile("t","data","testaln.pfam"));
! ok defined($str);
! isa_ok $str,'Bio::AlignIO';
  $aln = $str->next_aln();
  ok $seq = $aln->get_seq_by_pos(1);
! is ref($seq), 'Bio::LocatableSeq';
  
! is $seq->get_nse, '1433_LYCES/9-246';
! is $seq->id, '1433_LYCES';
  
  # test revcom and trunc
***************
*** 66,86 ****
  
  my $seq2 = $seq->trunc(1,9);
! ok $seq2->seq, '--atg---g';
! ok $seq2->start, 1;
! ok $seq2->end, 4;
! ok $seq2->strand, $seq->strand;
  
  $seq2 = $seq->trunc(3,8);
! ok $seq2->seq, 'atg---';
! ok $seq2->start, 1;
! ok $seq2->end, 3;
  
! ok $seq->strand(-1), -1;
! ok $seq->start, 1;
! ok $seq->end, 6;
  $seq2 = $seq->trunc(3,8);
! ok $seq2->seq, 'atg---';
! ok $seq2->start, 4;
! ok $seq2->end, 6;
  #use Data::Dumper;
  #print Dumper $seq;
--- 66,86 ----
  
  my $seq2 = $seq->trunc(1,9);
! is $seq2->seq, '--atg---g';
! is $seq2->start, 1;
! is $seq2->end, 4;
! is $seq2->strand, $seq->strand;
  
  $seq2 = $seq->trunc(3,8);
! is $seq2->seq, 'atg---';
! is $seq2->start, 1;
! is $seq2->end, 3;
  
! is $seq->strand(-1), -1;
! is $seq->start, 1;
! is $seq->end, 6;
  $seq2 = $seq->trunc(3,8);
! is $seq2->seq, 'atg---';
! is $seq2->start, 4;
! is $seq2->end, 6;
  #use Data::Dumper;
  #print Dumper $seq;
***************
*** 88,95 ****
  #exit;
  $seq2 = $seq->revcom();
! ok $seq2->seq, '--tac---cat--';
! ok $seq2->start, $seq->start;
! ok $seq2->end, $seq->end;
! ok $seq2->strand, $seq->strand * -1;
  
  # test column-mapping for -1 strand sequence
--- 88,95 ----
  #exit;
  $seq2 = $seq->revcom();
! is $seq2->seq, '--tac---cat--';
! is $seq2->start, $seq->start;
! is $seq2->end, $seq->end;
! is $seq2->strand, $seq->strand * -1;
  
  # test column-mapping for -1 strand sequence
***************
*** 99,112 ****
  			     -alphabet => 'dna'
  			     );
! ok $seq->column_from_residue_number(5),5;
! ok $seq->column_from_residue_number(4),9;
  ok $loc = $seq->location_from_column(4);
! ok $loc->isa('Bio::Location::Simple');
! ok $loc->to_FTstring, 6;
  ok $loc = $seq->location_from_column(6);
! ok $loc->isa('Bio::Location::Simple');
! ok $loc->start, 4;
! ok $loc->location_type, 'IN-BETWEEN';
! ok $loc->to_FTstring, '4^5';
  
  
--- 99,112 ----
  			     -alphabet => 'dna'
  			     );
! is $seq->column_from_residue_number(5),5;
! is $seq->column_from_residue_number(4),9;
  ok $loc = $seq->location_from_column(4);
! isa_ok $loc,'Bio::Location::Simple';
! is $loc->to_FTstring, 6;
  ok $loc = $seq->location_from_column(6);
! isa_ok $loc,'Bio::Location::Simple';
! is $loc->start, 4;
! is $loc->location_type, 'IN-BETWEEN';
! is $loc->to_FTstring, '4^5';
  
  
***************
*** 119,160 ****
  			     -alphabet => 'dna'
  			     );
! ok $seq->alphabet, 'dna';
! ok $seq->start, 1;
! ok $seq->end, 6;
! ok $seq->strand, -1;
! ok $seq->no_gaps, 1;
! ok $seq->column_from_residue_number(4), 5;
  
  
  ok $seq2 = $seq->trunc(1,9);
! ok $seq2->seq, '--atg---g';
! ok $seq2->start, 3;
! ok $seq2->end, 6;
! ok $seq2->strand, $seq->strand;
  
! ok $seq->location_from_column(3)->start, 6;
! ok $seq->location_from_column(11)->start, 1;
! ok $seq->location_from_column(9)->start, 3;
  
  
  
  ok $seq2 = $seq->trunc(7,12);
! ok $seq2->seq, '--gta-';
! ok $seq2->start, 1;
! ok $seq2->end, 3;
  
  
  ok $seq2 = $seq->trunc(2,6);
! ok $seq2->seq, '-atg-';
! ok $seq2->start, 4;
! ok $seq2->end, 6;
  
  ok $seq2 = $seq->trunc(4,7);
! ok $seq2->seq, 'tg--';
! ok $seq2->start, 4;
! ok $seq2->end, 5;
  
  ok $seq = new Bio::LocatableSeq();
! ok $seq->seq, undef;
! ok $seq->start, undef;
! ok $seq->end, undef;
--- 119,160 ----
  			     -alphabet => 'dna'
  			     );
! is $seq->alphabet, 'dna';
! is $seq->start, 1;
! is $seq->end, 6;
! is $seq->strand, -1;
! is $seq->no_gaps, 1;
! is $seq->column_from_residue_number(4), 5;
  
  
  ok $seq2 = $seq->trunc(1,9);
! is $seq2->seq, '--atg---g';
! is $seq2->start, 3;
! is $seq2->end, 6;
! is $seq2->strand, $seq->strand;
  
! is $seq->location_from_column(3)->start, 6;
! is $seq->location_from_column(11)->start, 1;
! is $seq->location_from_column(9)->start, 3;
  
  
  
  ok $seq2 = $seq->trunc(7,12);
! is $seq2->seq, '--gta-';
! is $seq2->start, 1;
! is $seq2->end, 3;
  
  
  ok $seq2 = $seq->trunc(2,6);
! is $seq2->seq, '-atg-';
! is $seq2->start, 4;
! is $seq2->end, 6;
  
  ok $seq2 = $seq->trunc(4,7);
! is $seq2->seq, 'tg--';
! is $seq2->start, 4;
! is $seq2->end, 5;
  
  ok $seq = new Bio::LocatableSeq();
! is $seq->seq, undef;
! is $seq->start, undef;
! is $seq->end, undef;

Index: LinkageMap.t
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/t/LinkageMap.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** LinkageMap.t	16 Sep 2005 12:22:36 -0000	1.2
--- LinkageMap.t	11 Apr 2007 21:48:09 -0000	1.3
***************
*** 12,33 ****
      # we include the t dir (where a copy of Test.pm is located)
      # as a fallback
!     eval { require Test; };
      if( $@ ) {
!         use lib 't';
      }
!     use Test;
!     plan tests => 16;
  }
  
! # END {
! # }
! 
! require 'dumpvar.pl';
! 
! use Bio::Map::LinkagePosition;
! use Bio::Map::Microsatellite;
! use Bio::Map::LinkageMap;
  
- ok 1 ;
  my $verbose = 0;
  ok my $map = new Bio::Map::LinkageMap('-verbose' => $verbose,
--- 12,28 ----
      # we include the t dir (where a copy of Test.pm is located)
      # as a fallback
!     eval { require Test::More; };
      if( $@ ) {
!         use lib 't/lib';
      }
!     use Test::More;
!     plan tests => 19;
! 	use_ok('Bio::Map::LinkagePosition');
! 	use_ok('Bio::Map::Microsatellite');
! 	use_ok('Bio::Map::LinkageMap');
  }
  
! require_ok('dumpvar.pl');
  
  my $verbose = 0;
  ok my $map = new Bio::Map::LinkageMap('-verbose' => $verbose,
***************
*** 36,45 ****
  				   '-units'   => 'cM',
  				   '-species' => "Brassica");
! ok ref($map), 'Bio::Map::LinkageMap';
! ok $map->name, 'Leviathon';
! ok $map->type, 'Genetic';
! ok $map->units, 'cM';
! ok $map->species, 'Brassica';
! ok $map->unique_id, '1';
  
  ok my $position = new Bio::Map::LinkagePosition('-order' => 2,
--- 31,40 ----
  				   '-units'   => 'cM',
  				   '-species' => "Brassica");
! is ref($map), 'Bio::Map::LinkageMap';
! is $map->name, 'Leviathon';
! is $map->type, 'Genetic';
! is $map->units, 'cM';
! is $map->species, 'Brassica';
! is $map->unique_id, '1';
  
  ok my $position = new Bio::Map::LinkagePosition('-order' => 2,
***************
*** 48,60 ****
  						);
  
! ok $position->order, 2;
! ok $position->map, $map,
! ok $position->value, 22.3;
  
  ok my $o_usat = new Bio::Map::Microsatellite('-name'     => "Chad marker",
  					     '-position' => $position);
  
! ok $o_usat->name, 'Chad marker';
! ok $o_usat->position, $position ;
  ok $map->add_element($o_usat);
  
--- 43,55 ----
  						);
  
! is $position->order, 2;
! ok my $map2 = $position->map;
! is $position->value, 22.3;
  
  ok my $o_usat = new Bio::Map::Microsatellite('-name'     => "Chad marker",
  					     '-position' => $position);
  
! is $o_usat->name, 'Chad marker';
! is $o_usat->position, $position ;
  ok $map->add_element($o_usat);
  
***************
*** 65,74 ****
  # print("position2 looks like this:\n");
  # dumpValue($position2);
! #ok(($position2->each_position_value('fakemap'))[0] == 0);
! #ok $position2->order, 3;
  
  #-------------
! #ok($position->order, 2);
! #ok(($position->each_position_value($map))[0], 22.3);
  	# what should be printed if this was ok?
  	# ok(1);
--- 60,69 ----
  # print("position2 looks like this:\n");
  # dumpValue($position2);
! #is(($position2->each_position_value('fakemap'))[0], 0);
! #is $position2->order, 3;
  
  #-------------
! #is($position->order, 2);
! #is(($position->each_position_value($map))[0], 22.3);
  	# what should be printed if this was ok?
  	# ok(1);
***************
*** 77,82 ****
  #					      '-position' => $position);
  #
! #ok $o_usat->name, 'Chad marker';
! #ok $o_usat->position, $position ;
  #ok $map->add_element($o_usat);
  # what should be printed if this is ok?
--- 72,77 ----
  #					      '-position' => $position);
  #
! #is $o_usat->name, 'Chad marker';
! #is $o_usat->position, $position ;
  #ok $map->add_element($o_usat);
  # what should be printed if this is ok?

Index: largefasta.t
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/t/largefasta.t,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** largefasta.t	22 Oct 2001 08:22:59 -0000	1.8
--- largefasta.t	11 Apr 2007 21:48:09 -0000	1.9
***************
*** 1,17 ****
! 
  
  use strict;
  BEGIN { 
!     eval { require Test; };
      if( $@ ) {
! 	use lib 't';
      }
!     use Test;    
!     plan tests => 15;
  }
  
- use Bio::SeqIO;
  use vars qw($tmpfile);
- use Bio::Root::IO;
  END { unlink $tmpfile; }
  
--- 1,18 ----
! # This is -*-Perl-*- code
! # $Id$
  
  use strict;
  BEGIN { 
!     eval { require Test::More; };
      if( $@ ) {
! 	use lib 't/lib';
      }
!     use Test::More;    
!     plan tests => 17;
! 	use_ok('Bio::Root::IO');
! 	use_ok('Bio::SeqIO');
  }
  
  use vars qw($tmpfile);
  END { unlink $tmpfile; }
  
***************
*** 19,23 ****
  my $seqio = new Bio::SeqIO('-format'=>'largefasta',
  			   '-file'  =>Bio::Root::IO->catfile("t","data","genomic-seq.fasta"));
! ok defined $seqio, 1, 'cannot instantiate Bio::SeqIO::largefasta';
  
  my $pseq = $seqio->next_seq();
--- 20,24 ----
  my $seqio = new Bio::SeqIO('-format'=>'largefasta',
  			   '-file'  =>Bio::Root::IO->catfile("t","data","genomic-seq.fasta"));
! is defined $seqio, 1, 'Instantiate Bio::SeqIO::largefasta';
  
  my $pseq = $seqio->next_seq();
***************
*** 27,46 ****
  my $last_3 = $pseq->subseq($plength-3,$plength);
  
! ok defined $pseq, 1, 'could not call next_seq';
! ok $plength > 0, 1, "could not call length, seq was empty";
! ok length($pseq->subseq(100, 299)), 200, 'error in subseq'; 
! ok $pseq->trunc(100,199)->length(), 100, 'error in trunc'; 
! ok $pseq->alphabet(), 'dna', 'alphabet was ' . $pseq->alphabet();
! ok $pseq->display_id(), 'HSBA536C5',"no display id";
! ok $pseq->accession_number(), 'unknown', "no accession";
! ok $pseq->desc, 'this is my description', 'no description';
  
! ok open(OUT, ">$tmpfile"), 1,'could not open output file';
  
  my $seqout = new Bio::SeqIO('-format' => 'largefasta',
  			    '-fh'     => \*OUT );
! ok defined $seqout, 1,'could not open seq with outputstream';
  
! ok $seqout->write_seq($pseq), 1,'could not write seq';
  $seqout->close();
  close(OUT);
--- 28,47 ----
  my $last_3 = $pseq->subseq($plength-3,$plength);
  
! is defined $pseq, 1;
! is $plength > 0, 1;
! is length($pseq->subseq(100, 299)), 200; 
! is $pseq->trunc(100,199)->length(), 100; 
! is $pseq->alphabet(), 'dna';
! is $pseq->display_id(), 'HSBA536C5';
! is $pseq->accession_number(), 'unknown';
! is $pseq->desc, 'this is my description';
  
! is open(OUT, ">$tmpfile"), 1;
  
  my $seqout = new Bio::SeqIO('-format' => 'largefasta',
  			    '-fh'     => \*OUT );
! is defined $seqout, 1;
  
! is $seqout->write_seq($pseq), 1;
  $seqout->close();
  close(OUT);
***************
*** 48,56 ****
  			'-file'   => $tmpfile);
  my $pseq2 = $seqin->next_seq;
! ok ($plength, $pseq2->length(), 
!     "written file was not same length as expected");
! ok ($pseq->display_id(), $pseq2->display_id(), 
!     "display ids were not identical as expected");
! ok ($pseq->desc(), $pseq2->desc() , 
!     "description was not identical (" . $pseq->desc() . 
!     "," . $pseq2->desc() . ")");
--- 49,53 ----
  			'-file'   => $tmpfile);
  my $pseq2 = $seqin->next_seq;
! is ($plength, $pseq2->length());
! is ($pseq->display_id(), $pseq2->display_id());
! is ($pseq->desc(), $pseq2->desc());

Index: LocusLink.t
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/t/LocusLink.t,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** LocusLink.t	8 Jun 2006 02:11:12 -0000	1.8
--- LocusLink.t	11 Apr 2007 21:48:09 -0000	1.9
***************
*** 7,42 ****
  
  BEGIN {
! 	eval { require Test; };
  	if( $@ ) {
! 		use lib 't';
  	}
! 	use Test;
  	eval {
  		require Graph::Directed; 
- 		$HAVEGRAPHDIRECTED=1;
  	};
  	if ($@) {
! 		$HAVEGRAPHDIRECTED = 0;
! 		warn "Graph::Directed not installed, skipping tests\n";
  	}
! 	plan tests => ($NUMTESTS = 23);
  }
  
  END {
- 	foreach ( $Test::ntest..$NUMTESTS) {
- 		skip('Cannot complete LocusLink tests, skipping',1);
- 	}
  	unlink("locuslink-test.out.embl") if -e "locuslink-test.out.embl";
  }
  
- exit(0) unless $HAVEGRAPHDIRECTED;
- 
- use Bio::SeqIO;
- use Bio::Root::IO;
- use Bio::SeqFeature::Generic;
- use Bio::SeqFeature::AnnotationAdaptor;
- 
- ok(1);
- 
  my $seqin = Bio::SeqIO->new(-file => Bio::Root::IO->catfile("t","data",
  							 "LL-sample.seq"),
--- 7,33 ----
  
  BEGIN {
! 	eval { require Test::More; };
  	if( $@ ) {
! 		use lib 't/lib';
  	}
! 	use Test::More;
  	eval {
  		require Graph::Directed; 
  	};
  	if ($@) {
! 		plan skip_all => "Graph::Directed not installed, skipping tests";
! 	} else {
! 		plan tests => ($NUMTESTS = 26);
  	}
! 	use_ok('Bio::SeqIO');
! 	use_ok('Bio::Root::IO');
! 	use_ok('Bio::SeqFeature::Generic');
! 	use_ok('Bio::SeqFeature::AnnotationAdaptor');
  }
  
  END {
  	unlink("locuslink-test.out.embl") if -e "locuslink-test.out.embl";
  }
  
  my $seqin = Bio::SeqIO->new(-file => Bio::Root::IO->catfile("t","data",
  							 "LL-sample.seq"),
***************
*** 67,77 ****
  }
  
! ok (scalar(@seqs), 2);
  
! ok ($seqs[0]->desc,
      "amiloride binding protein 1 (amine oxidase (copper-containing))");
! ok ($seqs[0]->accession, "26");
! ok ($seqs[0]->display_id, "ABP1");
! ok ($seqs[0]->species->binomial, "Homo sapiens");
  
  
--- 58,68 ----
  }
  
! is (scalar(@seqs), 2);
  
! is ($seqs[0]->desc,
      "amiloride binding protein 1 (amine oxidase (copper-containing))");
! is ($seqs[0]->accession, "26");
! is ($seqs[0]->display_id, "ABP1");
! is ($seqs[0]->species->binomial, "Homo sapiens");
  
  
***************
*** 80,105 ****
  foreach (@dblinks) { $counts{$_->database()}++; }
  
! ok ($counts{GenBank}, 11);
! ok ($counts{RefSeq}, 4);
! ok ($counts{UniGene}, 1);
! ok ($counts{Pfam}, 1);
! ok ($counts{STS}, 2);
! ok ($counts{MIM}, 1);
! ok ($counts{PUBMED}, 6);
! ok (scalar(@dblinks), 27);
  
! ok ($seqs[1]->desc, "v-abl Abelson murine leukemia viral oncogene homolog 2 (arg, Abelson-related gene)");
! ok ($seqs[1]->display_id, "ABL2");
  
  my $ac = $seqs[1]->annotation;
  my @keys = $ac->get_all_annotation_keys();
! ok (scalar(@keys), 19);
  
  my ($cmt) = $ac->get_Annotations('comment');
! ok (length($cmt->text), 403);
  
  my @isoforms = qw(a b);
  foreach ($ac->get_Annotations('PRODUCT')) {
!     ok ($_->value,
  	"v-abl Abelson murine leukemia viral oncogene homolog 2 isoform ".
  	shift(@isoforms));
--- 71,96 ----
  foreach (@dblinks) { $counts{$_->database()}++; }
  
! is ($counts{GenBank}, 11);
! is ($counts{RefSeq}, 4);
! is ($counts{UniGene}, 1);
! is ($counts{Pfam}, 1);
! is ($counts{STS}, 2);
! is ($counts{MIM}, 1);
! is ($counts{PUBMED}, 6);
! is (scalar(@dblinks), 27);
  
! is ($seqs[1]->desc, "v-abl Abelson murine leukemia viral oncogene homolog 2 (arg, Abelson-related gene)");
! is ($seqs[1]->display_id, "ABL2");
  
  my $ac = $seqs[1]->annotation;
  my @keys = $ac->get_all_annotation_keys();
! is (scalar(@keys), 19);
  
  my ($cmt) = $ac->get_Annotations('comment');
! is (length($cmt->text), 403);
  
  my @isoforms = qw(a b);
  foreach ($ac->get_Annotations('PRODUCT')) {
!     is ($_->value,
  	"v-abl Abelson murine leukemia viral oncogene homolog 2 isoform ".
  	shift(@isoforms));
***************
*** 113,119 ****
      }
  }
! ok (scalar(@goann), 4);
  @goann = sort { $a->as_text() cmp $b->as_text() } @goann;
! ok ($goann[2]->as_text, "cellular component|cytoplasm|");
  
  
--- 104,110 ----
      }
  }
! is (scalar(@goann), 4);
  @goann = sort { $a->as_text() cmp $b->as_text() } @goann;
! is ($goann[2]->as_text, "cellular component|cytoplasm|");
  
  

Index: LiveSeq.t
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/t/LiveSeq.t,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** LiveSeq.t	8 Jan 2002 01:20:46 -0000	1.14
--- LiveSeq.t	11 Apr 2007 21:48:09 -0000	1.15
***************
*** 15,45 ****
      # we include the t dir (where a copy of Test.pm is located)
      # as a fallback
!     eval { require Test; };
      if( $@ ) {
! 	use lib 't';
      }
!     use Test;
!     $NUMTESTS = 48;
!     plan tests => $NUMTESTS;
!     $error = 0;
!     eval { require 'IO/String.pm' };
      if( $@ ) {
! 	print STDERR "IO::String not installed. This means the Bio::DB::* modules are not usable. Skipping tests.\n";
! 	for( 1..$NUMTESTS ) {
! 	    skip("IO::String not installed",1);
  	}
! 	$error = 1; 
!     }
! }
! 
! if( $error ==  1 ) {
!     exit(0);
  }
  
- require Bio::LiveSeq::IO::BioPerl;
- require Bio::Root::IO;
- 
- ok(1);
- 
  my $loader=Bio::LiveSeq::IO::BioPerl->load(-db=>"EMBL", 
  					   -file=>Bio::Root::IO->catfile("t","data","factor7.embl"));
--- 15,33 ----
      # we include the t dir (where a copy of Test.pm is located)
      # as a fallback
!     eval { require Test::More; };
      if( $@ ) {
! 	use lib 't/lib';
      }
!     use Test::More;
!     eval { require IO::String };
      if( $@ ) {
! 		plan skip_all => "IO::String not installed. This means the Bio::DB::* modules are not usable. Skipping tests.";
! 	} else {
! 		plan tests => $NUMTESTS = 49;
  	}
! 	use_ok('Bio::LiveSeq::IO::BioPerl');
! 	use_ok('Bio::Root::IO');
  }
  
  my $loader=Bio::LiveSeq::IO::BioPerl->load(-db=>"EMBL", 
  					   -file=>Bio::Root::IO->catfile("t","data","factor7.embl"));
***************
*** 48,103 ****
  ok $gene;
  ok ref($gene), "Bio::LiveSeq::Gene";
! ok $gene->name, "factor7";
! ok $gene->get_DNA->alphabet, "dna";
! ok $gene->get_DNA->display_id, "HSCFVII";
! ok $gene->get_DNA->accession_number, "J02933";
! ok $gene, $gene->get_DNA->gene;
! ok $gene->get_DNA->desc, "Human blood coagulation factor VII gene, complete cds.";
! ok $gene->get_DNA->source, "Homo sapiens";
! ok $gene->get_DNA->start, 1;
! ok $gene->get_DNA->end, 12850;
! ok $gene->maxtranscript->start, 487;
! ok $gene->maxtranscript->end, 12686;
! ok $gene->upbound, 487;
! ok $gene->downbound, 12686;
  ok not(defined($gene->get_Repeat_Units));
  
  my @exons   = @{$gene->get_Exons};
  my @introns = @{$gene->get_Introns};
! ok scalar(@exons), 9;
! ok scalar(@introns), 8;
! ok $introns[4]->desc, "Intron D";
! ok $introns[4]->start, 6592;
! ok $introns[4]->end, 8306;
! ok $exons[1]->desc, "optional";
! ok $exons[4]->end, 6591;
  
  my $transcript  = $gene->get_Transcripts->[0];
  my $translation = $gene->get_Translations->[0];
! ok $transcript , $translation->get_Transcript;
! ok $translation , $transcript->get_Translation;
  
  @exons = $transcript->all_Exons;
! ok $exons[4]->end , 6591;
! ok $exons[4]->length , 114;
! ok $transcript->upstream_seq, "tcaacaggcaggggcagcactgcagagatttcatc";
! ok substr($transcript->downstream_seq,0,16), "cccagcagccctggcc";
! ok $transcript->position($transcript->label(666)), 666;
! ok $transcript->position($transcript->label(666),9419), 95;
! ok $transcript->labelsubseq(8447,undef,9419), "gt";
! ok $transcript->labelsubseq(8447,2), "gt";
! ok $gene->get_DNA->labelsubseq(8447,2), "gg";
! ok substr($gene->get_DNA->labelsubseq(8447,undef,9419),0,16), "ggtgaccaggcttcat";
! ok $gene->get_DNA, $transcript->{seq};
  my ($nothing,$whichexon) = $transcript->in_which_Exon(9419);
! ok $whichexon , 7;
! ok $transcript->frame(9419) , 1;
! ok $transcript->frame(9420) , 2;
! ok substr($translation->seq,0,16), "MVSQALRLLCLLLGLQ";
! ok substr($transcript->seq,0,32), "atggtctcccaggccctcaggctcctctgcct";
  ok $transcript->translation_table(2);
! ok $transcript->translation_table , 2;
! ok substr($translation->seq,0,16), "MVSQAL*"; # mitochondrial table creates stop codon
! ok $gene->verbose(2), 2;
  ok $gene->delete_Obj(); # to free all memory, deleting circular references
  
--- 36,91 ----
  ok $gene;
  ok ref($gene), "Bio::LiveSeq::Gene";
! is $gene->name, "factor7";
! is $gene->get_DNA->alphabet, "dna";
! is $gene->get_DNA->display_id, "HSCFVII";
! is $gene->get_DNA->accession_number, "J02933";
! is $gene, $gene->get_DNA->gene;
! is $gene->get_DNA->desc, "Human blood coagulation factor VII gene, complete cds.";
! is $gene->get_DNA->source, "Homo sapiens";
! is $gene->get_DNA->start, 1;
! is $gene->get_DNA->end, 12850;
! is $gene->maxtranscript->start, 487;
! is $gene->maxtranscript->end, 12686;
! is $gene->upbound, 487;
! is $gene->downbound, 12686;
  ok not(defined($gene->get_Repeat_Units));
  
  my @exons   = @{$gene->get_Exons};
  my @introns = @{$gene->get_Introns};
! is scalar(@exons), 9;
! is scalar(@introns), 8;
! is $introns[4]->desc, "Intron D";
! is $introns[4]->start, 6592;
! is $introns[4]->end, 8306;
! is $exons[1]->desc, "optional";
! is $exons[4]->end, 6591;
  
  my $transcript  = $gene->get_Transcripts->[0];
  my $translation = $gene->get_Translations->[0];
! is $transcript , $translation->get_Transcript;
! is $translation , $transcript->get_Translation;
  
  @exons = $transcript->all_Exons;
! is $exons[4]->end , 6591;
! is $exons[4]->length , 114;
! is $transcript->upstream_seq, "tcaacaggcaggggcagcactgcagagatttcatc";
! is substr($transcript->downstream_seq,0,16), "cccagcagccctggcc";
! is $transcript->position($transcript->label(666)), 666;
! is $transcript->position($transcript->label(666),9419), 95;
! is $transcript->labelsubseq(8447,undef,9419), "gt";
! is $transcript->labelsubseq(8447,2), "gt";
! is $gene->get_DNA->labelsubseq(8447,2), "gg";
! is substr($gene->get_DNA->labelsubseq(8447,undef,9419),0,16), "ggtgaccaggcttcat";
! is $gene->get_DNA, $transcript->{seq};
  my ($nothing,$whichexon) = $transcript->in_which_Exon(9419);
! is $whichexon , 7;
! is $transcript->frame(9419) , 1;
! is $transcript->frame(9420) , 2;
! is substr($translation->seq,0,16), "MVSQALRLLCLLLGLQ";
! is substr($transcript->seq,0,32), "atggtctcccaggccctcaggctcctctgcct";
  ok $transcript->translation_table(2);
! is $transcript->translation_table , 2;
! is substr($translation->seq,0,16), "MVSQAL*"; # mitochondrial table creates stop codon
! is $gene->verbose(2), 2;
  ok $gene->delete_Obj(); # to free all memory, deleting circular references
  

Index: LargeLocatableSeq.t
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/t/LargeLocatableSeq.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** LargeLocatableSeq.t	2 Feb 2004 11:19:43 -0000	1.1
--- LargeLocatableSeq.t	11 Apr 2007 21:48:09 -0000	1.2
***************
*** 5,35 ****
  my $DEBUG = $ENV{'BIOPERLDEBUG'} || 0;
  BEGIN {
!     eval { require Test; };
      if( $@ ) { 
! 	use lib 't';
      }
!     use Test;
      plan tests => 8;
  }
  
- 
- use Bio::Seq::LargeLocatableSeq;
- use Data::Dumper;
- ok 1;
- 
  ok my $llseq  = Bio::Seq::LargeLocatableSeq->new(-seq => 'at-cg',
                                                   -display_id => 'seq1');
  
! print Dumper $llseq if $DEBUG;
! 
! ok $llseq->isa("Bio::Seq::LargeSeqI");
! 
! ok $llseq->seq, 'at-cg';
! ok $llseq->add_sequence_as_string('atcc'), 9;
  
! ok $llseq->start, 1;
  
! ok $llseq->end, 8;
! ok $llseq->length, 9;
  
! 1;
--- 5,27 ----
  my $DEBUG = $ENV{'BIOPERLDEBUG'} || 0;
  BEGIN {
!     eval { require Test::More; };
      if( $@ ) { 
! 	use lib 't/lib';
      }
!     use Test::More;
      plan tests => 8;
+ 	use_ok('Bio::Seq::LargeLocatableSeq');
  }
  
  ok my $llseq  = Bio::Seq::LargeLocatableSeq->new(-seq => 'at-cg',
                                                   -display_id => 'seq1');
  
! isa_ok $llseq, "Bio::Seq::LargeSeqI";
  
! is $llseq->seq, 'at-cg';
! is $llseq->add_sequence_as_string('atcc'), 9;
  
! is $llseq->start, 1;
  
! is $llseq->end, 8;
! is $llseq->length, 9;

Index: lasergene.t
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/t/lasergene.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** lasergene.t	9 Jun 2006 04:26:20 -0000	1.2
--- lasergene.t	11 Apr 2007 21:48:09 -0000	1.3
***************
*** 6,24 ****
  use vars qw($NUMTESTS);
  BEGIN {
! 	$NUMTESTS = 11;
  	# to handle systems with no installed Test module
  	# we include the t dir (where a copy of Test.pm is located)
  	# as a fallback
! 	eval { require Test; };
  	if ( $@ ) {
! 		use lib 't';
  	}
! 	use Test;
  	plan tests => $NUMTESTS;
  }
  
- use Bio::SeqIO::raw;
- use Bio::Root::IO;
- 
  my $verbose = $ENV{'BIOPERLDEBUG'};
  
--- 6,23 ----
  use vars qw($NUMTESTS);
  BEGIN {
! 	$NUMTESTS = 13;
  	# to handle systems with no installed Test module
  	# we include the t dir (where a copy of Test.pm is located)
  	# as a fallback
! 	eval { require Test::More; };
  	if ( $@ ) {
! 		use lib 't/lib';
  	}
! 	use Test::More;
  	plan tests => $NUMTESTS;
+ 	use_ok('Bio::SeqIO::raw');
+ 	use_ok('Bio::Root::IO');	
  }
  
  my $verbose = $ENV{'BIOPERLDEBUG'};
  
***************
*** 38,49 ****
  
  ok($seq = $io->next_seq);
! ok($seq->length, 12*3);
! ok($seq->subseq(1,12) eq 'ATCGATCGATCG');
  
  ok($seq = $io->next_seq);
! ok($seq->length, 200);
  
  ok($seq = $io->next_seq);
! ok($seq->length, 70*5+12);
  
  ok(not defined $io->next_seq);
--- 37,48 ----
  
  ok($seq = $io->next_seq);
! is($seq->length, 12*3);
! is($seq->subseq(1,12), 'ATCGATCGATCG');
  
  ok($seq = $io->next_seq);
! is($seq->length, 200);
  
  ok($seq = $io->next_seq);
! is($seq->length, 70*5+12);
  
  ok(not defined $io->next_seq);
***************
*** 64,67 ****
    $io->next_seq;
  };
! ok($@ =~ m/unexpected end of file/i);
  
--- 63,66 ----
    $io->next_seq;
  };
! like($@, qr/unexpected end of file/i);
  



More information about the Bioperl-guts-l mailing list