Skip to content

Commit

Permalink
fasta: dump_fasta
Browse files Browse the repository at this point in the history
  • Loading branch information
Toshiro Nishimura committed Mar 29, 2011
1 parent fdd2fee commit 8ea06f1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/Fasta.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use autodie;
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(convert_file convert bisulfite_convert);
our @EXPORT = qw(slurp_fasta format_fasta count_fasta count_fasta_complete);
our @EXPORT = qw(slurp_fasta format_fasta count_fasta count_fasta_complete dump_fasta);

=head1 EXPORTED FUNCTIONS
Expand Down Expand Up @@ -187,6 +187,14 @@ sub format_fasta{
return (join "\n", @buffer) . "\n";
}

sub dump_fasta{
my ($fasta) = @_;

for my $seq (sort keys %$fasta) {
say format_fasta(uc $seq, $fasta->{$seq});
}
}

1;


0 comments on commit 8ea06f1

Please sign in to comment.