[Bioperl-guts-l] bioperl-live/t SimpleAlign.t,1.46,1.47
Jason Stajich
jason at dev.open-bio.org
Tue Dec 12 16:36:58 EST 2006
Update of /home/repository/bioperl/bioperl-live/t
In directory dev.open-bio.org:/tmp/cvs-serv5362/t
Modified Files:
SimpleAlign.t
Log Message:
add features to alignments to allow for better NEXUS integration
Index: SimpleAlign.t
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/t/SimpleAlign.t,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -d -r1.46 -r1.47
*** SimpleAlign.t 25 Sep 2006 16:21:26 -0000 1.46
--- SimpleAlign.t 12 Dec 2006 21:36:56 -0000 1.47
***************
*** 3,7 ****
## $Id$
use strict;
! use constant NUMTESTS => 75;
use vars qw($DEBUG);
$DEBUG = $ENV{'BIOPERLDEBUG'} || 0;
--- 3,7 ----
## $Id$
use strict;
! use constant NUMTESTS => 85;
use vars qw($DEBUG);
$DEBUG = $ENV{'BIOPERLDEBUG'} || 0;
***************
*** 20,23 ****
--- 20,26 ----
use_ok('Bio::AlignIO');
use_ok('Bio::Root::IO');
+ use_ok('Bio::SeqFeature::Generic');
+ use_ok('Bio::Location::Simple');
+ use_ok('Bio::Location::Split');
my ($str, $aln, @seqs, $seq);
***************
*** 304,306 ****
}
! 1;
\ No newline at end of file
--- 307,356 ----
}
! # test for Bio::SimpleAlign annotation method and
! # Bio::FeatureHolder stuff
!
! $aln = Bio::SimpleAlign->new;
! for my $seqset ( [qw(one AGAGGAT)], [qw(two AGACGAT) ], [qw(three AGAGGTT)]) {
! $aln->add_seq(Bio::LocatableSeq->new(-id => $seqset->[0],
! -seq => $seqset->[1]));
! }
!
! is $aln->no_sequences, 3, 'added 3 seqs';
!
! $aln->add_SeqFeature(Bio::SeqFeature::Generic->new(-start => 1,
! -end => 1,
! -primary_tag => 'charLabel',
! ));
! $aln->add_SeqFeature(Bio::SeqFeature::Generic->new(-start => 3,
! -end => 3,
! -primary_tag => 'charLabel',
!
! ));
! is($aln->feature_count, 2, 'first 2 features added');
!
! my $splitloc =Bio::Location::Split->new;
! $splitloc->add_sub_Location(Bio::Location::Simple->new(-start => 2,
! -end => 3));
!
! $splitloc->add_sub_Location(Bio::Location::Simple->new(-start => 5,
! -end => 6));
!
! $aln->add_SeqFeature(Bio::SeqFeature::Generic->new(-location =>$splitloc,
! -primary_tag => 'charLabel',
! ));
!
! is($aln->feature_count, 3, '3rd feature added');
!
! #get a slice as defined by the feature
! my $i = 0;
! my @slice_lens = qw(1 1 2 2);
! for my $feature ( $aln->get_SeqFeatures ) {
! for my $loc ( $feature->location->each_Location ) {
! my $fslice = $aln->slice($loc->start, $loc->end);
! is($fslice->length, $slice_lens[$i++], "slice $i len");
! }
! }
!
! # test for Binary/Morphological/Mixed data
!
! 1;
More information about the Bioperl-guts-l
mailing list