[BioRuby] Non deprecated way of converting a naseq to fasta?

Naohisa GOTO ngoto at gen-info.osaka-u.ac.jp
Wed May 13 14:55:12 UTC 2009


On Thu, 7 May 2009 17:31:26 +1000
Andrew Grimm <andrew.j.grimm at gmail.com> wrote:

> The documentation for Bio::Sequence::Common talks about #to_fasta being
> deprecated, in favor of Bio::Sequence #output instead. #output seems to work
> for Bio::Sequence objects, but not for Bio::Sequence::NA or
> Bio::Sequence::AA objects.

Because the method "to_fasta" is widely and frequently used,
and alternative methods are not fully implemented, you can
still use "to_fasta".

Why "to_fasta" is planned to be deprecated is that the name
to_XXX is usually used for data class conversion in Ruby but
the current behavior of "to_fasta" is to output formatted string.

The method "to_fasta" will be deprecated in the future release,
after alternative methods are fully ready. In addition, for
smooth migration, "to_fasta" may exist as an alias (or a shortcut)
of the alternative methods for a while.

> I can happily create a new FastaFormat object instead, but I'm wondering if
> I'm doing it the right way.

To create a new Bio::Sequence object is the best way.
Bio::FastaFormat is a parser class for reading formatted string,
and is not be intended to generate formatted string.

> Also, the wiki is still suggesting using to_fasta in some of its code
> samples.

Those will be rewritten in the future.

> 
> Thanks,
> 
> Andrew Grimm
> _______________________________________________
> BioRuby mailing list
> BioRuby at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioruby

Thank you.

Naohisa Goto
ngoto at gen-info.osaka-u.ac.jp / ng at bioruby.org



More information about the BioRuby mailing list