Skip to content

Commit

Permalink
rename Isa -> ISA
Browse files Browse the repository at this point in the history
  • Loading branch information
stuzart committed Dec 16, 2024
1 parent f7d4cd4 commit 698ad57
Show file tree
Hide file tree
Showing 51 changed files with 142 additions and 141 deletions.
2 changes: 1 addition & 1 deletion app/controllers/assays_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AssaysController < ApplicationController

include Seek::Publishing::PublishingCommon

include Seek::IsaGraphExtensions
include Seek::ISAGraphExtensions

api_actions :index, :show, :create, :update, :destroy

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/collections_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class CollectionsController < ApplicationController

include Seek::Publishing::PublishingCommon

include Seek::IsaGraphExtensions
include Seek::ISAGraphExtensions

api_actions :index, :show, :create, :update, :destroy

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/data_files_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class DataFilesController < ApplicationController

include Seek::Doi::Minting

include Seek::IsaGraphExtensions
include Seek::ISAGraphExtensions

api_actions :index, :show, :create, :update, :destroy

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/documents_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class DocumentsController < ApplicationController

include Seek::Doi::Minting

include Seek::IsaGraphExtensions
include Seek::ISAGraphExtensions

api_actions :index, :show, :create, :update, :destroy

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/file_templates_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class FileTemplatesController < ApplicationController

include Seek::Doi::Minting

include Seek::IsaGraphExtensions
include Seek::ISAGraphExtensions

api_actions :index, :show, :create, :update, :destroy

Expand Down
6 changes: 3 additions & 3 deletions app/controllers/investigations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class InvestigationsController < ApplicationController

include Seek::AnnotationCommon

include Seek::IsaGraphExtensions
include Seek::ISAGraphExtensions

api_actions :index, :show, :create, :update, :destroy

Expand Down Expand Up @@ -60,12 +60,12 @@ def submit_fairdata_station
end

def export_isatab_json
the_hash = IsaTabConverter.convert_investigation(Investigation.find(params[:id]))
the_hash = ISATabConverter.convert_investigation(Investigation.find(params[:id]))
send_data JSON.pretty_generate(the_hash) , filename: 'isatab.json'
end

def export_isa
isa = IsaExporter::Exporter.new(Investigation.find(params[:id]), current_user).export
isa = ISAExporter::Exporter.new(Investigation.find(params[:id]), current_user).export
send_data isa, filename: 'isa.json', type: 'application/json', deposition: 'attachment'
rescue Exception => e
respond_to do |format|
Expand Down
10 changes: 5 additions & 5 deletions app/controllers/isa_assays_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class IsaAssaysController < ApplicationController
class ISAAssaysController < ApplicationController
include Seek::AssetsCommon
include Seek::Publishing::PublishingCommon

Expand Down Expand Up @@ -29,12 +29,12 @@ def new

@isa_assay =
if params[:is_assay_stream]
IsaAssay.new({ assay: { assay_class_id: AssayClass.assay_stream.id,
ISAAssay.new({ assay: { assay_class_id: AssayClass.assay_stream.id,
study_id: study.id,
position: new_position },
input_sample_type_id: })
else
IsaAssay.new({ assay: { assay_class_id: AssayClass.experimental.id,
ISAAssay.new({ assay: { assay_class_id: AssayClass.experimental.id,
assay_stream_id: params[:assay_stream_id],
study_id: study.id,
position: new_position },
Expand Down Expand Up @@ -118,7 +118,7 @@ def rearrange_assay_positions_create_isa_assay
end

def initialize_isa_assay
@isa_assay = IsaAssay.new(isa_assay_params)
@isa_assay = ISAAssay.new(isa_assay_params)
update_sharing_policies @isa_assay.assay
@isa_assay.assay.contributor = current_person
@isa_assay.sample_type.contributor = User.current_user.person if isa_assay_params[:sample_type]
Expand Down Expand Up @@ -199,7 +199,7 @@ def set_up_instance_variable
end

def find_requested_item
@isa_assay = IsaAssay.new
@isa_assay = ISAAssay.new
@isa_assay.populate(params[:id])

if @isa_assay.assay.nil?
Expand Down
8 changes: 4 additions & 4 deletions app/controllers/isa_studies_controller.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
class IsaStudiesController < ApplicationController
class ISAStudiesController < ApplicationController
include Seek::AssetsCommon
include Seek::Publishing::PublishingCommon

before_action :set_up_instance_variable
before_action :find_requested_item, only: %i[edit update]

def new
@isa_study = IsaStudy.new({ study: { investigation_id: params[:investigation_id] } })
@isa_study = ISAStudy.new({ study: { investigation_id: params[:investigation_id] } })
end

def create
@isa_study = IsaStudy.new(isa_study_params)
@isa_study = ISAStudy.new(isa_study_params)
update_sharing_policies @isa_study.study
@isa_study.source.policy = @isa_study.study.policy
@isa_study.sample_collection.policy = @isa_study.study.policy
Expand Down Expand Up @@ -129,7 +129,7 @@ def set_up_instance_variable
end

def find_requested_item
@isa_study = IsaStudy.new
@isa_study = ISAStudy.new
@isa_study.populate(params[:id])

@isa_study.errors.add(:study, "The #{t('isa_study')} was not found.") if @isa_study.study.nil?
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/models_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ModelsController < ApplicationController
include Bives
include Seek::Doi::Minting

include Seek::IsaGraphExtensions
include Seek::ISAGraphExtensions

api_actions :index, :show, :create, :update, :destroy

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/observation_units_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ObservationUnitsController < ApplicationController
before_action :find_assets, only: [:index]

include Seek::Publishing::PublishingCommon
include Seek::IsaGraphExtensions
include Seek::ISAGraphExtensions

api_actions :index, :show, :create, :update, :destroy

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/presentations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class PresentationsController < ApplicationController

include Seek::Publishing::PublishingCommon

include Seek::IsaGraphExtensions
include Seek::ISAGraphExtensions

api_actions :index, :show, :create, :update, :destroy

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/programmes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ProgrammesController < ApplicationController

skip_before_action :project_membership_required

include Seek::IsaGraphExtensions
include Seek::ISAGraphExtensions

respond_to :html, :json

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/projects_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ProjectsController < ApplicationController

cache_sweeper :projects_sweeper, only: %i[update create destroy]

include Seek::IsaGraphExtensions
include Seek::ISAGraphExtensions

respond_to :html, :json

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/publications_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class PublicationsController < ApplicationController
before_action :suggest_authors, only: [:manage]
before_action :find_display_asset, :only=>[:show, :download]

include Seek::IsaGraphExtensions
include Seek::ISAGraphExtensions
include PublicationsHelper

api_actions :index, :show
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/samples_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class SamplesController < ApplicationController

before_action :auth_to_create, only: %i[new create batch_create]

include Seek::IsaGraphExtensions
include Seek::ISAGraphExtensions
include Seek::Publishing::PublishingCommon

api_actions :index, :show, :create, :update, :destroy, :batch_create
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/sops_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class SopsController < ApplicationController

include Seek::Doi::Minting

include Seek::IsaGraphExtensions
include Seek::ISAGraphExtensions

api_actions :index, :show, :create, :update, :destroy

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/studies_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class StudiesController < ApplicationController

include Seek::Publishing::PublishingCommon
include Seek::AnnotationCommon
include Seek::IsaGraphExtensions
include Seek::ISAGraphExtensions

api_actions :index, :show, :create, :update, :destroy

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/templates_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def template_attributes

def filter_isa_tags_by_level
level = params[:level]
all_isa_tags_options = IsaTag.all.map { |it| { text: it.title, value: it.id } }
all_isa_tags_options = ISATag.all.map { |it| { text: it.title, value: it.id } }

case level
when 'study source'
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/workflows_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class WorkflowsController < ApplicationController

include Seek::Publishing::PublishingCommon
include Seek::Doi::Minting
include Seek::IsaGraphExtensions
include Seek::ISAGraphExtensions
include RoCrateHandling
include Legacy::WorkflowSupport

Expand Down
2 changes: 1 addition & 1 deletion app/forms/isa_assay.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class IsaAssay
class ISAAssay
include ActiveModel::Model

attr_accessor :assay, :sample_type, :input_sample_type_id
Expand Down
2 changes: 1 addition & 1 deletion app/forms/isa_study.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class IsaStudy
class ISAStudy
include ActiveModel::Model

attr_accessor :study, :source_sample_type, :sample_collection_sample_type
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/isa_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'tempfile'

module IsaHelper
module ISAHelper
OLD_FILL_COLOURS = {
'Sop' => '#7AC5CD', # cadetblue3
'Model' => '#CDCD00', # yellow3
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/isa_tab_converter.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# noinspection ALL
class IsaTabConverter
class ISATabConverter
include Seek::Util.routes

JERM_ONTOLOGY_URL = 'http://jermontology.org/ontology/JERMOntology'
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/populate_templates_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ class PopulateTemplatesJob < ApplicationJob
def perform
return unless Seek::Config.isa_json_compliance_enabled

Seek::IsaTemplates::TemplateExtractor.extract_templates
Seek::ISATemplates::TemplateExtractor.extract_templates
end
end
2 changes: 1 addition & 1 deletion app/models/application_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ApplicationRecord < ActiveRecord::Base
include Seek::GroupedPagination
include Seek::TitleTrimmer
include Seek::ActsAsAsset
include Seek::ActsAsIsa
include Seek::ActsAsISA
include HasExtendedMetadata
include Seek::Doi::ActsAsDoiMintable
include Seek::Doi::ActsAsDoiParent
Expand Down
38 changes: 19 additions & 19 deletions app/models/isa_tag.rb
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
class IsaTag < ApplicationRecord
class ISATag < ApplicationRecord
validates :title, presence: true

has_many :template_attributes, inverse_of: :isa_tag
has_many :sample_attributes, inverse_of: :isa_tag
has_many :template_attributes, inverse_of: :ISATag
has_many :sample_attributes, inverse_of: :ISATag

def isa_source?
title == Seek::Isa::TagType::SOURCE
title == Seek::ISA::TagType::SOURCE
end

def isa_source_characteristic?
title == Seek::Isa::TagType::SOURCE_CHARACTERISTIC
title == Seek::ISA::TagType::SOURCE_CHARACTERISTIC
end

def isa_sample?
title == Seek::Isa::TagType::SAMPLE
title == Seek::ISA::TagType::SAMPLE
end

def isa_sample_characteristic?
title == Seek::Isa::TagType::SAMPLE_CHARACTERISTIC
title == Seek::ISA::TagType::SAMPLE_CHARACTERISTIC
end

def isa_protocol?
title == Seek::Isa::TagType::PROTOCOL
title == Seek::ISA::TagType::PROTOCOL
end

def isa_other_material?
title == Seek::Isa::TagType::OTHER_MATERIAL
title == Seek::ISA::TagType::OTHER_MATERIAL
end

def isa_other_material_characteristic?
title == Seek::Isa::TagType::OTHER_MATERIAL_CHARACTERISTIC
title == Seek::ISA::TagType::OTHER_MATERIAL_CHARACTERISTIC
end

def isa_data_file?
title == Seek::Isa::TagType::DATA_FILE
title == Seek::ISA::TagType::DATA_FILE
end

def isa_data_file_comment?
title == Seek::Isa::TagType::DATA_FILE_COMMENT
title == Seek::ISA::TagType::DATA_FILE_COMMENT
end

def isa_parameter_value?
title == Seek::Isa::TagType::PARAMETER_VALUE
title == Seek::ISA::TagType::PARAMETER_VALUE
end

def self.allowed_isa_tags_for_level(level)
tags = case level
when 'study source'
Seek::Isa::TagType::SOURCE_TAGS
Seek::ISA::TagType::SOURCE_TAGS
when 'study sample'
Seek::Isa::TagType::SAMPLE_TAGS
Seek::ISA::TagType::SAMPLE_TAGS
when 'assay - material'
Seek::Isa::TagType::OTHER_MATERIAL_TAGS
Seek::ISA::TagType::OTHER_MATERIAL_TAGS
when 'assay - data file'
Seek::Isa::TagType::DATA_FILE_TAGS
Seek::ISA::TagType::DATA_FILE_TAGS
else
Seek::Isa::TagType::ALL_TYPES
Seek::ISA::TagType::ALL_TYPES
end

tags.map { |tag| IsaTag.find_by(title: tag) }
tags.map { |tag| ISATag.find_by(title: tag) }
end
end
Loading

0 comments on commit 698ad57

Please sign in to comment.