Class: Bio::AssemblyGraphAlgorithms::ContigPrinter::AnchoredConnection

Inherits:
Object
  • Object
show all
Defined in:
lib/assembly/contig_printer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#end_probe_contig_offsetObject

number of nucleotides until the end of the end probe read in the start of the second contig



28
29
30
# File 'lib/assembly/contig_printer.rb', line 28

def end_probe_contig_offset
  @end_probe_contig_offset
end

#end_probe_noded_readObject

The identifiers of the probe reads in the velvet assembly graph



22
23
24
# File 'lib/assembly/contig_printer.rb', line 22

def end_probe_noded_read
  @end_probe_noded_read
end

#end_probe_read_lengthObject

Returns the value of attribute end_probe_read_length.



32
33
34
# File 'lib/assembly/contig_printer.rb', line 32

def end_probe_read_length
  @end_probe_read_length
end

#pathsObject

Enumerable of Enumerables of OrientedNode objects, each list of OrientedNode objects corresponds to a path that forms the connection



36
37
38
# File 'lib/assembly/contig_printer.rb', line 36

def paths
  @paths
end

#start_probe_contig_offsetObject

number of nucleotides between the start of the start probe read and the start of the end of the contig



25
26
27
# File 'lib/assembly/contig_printer.rb', line 25

def start_probe_contig_offset
  @start_probe_contig_offset
end

#start_probe_noded_readObject

The identifiers of the probe reads in the velvet assembly graph



22
23
24
# File 'lib/assembly/contig_printer.rb', line 22

def start_probe_noded_read
  @start_probe_noded_read
end

#start_probe_read_lengthObject

Length of the start and end probe sequences



31
32
33
# File 'lib/assembly/contig_printer.rb', line 31

def start_probe_read_length
  @start_probe_read_length
end

Instance Method Details

#collapse_paths_to_maximal_coverage_path!Object

Remove all except the path with maximal coverage from @paths



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/assembly/contig_printer.rb', line 39

def collapse_paths_to_maximal_coverage_path!
  return if @paths.nil? or @paths.empty?
  get_coverage = lambda do |path|
    numerator = 0
    denominator = 0
    path.each do |onode|
      numerator += onode.node.coverage * onode.node.length_alone
      denominator += onode.node.length_alone
    end
    numerator.to_f / denominator
  end
  @paths = [@paths.max do |path1, path2|
    get_coverage.call(path1) <=> get_coverage.call(path2)
  end]
end