Skip to content

Commit

Permalink
fix to how isa-exporter deterimnes whether an attribute is ontology b…
Browse files Browse the repository at this point in the history
…ased #1632
  • Loading branch information
stuzart committed Nov 8, 2023
1 parent c8bb9ab commit 77d78d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions app/models/sample_attribute.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ def linked_custom_metadata_type
nil
end

# whether this attribute is tied to a controlled vocab which has a source ontology
def ontology_based?
controlled_vocab? && sample_controlled_vocab&.source_ontology.present?
end

private

def store_accessor_name
Expand Down
4 changes: 2 additions & 2 deletions lib/isa_exporter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def convert_ontologies
sample_types = @investigation.studies.map(&:sample_types) + @investigation.assays.map(&:sample_type)
sample_types.flatten.each do |sa|
sa.sample_attributes.each do |atr|
source_ontologies << atr.sample_controlled_vocab.source_ontology if atr.sample_attribute_type.ontology?
source_ontologies << atr.sample_controlled_vocab.source_ontology if atr.ontology_based?
end
end
source_ontologies.uniq.map { |s| { name: s, file: '', version: '', description: '' } }
Expand Down Expand Up @@ -487,7 +487,7 @@ def extract_sample_ids(obj, type)
end

def get_ontology_details(sample_attribute, label, vocab_term)
is_ontology = sample_attribute.sample_attribute_type.ontology?
is_ontology = sample_attribute.ontology_based?
iri = ''
if is_ontology
iri =
Expand Down

0 comments on commit 77d78d9

Please sign in to comment.