Sha256: b608ee37ebd97a519f173a29a1b2b52b31c1296d25600033176d9607d051f829

Contents?: true

Size: 659 Bytes

Versions: 43

Compression:

Stored size: 659 Bytes

Contents

require 'snp_db_connection'

class Strain < ActiveRecord::Base
  has_many :alleles, :through => :genotypes
  has_many :genotypes
end

class Feature < ActiveRecord::Base
  has_many :annotations
  has_many :snps
end

class Snp < ActiveRecord::Base
  belongs_to :feature
  has_many  :alleles
  belongs_to :reference_allele, :class_name => "Allele", :foreign_key => "reference_allele_id"
end

class Allele < ActiveRecord::Base
  has_many :genotypes
  belongs_to :snp
  has_many :strains, :through => :genotypes
end

class Genotype < ActiveRecord::Base
  belongs_to :allele
  belongs_to :strain
end

class Annotation < ActiveRecord::Base
  belongs_to :feature
end

Version data entries

43 entries across 31 versions & 1 rubygems

Version Path
snp-search-2.2.0 lib/snp_db_models.rb
snp-search-2.0.0 lib/snp_db_models.rb
snp-search-1.0.0 lib/snp_db_models.rb
snp-search-0.34.0 examples/snp_db_models.rb
snp-search-0.34.0 lib/snp_db_models.rb
snp-search-0.33.0 lib/snp_db_models.rb
snp-search-0.33.0 examples/snp_db_models.rb
snp-search-0.32.0 examples/snp_db_models.rb
snp-search-0.32.0 lib/snp_db_models.rb
snp-search-0.31.0 examples/snp_db_models.rb
snp-search-0.31.0 lib/snp_db_models.rb
snp-search-0.30.0 examples/snp_db_models.rb
snp-search-0.30.0 lib/snp_db_models.rb
snp-search-0.29.0 lib/snp_db_models.rb
snp-search-0.29.0 examples/snp_db_models.rb
snp-search-0.27.2 examples/snp_db_models.rb
snp-search-0.27.2 lib/snp_db_models.rb
snp-search-0.27.1 lib/snp_db_models.rb
snp-search-0.27.1 examples/snp_db_models.rb
snp-search-0.27.0 lib/snp_db_models.rb