Skip to content
Snippets Groups Projects
Commit 47cbf801 authored by Veronique Legrand's avatar Veronique Legrand
Browse files

improved lambda computation with option -n

parent 56f31593
No related branches found
No related tags found
No related merge requests found
......@@ -139,9 +139,12 @@ int processInOutFileArgs(const std::string& input_file,const std::string output_
* We want p<=0.01,
* so choose smallest lambda so that [1-(1-1/m)exp n] exp lambda<=0.01
*/
int getBestLambdaForN(const unsigned long& nb_k_mers,const int& lambda_max) {
int getBestLambdaForN(const unsigned long& nb_k_mers,int lambda_max) {
int lambda=2;
int min_lambda=lambda;
if (lambda_max==0) { // no upper bound specified by the user via the -g option
lambda_max=500;
}
long double tmp=1.0/INT_MAX;
tmp=1.0-tmp;
tmp=pow(tmp,nb_k_mers);
......
......@@ -16,7 +16,7 @@
unsigned long getNodePhysMemory();
int processInOutFileArgs(const std::string& input_file,const std::string output_file,std::vector<IO_fq_files>& single_files,std::vector<PE_files>& v_PE_files,int& f_id);
int getBestLambdaForN(const unsigned long& nb_k_mers,const int& lambda_max);
int getBestLambdaForN(const unsigned long& nb_k_mers,int lambda_max);
float getCollisionProba(const unsigned long& nb_k_mers,const int& lambda);
......
......@@ -63,7 +63,7 @@ static void usage(int status) {
cout<<" -C <kappa> .... Specify upper threshold for coverage. Default is 50. Max is 65535."<<endl;
cout<<" -l <lambda> .... Indicate number of arrays wanted in the CMS. Default is biggest l so that l<B/(b*MAX_INT) where b is 1 or 2 depending on kappa and B is the RAM quantity on the machine."<<endl;
cout<<" -n <nb_distinct_k_mer> .... Indicate the number of distinct k-mer. Useful to compute lambda if not specified with -l."<<endl;
cout<<" -g <CMS size in GB> .... Wanted size for the CMS."<<endl;
cout<<" -g <CMS size in GB> .... Wanted size for the CMS."<<endl;
exit(status); }
......@@ -94,7 +94,7 @@ void optArgConsistency(const string& input_file,const string& output_file,const
cout<<"-l and -g options are mutually exclusive."<<endl;
usage(EXIT_FAILURE);
}
if (nb_k_mers!=0 and parms.lambda!=0) {// user set both lambda and cms size=> inconsistency.
if (nb_k_mers!=0 and parms.lambda!=0) {// user set both lambda and number of k-mers=> inconsistency.
cout<<"-l and -n options are mutually exclusive."<<endl;
usage(EXIT_FAILURE);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment