Skip to content

Commit

Permalink
Add demo rake task for populating PhenotypeSnp table
Browse files Browse the repository at this point in the history
Signed-off-by: Vivek Rai <vivekrai.iitkgp@gmail.com>
  • Loading branch information
raivivek committed Jun 20, 2016
1 parent 7dfedd2 commit ac69b84
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/tasks/phenotype_snp.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace :custom do
desc 'Adding custom data to Phenotype SNP table'
task :snp_link => :environment do
@snps = Snp.find_by_name('rs4475691')
@phenotype = Phenotype.create :characteristic => 'Brown'
PhenotypeSnp.create :snp => @snps, :phenotype => @phenotype, :score => 5

@snps = Snp.find_by_name('rs3890745')
@phenotype = Phenotype.create :characteristic => 'Arthritis'
PhenotypeSnp.create :snp => @snps, :phenotype => @phenotype, :score => 7

@snps = Snp.find_by_name('rs2651899')
@phenotype = Phenotype.create :characteristic => 'Migrain'
PhenotypeSnp.create :snp => @snps, :phenotype => @phenotype, :score => 6
end
end

0 comments on commit ac69b84

Please sign in to comment.