Created
July 2, 2010 01:02
-
-
Save rtirrell/460771 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "dm-core" | |
require "dm-types" | |
require "noorm" | |
module NOORM | |
class Disease | |
property :concept_id, String, :key => true | |
property :name, String | |
end | |
class SubsetComparison | |
has n, :genes, "Gene", :repository => repository(:user_rpt) | |
has n, :rankdiffs, "Rankdiff", :repository => repository(:user_rpt) | |
has n, :comparison_correlations, "ComparisonCorrelation", :repository => repository(:user_rpt) | |
end | |
class Experiment | |
has n, :subset_comparisons | |
end | |
class Tissue < Base | |
has n, :cui_analyses, "CUIAnalysis", :child_key => [:cui], | |
:parent_key => [:concept_id], :repository => repository(:user_rpt) | |
end | |
end | |
module ORM | |
module Correlation | |
def self.included(model) | |
model.class_eval do | |
include DataMapper::Resource | |
def self.default_repository_name; :user_rpt; end | |
property :correlation, Float | |
property :p_value, Float | |
property :adjusted_p_value, DataMapper::Property::Decimal, :precision => 50 | |
property :permutation_p_value, Float | |
property :method, DataMapper::Property::Enum[:pearson, :spearman], :key => true | |
property :length, Integer | |
end | |
end | |
end | |
class ComparisonCorrelation | |
include Correlation | |
#storage_names[:user_rpt] = :comparison_correlations | |
# belongs_to :subset_comparison, "SubsetComparison", :parent_key => [:id], :key => true, | |
# :repository => repository(:nosology) | |
def disease_name | |
subset_comparison.disease.name | |
end | |
def disease_concept_id | |
subset_comparison.disease_concept_id | |
end | |
end | |
end | |
/home/rpt/.gem/ruby/1.8/gems/dm-core-1.0.0/lib/dm-core/associations/relationship.rb:173:in `target_model':NameError: Cannot find the child_model ComparisonCorrelation for NOORM::SubsetComparison in comparison_correlations |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment