Class: SequenceRelationship

Inherits:
ApplicationRecord show all
Includes:
Housekeeping, Shared::Identifiable, Shared::IsData, Shared::Notable, Shared::Taggable
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.

Direct Known Subclasses

BlastQuerySequence, ForwardPrimer, ReferenceSequenceForAssembly, ReversePrimer

Defined Under Namespace

Classes: BlastQuerySequence, ForwardPrimer, ReferenceSequenceForAssembly, ReversePrimer

Instance Attribute Summary (collapse)

Method Summary

Methods included from Housekeeping

#has_polymorphic_relationship?

Methods included from ActiverecordUtilities

#trim_attributes

Instance Attribute Details

- (Integer) object_sequence_id

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::Identifiable
  include Shared::IsData
  include Shared::Notable
  include Shared::Taggable

  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

- (Integer) subject_sequence_id

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::Identifiable
  include Shared::IsData
  include Shared::Notable
  include Shared::Taggable

  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