Class: Bio::Sequence::Format::Formatter::Fasta_ncbi
- Inherits:
-
Bio::Sequence::Format::FormatterBase
- Object
- Bio::Sequence::Format::FormatterBase
- Bio::Sequence::Format::Formatter::Fasta_ncbi
- Defined in:
- lib/bio/db/fasta/format_fasta.rb
Overview
INTERNAL USE ONLY, YOU SHOULD NOT USE THIS CLASS. NCBI-Style Fasta format output class for Bio::Sequence. (like “ncbi” format in EMBOSS)
Note that this class is under construction.
Instance Method Summary collapse
-
#output ⇒ Object
INTERNAL USE ONLY, YOU SHOULD NOT CALL THIS METHOD.
Methods inherited from Bio::Sequence::Format::FormatterBase
Constructor Details
This class inherits a constructor from Bio::Sequence::Format::FormatterBase
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Bio::Sequence::Format::FormatterBase
Instance Method Details
#output ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/bio/db/fasta/format_fasta.rb', line 73 def output width = 70 seq = @sequence.seq #gi = @sequence.gi_number dbname = 'lcl' if @sequence.primary_accession.to_s.empty? then idstr = @sequence.entry_id else idstr = "#{@sequence.primary_accession}.#{@sequence.sequence_version}" end definition = @sequence.definition header = "#{dbname}|#{idstr} #{definition}" ">#{header}\n" + seq.to_s.gsub(Regexp.new(".{1,#{width}}"), "\\0\n") end |