Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ad500c1
fix: update SRA.sample.xsd
StephenHulme Nov 26, 2025
07637bc
fix: update ERC000011 ENA default sample checklist
StephenHulme Nov 26, 2025
5667fac
Merge branch 'develop' into y25-286-accession-sample-tags
StephenHulme Nov 27, 2025
f36e5f8
fix: add missing as a low-priority 'country'
StephenHulme Nov 28, 2025
659a6a1
fix: update XPATH to find correct field
StephenHulme Nov 28, 2025
b840d0e
fix: update country import script to fix validations state bug
StephenHulme Nov 28, 2025
426071d
test: rename sample -> accession_sample
StephenHulme Nov 28, 2025
b59cf0a
test: rename smpl to sample
StephenHulme Nov 28, 2025
62bc02b
test: let accession sample xml variables be lazily defined
StephenHulme Nov 28, 2025
955f7cc
test: reduce tag checking duplication
StephenHulme Nov 28, 2025
4ef9028
test: contextualise accession sample validation checks
StephenHulme Nov 28, 2025
c03f20b
test: make update_accession_number test more explicit
StephenHulme Nov 28, 2025
07867c3
test: add explicit tests for tags produced by accessioning
StephenHulme Nov 28, 2025
18b91e8
test: move sample_metadata definition higher up in test context
StephenHulme Dec 1, 2025
2be784f
test: fix spec name typos
StephenHulme Dec 1, 2025
ae7fbdc
test: use real config for tags test
StephenHulme Dec 1, 2025
12be9f9
test: update test data to reflect changes
StephenHulme Dec 1, 2025
d795371
fix: add sample description to xml upload
StephenHulme Dec 1, 2025
f111c0f
fix: add strain to xml upload
StephenHulme Dec 1, 2025
aa77b16
fix: update collection date regex
StephenHulme Dec 1, 2025
8053e1f
fix: add EGA sample checklist
StephenHulme Dec 1, 2025
d73036d
fix: update metadata notes
StephenHulme Dec 1, 2025
02236ce
Merge branch 'develop' into y25-286-accession-sample-tags
StephenHulme Dec 2, 2025
6018ad8
fix: update SRA.common.xsd
StephenHulme Dec 2, 2025
1dabe3f
Merge branch 'develop' into y25-286-accession-sample-tags
StephenHulme Dec 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config --no-exclude-limit`
# on 2025-11-26 13:13:53 UTC using RuboCop version 1.81.7.
# on 2025-11-28 17:57:54 UTC using RuboCop version 1.81.7.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down Expand Up @@ -299,14 +299,15 @@ Lint/UselessOr:
- 'app/models/qcable/statemachine.rb'
- 'app/models/ui_helper/summary.rb'

# Offense count: 6
# Offense count: 7
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
Metrics/AbcSize:
Exclude:
- 'app/controllers/api/v2/transfers_controller.rb'
- 'app/jobs/export_pool_xp_to_traction_job.rb'
- 'app/models/accession_service/base_service.rb'
- 'app/sample_manifest_excel/sample_manifest_excel/manifest_type_list.rb'
- 'lib/insdc/import_countries.rb'

# Offense count: 1
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
Expand All @@ -329,7 +330,7 @@ Metrics/CyclomaticComplexity:
- 'app/models/accession_service/base_service.rb'
- 'lib/limber/helper.rb'

# Offense count: 13
# Offense count: 14
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Exclude:
Expand All @@ -340,6 +341,7 @@ Metrics/MethodLength:
- 'app/models/plate/quad_creator.rb'
- 'app/uat_actions/uat_actions/tube_submission.rb'
- 'app/validators/novaseqx_pe_validator.rb'
- 'lib/insdc/import_countries.rb'
- 'lib/record_loader/application_record_loader.rb'
- 'test/unit/import_fluidigm_data_test.rb'

Expand Down
4 changes: 4 additions & 0 deletions app/models/insdc/country.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ def self.options
sorted_for_select.pluck(:name)
end

def valid!
update!(validation_state: :valid)
end

def invalid!
update!(validation_state: :invalid)
end
Expand Down
31 changes: 31 additions & 0 deletions config/accession/tags.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Tags configuration for Accession::TagList
#
# Tag/field requirements, naming, and validation can be found in the checklists listed below:
#
# - ENA: https://www.ebi.ac.uk/ena/browser/view/ERC000011
# - EGA: https://www.ebi.ac.uk/ena/browser/view/ERC000026
# - ArrayExpress: From September 2022, the interface to ArrayExpress was retired:
# https://www.ebi.ac.uk/about/news/updates-from-data-resources/arrayexpress-retired/
# However, it appears that as of February 2017, ENA was submitting samples to ArrayExpress on our behalf.
# See this sample for an example:
# 1. https://sequencescape.psd.sanger.ac.uk/samples/2934454
# 2. https://www.ebi.ac.uk/ena/browser/view/ERS1545406
# 3. https://www.ebi.ac.uk/biosamples/samples/SAMEA80468668
# How samples are being submitted to ArrayExpress/BioSample now is currently unknown.
#
# Local copies are also stored in `data/sample_checklists/` for reference purposes as they do change occasionally.

sample_taxon_id:
services:
- :ENA
Expand Down Expand Up @@ -26,6 +43,13 @@ date_of_sample_collection:
groups:
- :sample_attributes
ebi_name: :collection_date
sample_description:
services:
- :ENA
- :EGA
groups:
- :sample_attributes
ebi_name: :sample description
donor_id:
services:
- :EGA
Expand All @@ -46,6 +70,13 @@ phenotype:
groups:
- :sample_attributes
- :array_express
sample_strain_att:
services:
- :ENA
- :EGA
groups:
- :sample_attributes
ebi_name: :strain
strain_or_line:
groups:
- :array_express
Expand Down
9 changes: 6 additions & 3 deletions config/locales/metadata/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,14 @@ en:

gender:
label: Gender
edit_info: "Array Express"
help: "EGA is limited to Male, Female, or Unknown."
edit_info: "EGA, Array Express"

country_of_origin:
label: Country of origin
help: The geographic origin of the sample, as defined by the <a href="http://insdc.org/country.html">INSDC list of countries and seas</a>. May also be 'not provided', 'not applicable', 'not collected' or 'restricted access'. Please see <a href="https://ena-docs.readthedocs.io/en/latest/submit/samples/missing-values.html">the missing value documentation</a> before providing one of these values.
accessioning_tag: geographic location (country and/or sea)
edit_info: "ENA requirement"

geographical_region:
label: Geographical region
Expand Down Expand Up @@ -252,6 +254,7 @@ en:
label: Date of sample collection
help: Dates should be in the format YYYY-MM-DDTHH:MM:SS (eg. '2020-01-25T12:59:59') with each additional level of precision being optional. May also be 'not provided', 'not collected' or 'restricted access'. Please see <a href="https://ena-docs.readthedocs.io/en/latest/submit/samples/missing-values.html">the missing value documentation</a> before providing one of these values.
accessioning_tag: collection_date
edit_info: "ENA requirement"

date_of_sample_extraction:
label: Date of sample extraction
Expand Down Expand Up @@ -280,7 +283,7 @@ en:
donor_id:
label: Donor Id
ena_label: subject_id
edit_info: "EGA (As subject id)"
edit_info: "EGA recommended (As subject id)"

subject_id:
label: subject_id
Expand All @@ -291,7 +294,7 @@ en:
edit_info: "Array Express"
phenotype:
label: Phenotype
edit_info: "Array Express"
edit_info: "EGA requirement, Array Express"
strain_or_line:
label: Strain or Line
edit_info: "Array Express"
Expand Down
3 changes: 0 additions & 3 deletions data/ena_sample_checklists/.gitignore

This file was deleted.

Loading
Loading