Class: Cominer

Inherits:
Object
  • Object
show all
Defined in:
lib/scbi_cominer/cominer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(contig) ⇒ Cominer

Returns a new instance of Cominer.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/scbi_cominer/cominer.rb', line 10

def initialize(contig)
  
  @freq_table = FrequencyTable.new

  contig.reads.each do |name,read|
    # puts ">#{read.name} #{read.orientation} #{read.align_clip_start} #{read.align_clip_end} #{read.start_in_consensus}"
    # puts read.fasta[read.align_clip_start.to_i..read.align_clip_end.to_i]
    # puts read.fasta
    @freq_table.add_read(read)
  end
  
  # puts freq_table.inspect
  #     exit
  #     
  @entropy_function = EntropyFunction.new(@freq_table)
 
  @regions=@entropy_function.regions
  @snps=@entropy_function.snps
  @single_points=@entropy_function.single_points
  
  @freq_table.position_table.delete('-')
  
@position_table = @freq_table.position_table

  
end

Instance Attribute Details

#entropy_functionObject

Returns the value of attribute entropy_function.



8
9
10
# File 'lib/scbi_cominer/cominer.rb', line 8

def entropy_function
  @entropy_function
end

#freq_tableObject

Returns the value of attribute freq_table.



8
9
10
# File 'lib/scbi_cominer/cominer.rb', line 8

def freq_table
  @freq_table
end

#position_tableObject

Returns the value of attribute position_table.



8
9
10
# File 'lib/scbi_cominer/cominer.rb', line 8

def position_table
  @position_table
end

#regionsObject

Returns the value of attribute regions.



8
9
10
# File 'lib/scbi_cominer/cominer.rb', line 8

def regions
  @regions
end

#single_pointsObject

Returns the value of attribute single_points.



8
9
10
# File 'lib/scbi_cominer/cominer.rb', line 8

def single_points
  @single_points
end

#snpsObject

Returns the value of attribute snps.



8
9
10
# File 'lib/scbi_cominer/cominer.rb', line 8

def snps
  @snps
end