Class: Bio::AssemblyGraphAlgorithms::ContigPrinter::AnchoredConnection
- Inherits:
-
Object
- Object
- Bio::AssemblyGraphAlgorithms::ContigPrinter::AnchoredConnection
- Defined in:
- lib/assembly/contig_printer.rb
Instance Attribute Summary collapse
-
#end_probe_contig_offset ⇒ Object
number of nucleotides until the end of the end probe read in the start of the second contig.
-
#end_probe_noded_read ⇒ Object
The identifiers of the probe reads in the velvet assembly graph.
-
#end_probe_read_length ⇒ Object
Returns the value of attribute end_probe_read_length.
-
#paths ⇒ Object
Enumerable of Enumerables of OrientedNode objects, each list of OrientedNode objects corresponds to a path that forms the connection.
-
#start_probe_contig_offset ⇒ Object
number of nucleotides between the start of the start probe read and the start of the end of the contig.
-
#start_probe_noded_read ⇒ Object
The identifiers of the probe reads in the velvet assembly graph.
-
#start_probe_read_length ⇒ Object
Length of the start and end probe sequences.
Instance Method Summary collapse
-
#collapse_paths_to_maximal_coverage_path! ⇒ Object
Remove all except the path with maximal coverage from @paths.
Instance Attribute Details
#end_probe_contig_offset ⇒ Object
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_read ⇒ Object
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_length ⇒ Object
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 |
#paths ⇒ Object
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_offset ⇒ Object
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_read ⇒ Object
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_length ⇒ Object
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 |