4 ODK/ODK_ONA_get_crosses.pl
9 =head1 COMMAND-LINE OPTIONS
15 Nicolas Morales (nm529@cornell.edu)
24 use CXGN
::ODK
::Crosses
;
26 use Bio
::Chado
::Schema
;
27 use CXGN
::Metadata
::Schema
;
28 use CXGN
::Phenome
::Schema
;
30 our ($opt_u, $opt_i, $opt_r, $opt_a, $opt_d, $opt_n, $opt_m, $opt_o, $opt_f, $opt_l, $opt_c, $opt_q, $opt_y, $opt_D, $opt_U, $opt_p, $opt_H);
32 getopts
('u:i:r:a:d:n:m:o:w:f:l:c:q:y:D:U:p:H:');
34 if (!$opt_u || !$opt_i || !$opt_r || !$opt_a || !$opt_d || !$opt_n || !$opt_m || !$opt_o || !$opt_f || !$opt_l || !$opt_c || !$opt_q || !$opt_y || !$opt_D || !$opt_U || !$opt_p || !$opt_H) {
35 die "Must provide options -u (sp_person_id) -i (sp_person_username )-r (sp_role) -a (archive_path) -d (temp_files_dir) -n (ODK username) -m (ODK password) -o (ODK form_id) -f (odk cross progress tree file dir) -l (ODK URL) -c (allowed cross properties) -q (temp cross wishlist file path for dl from ONA) -y (temp germplasm info file path for dl from ONA) -D (database name) -U (db user) -p (dbpass) -H (dbhost) \n";
38 my $bcs_schema = Bio
::Chado
::Schema
->connect(
39 "dbi:Pg:database=$opt_D;host=$opt_H", # DSN Line
43 my $metadata_schema = CXGN
::Metadata
::Schema
->connect(
44 "dbi:Pg:database=$opt_D;host=$opt_H", # DSN Line
48 my $phenome_schema = CXGN
::Phenome
::Schema
->connect(
49 "dbi:Pg:database=$opt_D;host=$opt_H", # DSN Line
54 my $odk_crosses = CXGN
::ODK
::Crosses
->new({
55 bcs_schema
=>$bcs_schema,
56 metadata_schema
=>$metadata_schema,
57 phenome_schema
=>$phenome_schema,
59 sp_person_username
=>$opt_i,
60 sp_person_role
=>$opt_r,
62 temp_file_dir
=>$opt_d,
63 allowed_cross_properties
=>$opt_c,
64 cross_wishlist_temp_file_path
=>$opt_q,
65 germplasm_info_temp_file_path
=>$opt_y,
66 odk_crossing_data_service_url
=>$opt_l,
67 odk_crossing_data_service_username
=>$opt_n,
68 odk_crossing_data_service_password
=>$opt_m,
69 odk_crossing_data_service_form_id
=>$opt_o,
70 odk_cross_progress_tree_file_dir
=>$opt_f
72 my $result = $odk_crosses->save_ona_cross_info();