Class: Bio::Scf

Inherits:
SangerChromatogram show all
Defined in:
lib/bio/db/sanger_chromatogram/scf.rb

Overview

Description

This class inherits from the SangerChromatogram superclass. It captures the information contained within an scf format chromatogram file generated by DNA sequencing. See the SangerChromatogram class for usage

Instance Attribute Summary collapse

Attributes inherited from SangerChromatogram

#atrace, #chromatogram_type, #ctrace, #dye_mobility, #gtrace, #peak_indices, #qualities, #sequence, #ttrace, #version

Instance Method Summary collapse

Methods inherited from SangerChromatogram

#complement, #complement!, open, #seq, #sequence_string, #to_biosequence

Constructor Details

#initialize(string) ⇒ Scf

see SangerChromatogram class for how to create an Scf object and its usage



37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/bio/db/sanger_chromatogram/scf.rb', line 37

def initialize(string)
  header = string.slice(0,128)
  # read in header info
  @chromatogram_type, @samples, @sample_offset, @bases, @bases_left_clip, @bases_right_clip, @bases_offset, @comment_size, @comments_offset, @version, @sample_size, @code_set, @header_spare = header.unpack("a4 NNNNNNNN a4 NN N20")
  get_traces(string)
  get_bases_peakIndices_and_qualities(string)
  get_comments(string)
  if @comments["DYEP"]
    @dye_mobility = @comments["DYEP"]
  else
    @dye_mobility = "Unnown"
  end
end

Instance Attribute Details

#aqualObject

The quality of each base at each position along the length of the sequence is captured by the nqual attributes where n is one of a, c, g or t. Generally the quality will be high for the base that is called at a particular position and low for all the other bases. However at positions of poor sequence quality, more than one base may have similar top scores. By analysing the nqual attributes it may be possible to determine if the base calling was correct or not. The quality of the A base at each sequence position



26
27
28
# File 'lib/bio/db/sanger_chromatogram/scf.rb', line 26

def aqual
  @aqual
end

#commentsObject

A hash of extra information extracted from the chromatogram file



34
35
36
# File 'lib/bio/db/sanger_chromatogram/scf.rb', line 34

def comments
  @comments
end

#cqualObject

The quality of the C base at each sequence position



28
29
30
# File 'lib/bio/db/sanger_chromatogram/scf.rb', line 28

def cqual
  @cqual
end

#gqualObject

The quality of the G base at each sequence position



30
31
32
# File 'lib/bio/db/sanger_chromatogram/scf.rb', line 30

def gqual
  @gqual
end

#tqualObject

The quality of the T base at each sequence position



32
33
34
# File 'lib/bio/db/sanger_chromatogram/scf.rb', line 32

def tqual
  @tqual
end