Commit 36d91845 authored by Keith Jolley's avatar Keith Jolley
Browse files

Offline scripts: Add support for view selection.

parent acefb76f
......@@ -93,9 +93,19 @@ sub initiate {
}
}
$self->set_system_overrides;
$self->{'dataConnector'}->initiate( $self->{'system'}, $self->{'config'} );
$self->db_connect;
$self->setup_datastore if $self->{'db'};
if ($self->{'db'}){
$self->setup_datastore ;
if ( defined $self->{'options'}->{'v'} ) {
my $view_exists =
$self->{'datastore'}
->run_query( "SELECT EXISTS(SELECT * FROM information_schema.tables WHERE table_name=?)", $self->{'options'}->{'v'} );
die "Invalid view selected.\n" if !$view_exists;
$self->{'system'}->{'view'} = $self->{'options'}->{'v'};
}
}
return;
}
......
......@@ -62,7 +62,8 @@ GetOptions(
'o|order' => \$opts{'o'},
'q|quiet' => \$opts{'q'},
'r|random' => \$opts{'r'},
'T|already_tagged' => \$opts{'T'}
'T|already_tagged' => \$opts{'T'},
'v|view=s' => \$opts{'v'}
) or die("Error in command line arguments\n");
if ( $opts{'h'} ) {
......@@ -235,6 +236,9 @@ ${bold}--threads$norm ${under}THREADS$norm
${bold}-T, --already_tagged$norm
Scan even when sequence tagged (no designation).
${bold}-v, --view$norm ${under}VIEW$norm
Isolate database view (overrides value set in config.xml).
${bold}-w, --word_size$norm ${under}SIZE$norm
BLASTN word size.
......
......@@ -63,7 +63,8 @@ GetOptions(
'n|new_only' => \$opts{'n'},
'o|order' => \$opts{'o'},
'r|random' => \$opts{'r'},
'T|already_tagged' => \$opts{'T'}
'T|already_tagged' => \$opts{'T'},
'v|view=s' => \$opts{'v'}
) or die("Error in command line arguments\n");
if ( $opts{'h'} ) {
......@@ -235,6 +236,9 @@ ${bold}--threads$norm ${under}THREADS$norm
${bold}-T, --already_tagged$norm
Scan even when sequence tagged (no designation).
${bold}-v, --view$norm ${under}VIEW$norm
Isolate database view (overrides value set in config.xml).
${bold}-w, --word_size$norm ${under}SIZE$norm
BLASTN word size.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment