Permalink
Browse files

Parameter export to Settings module should be complete

  • Loading branch information...
gjospin committed Jul 6, 2012
1 parent 34179b6 commit 42dacb50a9aa4a301701fa0227f6a62fa3f59da5
Showing with 38 additions and 29 deletions.
  1. +35 −27 bin/phylosift
  2. +3 −2 lib/Phylosift/FastSearch.pm
View
@@ -102,39 +102,47 @@ Options Available at this time :
~;
+# set default values
+Phylosift::Settings::set_default(parameter=>\$Phylosift::Settings::threads, value=> 1);
+Phylosift::Settings::set_default(parameter=>\$Phylosift::Settings::updated, value=> 1);
+
my $ps = new Phylosift::Phylosift();
+for(my $i=0;$i<scalar(@ARGV);$i++){
+ if($ARGV[$i] eq "--config"){
+ if(!-e $ARGV[$i+1]){
+ croak "Cannot read custom configuration file.\n Aborting\n";
+ }else{
+ $Phylosift::Settings::custom = $ARGV[$i+1];
+ }
+ }
+}
-# set default values
-$ps->{"threads"} = 1;
-$ps->{"updated"} = 1;
my @args = @ARGV;
$ps->{"ARGV"}=\@args; # copy unmodified ARGV here.
GetOptions(
- "output=s" => \$Phylosift::Settings::file_dir, #\$ps->{"fileDir"}, # directory for output
- "paired" => \$Phylosift::Settings::paired, #\$ps->{"paired"}, # used for paired fastQ input split in 2 different files OR interleaved
- "custom=s" => \$Phylosift::Settings::custom, #\$custom, #need a file containing the marker names to use without extensions ** marker names shouldn't contain '_'
- "f" => \$Phylosift::Settings::force, #\$force, #overrides a previous run otherwise stop
- "continue" => \$Phylosift::Settings::continue, #\$continue, #when a mode different than all is used, continue the rest of Phylosift after the section specified by the mode is finished
- "threaded=i" => \$Phylosift::Settings::threads, #\$ps->{"threads"},
- "simple" => \$Phylosift::Settings::simple, #\$ps->{"simple"}, # generate only a simple text taxonomic summary, no krona, no taxon names in jplace
- "isolate" => \$Phylosift::Settings::isolate, #\$ps->{"isolate"}, #use when processing one or more isolate genomes
- #"reverse" => \$Phylosift::Settings::reverse_translate, #\$ps->{"reverseTranslate"}, #use to output the reverse translation of the AA alignments
- "besthit" => \$Phylosift::Settings::besthit, #\$ps->{"besthit"}, #should we keep only the best hit when there are multiple?
- "coverage=s" => \$Phylosift::Settings::coverage, #\$ps->{"coverage"}, #provides a contig/scaffold coverage file
- "updated_markers=i" => \$Phylosift::Settings::updated, #\$ps->{"updated"}, #Indicates if Phylosift uses the updated versions of the Markers.
- "marker_url=s" => \$Phylosift::Settings::marker_url, #\$ps->{"marker_url"}, # an alternate address to retrieve markers from
- "extended" => \$Phylosift::Settings::extended, #\$ps->{"extended"}, #Should the full extended set of markers be used?
- "config=s" => \$Phylosift::Settings::configuration, #\$ps->{"configuration"}, #custom config file
- "remove_dup" => \$Phylosift::Settings::remove_dup, #\$ps->{"remove_dup"}, #removes duplicate taxons when using build_marker
- "keep_search" => \$Phylosift::Settings::keep_search, #\$ps->{"keep_search"}, #prevents the files from the bastDir from being deleted after each chunk has completed
- "disable_updates" => \$Phylosift::Settings::disable_update_check, #\$ps->{"disable_update_check"}, # don't check for or download marker updates
- "start_chunk=i" => \$Phylosift::Settings::start_chunk, #\$ps->{"start_chunk"}, #sets the chunk to start with
- "chunks=i" => \$Phylosift::Settings::chunks, #\$ps->{"chunks"}, #sets the number of chunks to be run
- #"chunk_size=i" => \$Phylosift::Settings::chunk_size, #\$ps->{"chunk_size"}, #sets the number of sequences to run per chunk
- "h" => \$Phylosift::Settings::help, #\$help, #prints the usage part of the README file
- "help" => \$Phylosift::Settings::help, #\$help, #same as -h
- "debug" => \$Phylosift::Settings::my_debug, #\$my_debug, #print debugging messages?
+ "output=s" => \$Phylosift::Settings::file_dir, # directory for output
+ "paired" => \$Phylosift::Settings::paired, # used for paired fastQ input split in 2 different files OR interleaved
+ "custom=s" => \$Phylosift::Settings::custom, #need a file containing the marker names to use without extensions ** marker names shouldn't contain '_'
+ "f" => \$Phylosift::Settings::force, #overrides a previous run otherwise stop
+ "continue" => \$Phylosift::Settings::continue, #when a mode different than all is used, continue the rest of Phylosift after the section specified by the mode is finished
+ "threaded=i" => \$Phylosift::Settings::threads,
+ "simple" => \$Phylosift::Settings::simple, # generate only a simple text taxonomic summary, no krona, no taxon names in jplace
+ "isolate" => \$Phylosift::Settings::isolate, #use when processing one or more isolate genomes
+ "besthit" => \$Phylosift::Settings::besthit, #should we keep only the best hit when there are multiple?
+ "coverage=s" => \$Phylosift::Settings::coverage, #provides a contig/scaffold coverage file
+ "updated_markers=i" => \$Phylosift::Settings::updated, #Indicates if Phylosift uses the updated versions of the Markers.
+ "marker_url=s" => \$Phylosift::Settings::marker_url, # an alternate address to retrieve markers from
+ "extended" => \$Phylosift::Settings::extended, #Should the full extended set of markers be used?
+ "config=s" => \$Phylosift::Settings::configuration, #custom config file
+ "remove_dup" => \$Phylosift::Settings::remove_dup, #removes duplicate taxons when using build_marker
+ "keep_search" => \$Phylosift::Settings::keep_search, #prevents the files from the bastDir from being deleted after each chunk has completed
+ "disable_updates" => \$Phylosift::Settings::disable_update_check, # don't check for or download marker updates
+ "start_chunk=i" => \$Phylosift::Settings::start_chunk, #sets the chunk to start with
+ "chunks=i" => \$Phylosift::Settings::chunks, #sets the number of chunks to be run
+ "h" => \$Phylosift::Settings::help, #prints the usage part of the README file
+ "help" => \$Phylosift::Settings::help, #same as -h
+ "debug" => \$Phylosift::Settings::my_debug, #print debugging messages?
) || die $usage;
if ( $Phylosift::Settings::help != 0 ) {
print $usage. "\n";
@@ -157,8 +157,9 @@ sub run_search {
sub set_default_values{
my %args = @_;
my $self = $args{self};
- Phylosift::Settings::set_default(parameter=>\$Phylosift::Settings::CHUNK_MAX_SEQS,value=>20000); #small chunks if doing extended markers
- Phylosift::Settings::set_default(parameter=>\$Phylosift::Settings::CHUNK_MAX_SEQS,value=>1000000, force=>1) unless $Phylosift::Settings::extended;
+ my $default_chunk_size = 200000;
+ $default_chunk_size = 1000000 if $Phylosift::Settings::extended;
+ Phylosift::Settings::set_default(parameter=>\$Phylosift::Settings::CHUNK_MAX_SEQS,value=>$default_chunk_size);
Phylosift::Settings::set_default(parameter=>\$Phylosift::Settings::CHUNK_MAX_SIZE,value=>10000000);
Phylosift::Settings::set_default(parameter=>\$Phylosift::Settings::lastal_evalue,value=>"-e75");
Phylosift::Settings::set_default(parameter=>\$Phylosift::Settings::lastal_rna_evalue,value=>"-e300");

0 comments on commit 42dacb5

Please sign in to comment.