From 6eda8d51a97d783640558a104c5bd9ea3868570f Mon Sep 17 00:00:00 2001 From: preecej Date: Wed, 7 Sep 2011 23:01:12 +0000 Subject: [PATCH] paw_...: backed out the max file size option Local...: added GO web service autocomplete reference svn path=/; revision=179 --- .../local_settings/test.LocalSettings.php | 9 ++++- .../semantic_wiki/paw_TransformForImport.pl | 37 +++++++++++++++---- 2 files changed, 38 insertions(+), 8 deletions(-) diff --git a/preecej/semantic_wiki/local_settings/test.LocalSettings.php b/preecej/semantic_wiki/local_settings/test.LocalSettings.php index df51983..5bf519d 100644 --- a/preecej/semantic_wiki/local_settings/test.LocalSettings.php +++ b/preecej/semantic_wiki/local_settings/test.LocalSettings.php @@ -142,7 +142,14 @@ require_once( "$IP/extensions/semantic-bundle/SemanticBundle.php" ); #include("$IP/extensions/SimpleForms/SimpleForms.php"); -$sfgAutocompletionURLs['remote_PO_terms'] = 'http://palea.cgrb.oregonstate.edu/paw/services/TermSearch_JSON.php?user=paw&type=autocomplete&field=name&qval=&format=json&max=20'; +# PO web service calls +$sfgAutocompletionURLs['remote_PO_terms'] = 'http://palea.cgrb.oregonstate.edu/paw/services/TermSearch_JSON.php?user=paw&type=autocomplete&field=name&ontology=po&qval=&format=json&max=20'; +$sfgAutocompletionURLs['remote_PO_ids'] = 'http://palea.cgrb.oregonstate.edu/paw/services/TermSearch_JSON.php?user=paw&type=autocomplete&field=acc&ontology=po&qval=&format=json&max=20'; + +# GO web service calls +$sfgAutocompletionURLs['remote_GO_terms'] = 'http://palea.cgrb.oregonstate.edu/paw/services/TermSearch_JSON.php?user=paw&type=autocomplete&field=name&ontology=go&qval=&format=json&max=25'; +$sfgAutocompletionURLs['remote_GO_ids'] = 'http://palea.cgrb.oregonstate.edu/paw/services/TermSearch_JSON.php?user=paw&type=autocomplete&field=acc&ontology=go&qval=&format=json&max=25'; + $sfgAutocompleteOnAllChars = false; # END: Justin Preece - Semantic Bundle (SMW and other extensions) diff --git a/preecej/semantic_wiki/paw_TransformForImport.pl b/preecej/semantic_wiki/paw_TransformForImport.pl index ef70b33..4f61cd0 100644 --- a/preecej/semantic_wiki/paw_TransformForImport.pl +++ b/preecej/semantic_wiki/paw_TransformForImport.pl @@ -31,8 +31,13 @@ paw_TransformForImport.pl -i INPUT_FILE -t TYPE -o OUTPUT_FILE -v -d (if no path supplied, assumes current working directory) -t Specifies input type of file (allowed values: 'csv', 'tab', 'gaf') - -o Name of output XML file. - (if no path supplied, assumes current working directory) + -o Name/template of output XML file; if no path supplied, assumes + current working directory. The first file will match the + supplied value; consequent files will be numbered in this + format: '-#.suffix' + -s Seed values (comma-delimited) for Source, Annotation, and + Publication IDs (in that order, e.g. '2,38,15'); Defaults to + '1' for all seed values -v View verbose information -d View debugging information @@ -88,6 +93,9 @@ Justin Preece =cut +# TODO: file size check and clip +# TODO: file numbering + # --------------------------------------------------------------------------- # modules # --------------------------------------------------------------------------- @@ -103,6 +111,7 @@ use Data::Dumper; use XML::Smart; use XML::Writer; use IO::File; +use Encode; # --------------------------------------------------------------------------- # declarations @@ -136,8 +145,8 @@ my %annotations; # keyed on Gene Symbol # other config constants (including temporary arrangements) -# page id seeds, until I can figure out how to auto-increment w/in the import -# script +# default page id seeds, until I can figure out how to auto-increment w/in the +# an import/update script my $SOURCE_TITLE_SEED = 1; my $ANNOT_TITLE_SEED = 1; my $PUB_TITLE_SEED = 1; @@ -153,7 +162,7 @@ $Data::Dumper::Pad = "... "; sub init { # read and set options - getopts('i:t:o:vd', \%opts); + getopts('i:t:o:s:vd', \%opts); foreach my $key (keys %opts) { my $value = $opts{$key}; @@ -174,6 +183,17 @@ sub init $output_file = getcwd() . "\/$value"; } } + case "s" { + my @seeds = split(',',$value); + if (scalar @seeds == 3) { + $SOURCE_TITLE_SEED = $seeds[0]; + $ANNOT_TITLE_SEED = $seeds[1]; + $PUB_TITLE_SEED = $seeds[2]; + } else { + die("Please supply three consecutive, comma-delimited seed" + . "values for the 's' option."); + } + } case "v" { $verbose = 1; } case "d" { $debug = 1; } @@ -199,7 +219,10 @@ sub init . "\n" . "Input File: $input_file\n" . "Designated input file type: $file_type\n" - . "Output File: $output_file\n" + . "Output File (Template): $output_file\n" + . "Source ID Seed: $SOURCE_TITLE_SEED\n" + . "Annotations ID Seed: $ANNOT_TITLE_SEED\n" + . "Publications ID Seed: $PUB_TITLE_SEED\n" . "Running in verbose mode? " . ($verbose ? "Yes" : "No") . "\n" . "Running in debug mode? " . ($debug ? "Yes" : "No") . "\n" . "\n" @@ -952,7 +975,7 @@ sub transform_gaf $writer->endTag("Pages"); $writer->end(); - # write doc to file + # write out the file open(OUTPUT_FILE,">$output_file"); print OUTPUT_FILE $output_data; close OUTPUT_FILE; -- 2.34.1