Skip to content

Commit

Permalink
simplify further to a Seq
Browse files Browse the repository at this point in the history
  • Loading branch information
cjfields committed Sep 9, 2016
1 parent d00d853 commit f1b2a7a
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions lib/Bio/SeqIO/fasta.pm6
Expand Up @@ -31,21 +31,15 @@ class Bio::SeqIO::fasta does Bio::Role::SeqStream does Bio::Role::IO {
# 1) Grammar parsing of a stream of data (e.g. Cat), which is now considered
# a post-6.0 update

method !chunkify {
method next-Seq {
return if $.fh.eof();
while $.fh.get -> $chunk {
if $chunk !~~ /^^\>/ {
return ">$chunk";
return Bio::Grammar::Fasta.subparse( ">$chunk", actions => $!actions, rule => 'record').ast;
} else {
return Bio::Grammar::Fasta.subparse( "$chunk", actions => $!actions, rule => 'record').ast;
}
return $chunk;
}
};

method next-Seq {
my $chunk = self!chunkify;
return if !?$chunk.defined;
my $t = Bio::Grammar::Fasta.subparse($chunk, actions => $!actions, rule => 'record').ast;
return $t;
}

method write-Seq(Bio::PrimarySeq $seq) {
Expand Down

0 comments on commit f1b2a7a

Please sign in to comment.