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_t, $opt_n, $opt_m, $opt_o, $opt_w, $opt_x, $opt_f, $opt_l, $opt_c, $opt_D, $opt_U, $opt_p, $opt_H);
32 getopts
('u:i:r:a:d:t:n:m:o:w:x:f:c:D:U:p:H:');
34 if (!$opt_u || !$opt_i || !$opt_r || !$opt_a || !$opt_d ||!$opt_t || !$opt_n || !$opt_m || !$opt_o || !$opt_w || !$opt_f || !$opt_l || !$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) -t (temp_file_path) -n (ODK username) -m (ODK password) -o (ODK form_id) -w (cross wishlist md_file_id) -x (cross_wishlist_file_name) -f (odk cross progress tree file dir) -l (ODK URL) -c (allowed cross properties) -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 temp_file_path
=>$opt_t,
64 allowed_cross_properties
=>$opt_c,
65 cross_wishlist_md_file_id
=>$opt_w,
66 cross_wishlist_file_name
=>$opt_x,
67 odk_crossing_data_service_url
=>$opt_l,
68 odk_crossing_data_service_username
=>$opt_n,
69 odk_crossing_data_service_password
=>$opt_m,
70 odk_crossing_data_service_form_id
=>$opt_o,
71 odk_cross_progress_tree_file_dir
=>$opt_f
73 my $result = $odk_crosses->save_ona_cross_info();