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.



40
41
42
43
# File 'app/models/fluidigm_file.rb', line 40

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



35
36
37
# File 'app/models/fluidigm_file.rb', line 35

def name
  @name
end

#resultObject (readonly)

Returns the value of attribute result.



35
36
37
# File 'app/models/fluidigm_file.rb', line 35

def result
  @result
end

Instance Method Details

#genderObject



49
50
51
# File 'app/models/fluidigm_file.rb', line 49

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

#gender_marker?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'app/models/fluidigm_file.rb', line 45

def gender_marker?
  /^GS/.match?(name)
end

#pass?Boolean

Returns:

  • (Boolean)


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

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