lib/bio/sequence/format.rb in bio-1.4.0 vs lib/bio/sequence/format.rb in bio-1.4.1
- old
+ new
@@ -181,9 +181,23 @@
a.flatten!
a.collect! { |x| x.to_s.downcase.intern }
a
end
+ # The same as output(:fasta, :header=>definition, :width=>width)
+ # This method is intended to replace Bio::Sequence#to_fasta.
+ #
+ # s = Bio::Sequence.new('atgc')
+ # puts s.output_fasta #=> "> \natgc\n"
+ # ---
+ # *Arguments*:
+ # * (optional) _definition_: (String) definition line
+ # * (optional) _width_: (Integer) width (default 70)
+ # *Returns*:: String object
+ def output_fasta(definition = nil, width = 70)
+ output(:fasta, :header=> definition, :width => width)
+ end
+
private
# returns formatter repository modules
def get_formatter_repositories
if self.moltype == Bio::Sequence::NA then