--results directory to store results in
--database databases to search
--restart-at mode to start searching at
+ --invalidate-state state to invalidate
--debug, -d debugging level (Default 0)
--help, -h display this help
--man, -m display manual
=item B<--restart-at>
If you need to restart the process at a particular state (which has
-already been completed) specify this option.
+already been completed) specify this option. Valid values are get,
+parse, or combine.
+
+=item B<--invalidate-state>
+
+This is a more powerful version of --restart-at, which can
+specifically invalidate a certain method,database,keyword combination.
+
+For example, you can request that the keyword foo be retreived again
+from ncbi using --invalidate-state 'get,ncbi,foo'
=item B<--debug, -d>
echo 'transferrin' > keywords.txt
function2gene --keywords keywords.txt --results keyword_results
+ # reparse the results
+ function2gene --keywords keywords.txt --results keyword_results \
+ --restart-at parse
+
=cut
help => 0,
man => 0,
results => '',
+ invalidate_state => [],
);
GetOptions(\%options,'keywords=s@','databases=s@',
'restart_at|restart-at=s','results=s',
+ 'invalidate_state|invalidate-state=s@',
'debug|d+','help|h|?','man|m');
pod2usage() if $options{help};
}
}
+if (exists $options{invalidate_state}) {
+ for my $invalidate_state (@{$options{invalidate_state}}) {
+ my ($method,$database,$keyword) = split /,/, $invalidate_state;
+ if (not exists $state{done_keywords}{$method}) {
+ print STDERR "Method '$method' does not exist, and cannot be invalidated\n";
+ }
+ elsif (not exists $state{done_keywords}{$method}{$database}) {
+ print STDERR "Database '$database' does not exist for method '$method', and cannot be invalidated\n";
+ }
+ elsif (not exists $state{done_keywords}{$method}{$database}{$keyword}) {
+ print STDERR "Keyword '$keyword' does not exist for database '$database' and method '$method', and cannot be invalidated\n";
+ }
+ else {
+ delete $state{done_keywords}{$method}{$database}{$keyword};
+ }
+ }
+}
+
# now we need to figure out what has to happen
# for each keyword, we check to see if we've got results, parsed
# results, and combined it. If not, we queue up those actions.
$state{done_keywords}{combined}{$db}{$keyword} = 1;
}
save_state(\%state);
- ADVISE("Finished; results in $options{results}/combined_results");
+ write_command_to_file('combined_results_table.txt',
+ "$base_dir/results_to_table",
+ 'combined_results.txt',
+ );
+ ADVISE("Finished; results in $options{results}/combined_results.txt");
}
else {
ADVISE('Nothing to do. [Perhaps you wanted --restart-at?]');