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:
- Create new Accession::Sample, with tags hash (Accession.configuration.tags) and a Sequencescape sample as arguments.
- Checks if a new accession sample is valid (it will check if Sequencescape sample can be accessioned).
- Create new Accession::Submission, with authorised user and a valid accession sample as arguments.
- If the submission is valid, submit it using AccessioningV1Client.submit_and_fetch_accession_number.
- The client will submit the submission to the external accessioning service API and return an accession number.
- The submission will update the Sequencescape sample with the new accession number.
- 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 29 |
# File 'lib/accession.rb', line 26 def load_file(folder, filename) file_path = Rails.root.join(folder, "#{filename}.yml") YAML.safe_load_file(file_path, permitted_classes: [Symbol]).with_indifferent_access end |