Module: Accession::Helpers
- Included in:
- Configuration
- Defined in:
- lib/accession.rb
Overview
Handles assigning of accessioning number to a Sequencescape sample. Before accessioning: check configuration settings, in particular: configatron.proxy configatron.accession url, ega.user, ega.password, ena.user, ena.password check that Sequencescape sample sample_metadata meets accessioning requirements feature flag y25_706_enable_accessioning 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. If the submission is valid, submit it using AccessioningV1Client.submit_and_fetch_accession_number. 5. The client will submit the submission to the external accessioning service API and return an accession number. 6. The submission will update the Sequencescape sample with the new accession number. 7. If any step fails, an Accession::Error, Faraday::Error or StandardError will be raised and needs to be handled.
An example of usage is provided in Sequencescape app/jobs/sample_accessioning_job.rb
Instance Method Summary collapse
Instance Method Details
#load_file(folder, filename) ⇒ Object
26 27 28 |
# File 'lib/accession.rb', line 26 def load_file(folder, filename) YAML.load_file(Rails.root.join(folder, "#{filename}.yml")).with_indifferent_access end |