Permalink
Browse files

get PrimarySeq basics rolling (ironically, no seq yet)

  • Loading branch information...
1 parent bef72fa commit e2de8e74f8789b34dc2f0441971e5c32250abab7 Chris Fields committed Mar 25, 2010
Showing with 12 additions and 20 deletions.
  1. +2 −2 Makefile
  2. +1 −12 lib/Bio/PrimarySeq.pm
  3. +1 −1 lib/Bio/Role/Describe.pm
  4. +2 −2 lib/Bio/Role/Identify.pm
  5. +6 −3 t/PrimarySeq.t
View
@@ -1,12 +1,12 @@
PERL6=perl6
RAKUDO_DIR=<RAKUDO_DIR>
-PERL6LIB='<PERL6LIB>:$(RAKUDO_DIR)'
SOURCES= \
./lib/Bio/Root/Root.pm \
./lib/Bio/Role/Range.pm \
./lib/Bio/Role/Describe.pm \
- ./lib/Bio/Role/Identify.pm
+ ./lib/Bio/Role/Identify.pm \
+ ./lib/Bio/PrimarySeq.pm
PIRS=$(SOURCES:.pm=.pir)
View
@@ -1,21 +1,10 @@
use Bio::Role::Describe;
use Bio::Role::Identify;
+
class Bio::PrimarySeq does Bio::Role::Describe does Bio::Role::Identify {
has Str $.seq is rw;
has Str $.alphabet is rw;
has Bool $.is_circular is rw;
-method object_id {
- return $.accession_number;
-}
-
-multi method display_name() {
- return $.display_id;
-}
-
-multi method display_name(Str $id){
- $.display_name =$id;
-}
-
}
View
@@ -4,7 +4,7 @@ role Bio::Role::Describe {
# these are the primary data available that are similar to the BioPerl
# Bio::DescribableI interface.
- has Str $.display_name is rw;
+ has Str $.display_name is rw = 'new-id';
has Str $.description is rw;
#has Str $.description is rw is aliased<desc>;
}
View
@@ -6,8 +6,8 @@ role Bio::Role::Identify;
has Str $.display_id is rw;
has Str $.primary_id is rw;
-has Str $.object_id is rw;
-has $.version is rw;
+has Str $.object_id is rw = self.accession_number;
+has Int $.version is rw;
has Str $.authority is rw;
has Str $.namespace is rw;
has Str $.accession_number is rw;
View
@@ -1,9 +1,12 @@
use v6;
+BEGIN {
+ @*INC.push('./lib');
+}
+
use Test;
use Bio::PrimarySeq;
-
my $seq = Bio::PrimarySeq.new(
seq => 'TTGGTGGCGTCAACT',
display_id => 'new-id',
@@ -33,9 +36,9 @@ is(($seq.namespace()="t"), "t",'namespace is implemented');
is(($seq.version()=0), 0,'version is implemented');
is($seq.lsid_string(), "bioperl.org:t:X677667",'lsid_string construct id correctly');
is($seq.namespace_string(), "t:X677667.0",'namespace_string construct string correctly');
-is($seq.desc(), 'Sample Bio::Seq object','description is implemented');
+is($seq.description, 'Sample Bio::Seq object','description is implemented');
#display_name method given by perl6 cannot override
#need to discuss with folks at #perl6
-#is($seq.display_name(), "new-id",'display_name is implemented');
+is($seq.display_name(), "new-id",'display_name is implemented');

0 comments on commit e2de8e7

Please sign in to comment.