From 80238bc63d407a908edc474a5c2ec363dcb666c2 Mon Sep 17 00:00:00 2001 From: Naama Menda Date: Sun, 6 Nov 2011 01:26:59 -0400 Subject: [PATCH] adding phenotype props to solcap phenotypes --- bin/loading_scripts/solcap/load_solcap_TA_phenotypes.pl | 8 ++++++++ bin/loading_scripts/solcap/load_solcap_data_entry.pl | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/bin/loading_scripts/solcap/load_solcap_TA_phenotypes.pl b/bin/loading_scripts/solcap/load_solcap_TA_phenotypes.pl index 3ede8fe..528211c 100644 --- a/bin/loading_scripts/solcap/load_solcap_TA_phenotypes.pl +++ b/bin/loading_scripts/solcap/load_solcap_TA_phenotypes.pl @@ -58,6 +58,10 @@ getopts('H:i:tD:l:y:'); my $dbhost = $opt_H; my $dbname = $opt_D; my $file = $opt_i; +my $method; +$method = 'Fruit color' if $file =~ m/color/; +$method = 'Fruit longitudinal section' if $file =~ m/long/; +$method = 'Fruit cross section' if $file =~ m/lat/; my $dbh = CXGN::DB::InsertDBH->new( { dbhost=>$dbhost, dbname=>$dbname, @@ -228,6 +232,10 @@ my $coderef = sub { cvterm_id => $unit_cvterm->cvterm_id() } ) ; print "*Loaded phenotype_cvterm with unit '" . $unit_cvterm->name() . "'\n"; } + #store the appropriate method phenotypeprop + $phenotype->create_phenotypeprops( + { method => $method } , { autocreate => 1 } ) if $method; + #### #check if the phenotype is already associated with an experiment # which means this loading script has been run before . if ( $phenotype->find_related("nd_experiment_phenotypes", {} ) ) { diff --git a/bin/loading_scripts/solcap/load_solcap_data_entry.pl b/bin/loading_scripts/solcap/load_solcap_data_entry.pl index 7aad160..68282fa 100644 --- a/bin/loading_scripts/solcap/load_solcap_data_entry.pl +++ b/bin/loading_scripts/solcap/load_solcap_data_entry.pl @@ -282,6 +282,13 @@ my $coderef = sub { value => $value , uniquename => "Stock: " . $stock->stock_id . ", Replicate: $rep, plot: $plot," . ", Term: " . $sp_term->name() . ", parent: $term", }); + #add phenotype prop for quality terms (yield, brix, ph, acids) + if ($label =~ m/SP:0000198|SP:0000165|SP:0000170|SP:0000345/) { + my $method = 'quality'; + ##not sure if this should be phenotypeprop + $phenotype->create_phenotypeprops( + { method => $method } , { autocreate => 1 } ) ; + } #for qualitative traits, store the value also in phenotyep_cvterm if ($child_term) { $phenotype->find_or_create_related( -- 2.11.4.GIT