Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

RT #74078 is fixed so removed hack from FastaIO.pm. Added FastaIO to …

…Makefile
  • Loading branch information...
commit 887c385bc888806515beb09b01a6fb284efc5adf 1 parent 2b8ed38
phil authored
Showing with 7 additions and 10 deletions.
  1. +2 −0  Makefile
  2. +5 −10 lib/Bio/Role/FastaIO.pm
View
2  Makefile
@@ -6,8 +6,10 @@ SOURCES= \
./lib/Bio/Role/Range.pm \
./lib/Bio/Role/Describe.pm \
./lib/Bio/Role/Identify.pm \
+ ./lib/Bio/Role/FastaIO.pm \
./lib/Bio/PrimarySeq.pm \
./lib/Bio/SeqIO.pm
+
PIRS=$(SOURCES:.pm=.pir)
View
15 lib/Bio/Role/FastaIO.pm
@@ -1,7 +1,5 @@
-#stupid RT bug # 74078 Need to create new reference to see builtin functions
-our &shiftt = &shift;
-our &op = &open;
-our &s = &say;
+
+
use Bio::Grammar::Fasta;
use Bio::Grammar::Actions::Fasta;
role Bio::Role::FastaIO[$file]{
@@ -11,14 +9,12 @@ has Int $!width=80;
has $!fh;
method next_seq() {
- #rakudo bug, cannot use builtin functions in roles RT #74078
- return &shiftt(@!results);
+ return shift(@!results);
}
#method will not be private and/or put in new buildmethod
method initial_read() {
- #need to deal with stdin
- #just need to replace $file with $*IN.slurp()
+
#perhaps a different role.... this should be in a ROOT::IO module and not here
if $file.WHAT ~~ IO {
@!results = @(Bio::Grammar::Fasta.parse($file.slurp(), :actions(Bio::Grammar::Actions::Fasta)).ast);
@@ -31,14 +27,13 @@ method initial_read() {
}
method initial_write() {
- #rakudo bug RT #74078
#need error checking to ensure that we did indeed open a new file
if $file.WHAT ~~ IO {
$!fh = $file;
}
else {
- $!fh = &op($file,:w);
+ $!fh = open($file,:w);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.