Class: Bio::FinishM::ScaffoldBreaker::UnscaffoldedContig

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#scaffoldObject

The Scaffold to which this contig once belonged



10
11
12
# File 'lib/assembly/scaffold_breaker.rb', line 10

def scaffold
  @scaffold
end

#scaffold_position_endObject

Returns the value of attribute scaffold_position_end.



7
8
9
# File 'lib/assembly/scaffold_breaker.rb', line 7

def scaffold_position_end
  @scaffold_position_end
end

#scaffold_position_startObject

Returns the value of attribute scaffold_position_start.



7
8
9
# File 'lib/assembly/scaffold_breaker.rb', line 7

def scaffold_position_start
  @scaffold_position_start
end

#sequenceObject

The actual nucleotide sequence of this contig, from scaffold start position to end (not revcom)



14
15
16
# File 'lib/assembly/scaffold_breaker.rb', line 14

def sequence
  @sequence
end

Instance Method Details

#lengthObject



16
17
18
# File 'lib/assembly/scaffold_breaker.rb', line 16

def length
  @scaffold_position_end - @scaffold_position_start +1
end

#nameObject



20
21
22
23
24
25
26
# File 'lib/assembly/scaffold_breaker.rb', line 20

def name
  contig_number = scaffold.contigs.find_index(self)+1
  if contig_number.nil?
    raise "A contig finds itself unexpectedly not in the scaffold it is supposed to belong to"
  end
  return "#{scaffold.name}_#{contig_number}of#{scaffold.contigs.length}_#{scaffold_position_start}to#{scaffold_position_end}"
end