Class: SequenceRelationship

Inherits:
ApplicationRecord show all
Includes:
Housekeeping, Shared::Identifiers, Shared::IsData, Shared::Notes, Shared::Tags
Defined in:
app/models/sequence_relationship.rb

Overview

A SequenceRelationship relates to strings of DNA/RNA/AA to one other in the form:

#subject is_a #type of #object 
subject ForwardPrimer of object

In this case the subject is the primer, then object is the sequence using that primer.

Also use for deriving sequences from queries, etc.

Defined Under Namespace

Classes: BlastQuerySequence, ForwardPrimer, ReferenceSequenceForAssembly, ReversePrimer

Instance Attribute Summary collapse

Method Summary

Methods included from Shared::IsData

#errors_excepting, #full_error_messages_excepting, #identical, #is_community?, #is_destroyable?, #is_editable?, #is_in_use?, #is_in_users_projects?, #metamorphosize, #similar

Methods included from Shared::Tags

#reject_tags, #tag_with, #tagged?, #tagged_with?

Methods included from Shared::Notes

#concatenated_notes_string, #reject_notes

Methods included from Shared::Identifiers

#dwc_occurrence_id, #identified?, #next_by_identifier, #previous_by_identifier, #reject_identifiers, #uri, #uuid

Methods included from Housekeeping

#has_polymorphic_relationship?

Methods inherited from ApplicationRecord

transaction_with_retry

Instance Attribute Details

#object_sequence_idInteger

Returns the subject sequence.

Returns:

  • (Integer)

    the subject sequence



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'app/models/sequence_relationship.rb', line 16

class SequenceRelationship < ApplicationRecord
  include Housekeeping

  # not sure we need these 3:
  # include Shared::Protocol
  # include Shared::Confidence
  # include Shared::Documentation
  include Shared::Identifiers
  include Shared::Notes
  include Shared::Tags
  include Shared::IsData

  belongs_to :subject_sequence, class_name: 'Sequence', inverse_of: :sequence_relationships
  belongs_to :object_sequence, class_name: 'Sequence', inverse_of: :related_sequence_relationships

  validates_presence_of :subject_sequence
  validates_presence_of :object_sequence
  validates_presence_of :type

end

#subject_sequence_idInteger

Returns the subject sequence.

Returns:

  • (Integer)

    the subject sequence



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'app/models/sequence_relationship.rb', line 16

class SequenceRelationship < ApplicationRecord
  include Housekeeping

  # not sure we need these 3:
  # include Shared::Protocol
  # include Shared::Confidence
  # include Shared::Documentation
  include Shared::Identifiers
  include Shared::Notes
  include Shared::Tags
  include Shared::IsData

  belongs_to :subject_sequence, class_name: 'Sequence', inverse_of: :sequence_relationships
  belongs_to :object_sequence, class_name: 'Sequence', inverse_of: :related_sequence_relationships

  validates_presence_of :subject_sequence
  validates_presence_of :object_sequence
  validates_presence_of :type

end