Class: Bio::Assembly::Ace
- Inherits:
-
Bio::Assembly
- Object
- Bio::Assembly
- Bio::Assembly::Ace
- Defined in:
- lib/bio-assembly/ace.rb
Defined Under Namespace
Instance Method Summary collapse
- #each_contig ⇒ Object
-
#initialize(path) ⇒ Ace
constructor
A new instance of Ace.
- #to_ace ⇒ Object
Methods inherited from Bio::Assembly
Constructor Details
#initialize(path) ⇒ Ace
Returns a new instance of Ace.
10 11 12 13 |
# File 'lib/bio-assembly/ace.rb', line 10 def initialize(path) @file = File.new(path, 'r') parse_as end |
Instance Method Details
#each_contig ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/bio-assembly/ace.rb', line 15 def each_contig each_identifier do |identifier, attrs| next unless identifier == 'CO' contig = parse_contig(attrs) yield(contig) end end |
#to_ace ⇒ Object
23 24 25 26 27 28 |
# File 'lib/bio-assembly/ace.rb', line 23 def to_ace ace = "" ace += "AS " + num_contigs.to_s + " " + num_reads.to_s + "\n\n" each_contig { |contig| ace += contig.to_ace + "\n" } ace end |