Module: Accession::Helpers

Included in:
Defined in:


Handles assigning of accessioning number to a Sequenescape sample. Before accessioning:

check configuration settings, in particular:
 configatron.accession url, ega.user, ega.password, ena.user, ena.password
 configarton.accession_local_key (authorised user uuid)

check that Sequenescape sample sample_metadata meets accessioning requirements configatron.accession_samples flag should be set to true to automatically accession a sample after save (app/models/sample.rb)

Accessioning steps:

1. Create new Accession::Sample, with tags hash (Accession.configuration.tags) and a Sequencescape sample as arguments.
2. Checks if a new accession sample is valid (it will check if Sequencescape sample can be accessioned).
3. Create new Accession::Submission, with authorised user and a valid accession sample as arguments.
4. will send a post request (using Accession::Request) to an outside service (API).
 If the request is successful, Accession::Response will be created, it should have an accession number
5. submission.update_accession_number updates Sequenescape sample accession number

An example of usage is provided in Sequenescape app/jobs/sample_accessioning_job.rb

See Also:

Instance Method Summary collapse

Instance Method Details

#load_file(folder, filename) ⇒ Object

# File 'lib/accession/accession.rb', line 23

def load_file(folder, filename)
  YAML.load_file(File.join(Rails.root, folder, "#{filename}.yml")).with_indifferent_access