Class: FluidigmFile::Assay

Inherits:
Object
  • Object
show all
Defined in:
app/models/fluidigm_file.rb

Constant Summary collapse

@@valid_markers =
%w[XX XY YY]
@@gender_map =
{ 'XX' => 'F', 'YY' => 'F', 'XY' => 'M' }

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, result) ⇒ Assay

Returns a new instance of Assay


57
58
59
60
# File 'app/models/fluidigm_file.rb', line 57

def initialize(name, result)
  @name   = name
  @result = result
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name


52
53
54
# File 'app/models/fluidigm_file.rb', line 52

def name
  @name
end

#resultObject (readonly)

Returns the value of attribute result


52
53
54
# File 'app/models/fluidigm_file.rb', line 52

def result
  @result
end

Instance Method Details

#genderObject


66
67
68
# File 'app/models/fluidigm_file.rb', line 66

def gender
  @@gender_map[result] || 'U'
end

#gender_marker?Boolean

Returns:

  • (Boolean)

62
63
64
# File 'app/models/fluidigm_file.rb', line 62

def gender_marker?
  /^GS/ === name
end

#pass?Boolean

Returns:

  • (Boolean)

70
71
72
# File 'app/models/fluidigm_file.rb', line 70

def pass?
  @@valid_markers.include?(result)
end