Class: Sample::Metadata

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

Overview

Reopens the Sample::Metadata class which was defined by has_metadata above Sample::Metadata tracks sample information, either for use in the lab, or passing to the EBI

Instance Method Summary collapse

Instance Method Details

#releaseObject

Rarely actually used



273
274
275
276
# File 'app/models/sample.rb', line 273

def release
  self.sample_sra_hold = 'Public'
  save!
end

#released?Boolean

This is misleading, as samples are rarely released through Sequencescape, so our flag gets out of sync with the ENA/EGA

Returns:

  • (Boolean)


268
269
270
# File 'app/models/sample.rb', line 268

def released?
  sample_sra_hold == 'Public'
end

#sexObject



253
254
255
# File 'app/models/sample.rb', line 253

def sex
  gender&.downcase
end

#speciesObject



257
258
259
# File 'app/models/sample.rb', line 257

def species
  sample_common_name
end

#strain_or_lineObject

here we are aliasing ArrayExpress attribute from normal one This is easier that way so the name is exactly the name of the array-express field and the values can be easily remapped The other solution would be to have a different label for the accession file and the xml/edit page



249
250
251
# File 'app/models/sample.rb', line 249

def strain_or_line
  sample_strain_att
end