diff --git a/src/rock.cpp b/src/rock.cpp index 5dae10f3266a11a0c27879ae0c00bcfbd09d98f8..1b31882ac25c28c779d61a415af774c00439041c 100755 --- a/src/rock.cpp +++ b/src/rock.cpp @@ -13,6 +13,7 @@ #include <string.h> #include <iostream> +#include <iomanip> #include <map> #include <vector> #include <unistd.h> @@ -58,50 +59,59 @@ void printCMSparams(const CMSparams& p) { cout<<"lambda="<<p.lambda<<endl; cout<<"kappa="<<p.kappa<<endl; cout<<"kappa_prime="<<p.kappa_prime<<endl; - cout<<"filter_size="<<p.filter_size<<endl; + cout<<"filter_size="<<p.max_filter_size<<endl; cout<<"filter_PE_separately="<<p.filter_PE_separately<<endl; } const void printVerboseInfo(const ROCKparams& Rparms,const Filter& filter,const T_read_counters& rc,\ const unsigned long& tot_nb_kmers) { + cout<<setw(40)<<left<<"total available RAM (Gb)"<<getNodePhysMemory()<<endl; std::vector<IO_fq_files>::iterator it_s; vector<PE_files>::iterator it_pe; vector<PE_files> v_PE_files=Rparms.get_PE_files(); vector<IO_fq_files> single_files=Rparms.get_single_files(); - for (it_pe=v_PE_files.begin();it_pe!=v_PE_files.end();it_pe++) { - cout<<"PE input files "<<it_pe->PE1.in_fq_file<<" "<<it_pe->PE2.in_fq_file<<endl; + cout<<setw(40)<<left<<"PE input files"<<it_pe->PE1.in_fq_file<<" "<<it_pe->PE2.in_fq_file<<endl; } for (it_s=single_files.begin();it_s!=single_files.end();it_s++) { - cout<<"SE input file(s) "<<it_s->in_fq_file<<endl; + cout<<setw(40)<<left<<"SE input file(s)"<<it_s->in_fq_file<<endl; } CMSparams parms=Rparms.getCMSparams(); - cout<<"upper-bound coverage depth "<<parms.kappa<<endl; - cout<<"lower-bound coverage depth "<<parms.kappa_prime<<endl; - cout<<"k-mer length "<<Rparms.get_k()<<endl; - cout<<"expected no. distinct k-mers "<<Rparms.get_expected_nbKmers()<<endl; - cout<<"no. hash. function(s) "<<parms.lambda<<endl; - - cout<<"expected false positive proba. "<<Rparms.get_expected_collision_proba() <<"(cov. depth > 1)"<<endl; - for (int i=0;i<parms.lambda;i++) cout<<"no. buckets for hash. "<<i+1<<" "<<Pi_js[i]<<endl; - cout<<"no. bits per bucket "<<filter.getNbBitsForCounters()<<endl; - cout<<"count-min sketch size (Gb) "<<Rparms.getFilterSize()<<endl; - cout<<"no. input reads "<<rc.nb_input_reads<<endl; - cout<<"no. input k-mers"<<tot_nb_kmers<<endl; + cout<<setw(40)<<left<<"upper-bound coverage depth"<<parms.kappa<<endl; + cout<<setw(40)<<left<<"lower-bound coverage depth"<<parms.kappa_prime<<endl; + cout<<setw(40)<<left<<"k-mer length"<<Rparms.get_k()<<endl; + cout<<setw(40)<<left<<"expected no. distinct k-mers"<<Rparms.get_expected_nbKmers()<<endl; + cout<<setw(40)<<left<<"no. hash. function(s)"<<parms.lambda<<endl; + + cout<<setw(40)<<left<<"expected false positive proba."<<Rparms.get_expected_collision_proba()<<" (cov. depth > 1)"<<endl; + + for (int i=0;i<parms.lambda;i++) { + string tmp="no. buckets for hash. "; + tmp+=to_string(i+1); + cout<<setw(40)<<left<<tmp<<Pi_js[i]<<endl; + } + cout<<setw(40)<<left<<"no. bits per bucket"<<filter.getNbBitsForCounters()<<endl; + cout<<setw(40)<<left<<"count-min sketch size (Gb)"<<Rparms.getFilterSize()<<endl; + cout<<setw(40)<<left<<"no. input reads"<<rc.nb_input_reads<<endl; + cout<<setw(40)<<left<<"no. input k-mers"<<tot_nb_kmers<<endl; unsigned long approx_nbDiffKm=filter.getApproxNbDistinctKMers(); std::vector<unsigned long> zeroes=filter.getUnsetBuckets(); - for (int i=0;i<=parms.lambda-1;i++) cout<<"no. unset buckets for hash. "<<i+1<<zeroes[parms.lambda-1-i]<<endl; - cout<<"approx. no. distinct k-mers "<<approx_nbDiffKm<<endl; + for (int i=0;i<=parms.lambda-1;i++){ + string tmp="no. unset buckets for hash. "; + tmp+=to_string(i+1); + cout<<setw(40)<<left<<tmp<<zeroes[parms.lambda-1-i]<<endl; + } + cout<<setw(40)<<left<<"approx. no. distinct k-mers"<<approx_nbDiffKm<<endl; int smallest_kappa=parms.kappa; if (parms.kappa_prime>0) smallest_kappa=parms.kappa_prime; float p =getCollisionProba(smallest_kappa,approx_nbDiffKm,Pi_js[0],parms.lambda); - cout<<"approx. false positive proba. "<<p<<endl; - cout<<"no. selected reads "<<rc.nb_output_reads<<endl; + cout<<setw(40)<<left<<"approx. false positive proba."<<p<<endl; + cout<<setw(40)<<left<<"no. selected reads"<<rc.nb_output_reads<<endl; for (it_pe=v_PE_files.begin();it_pe!=v_PE_files.end();it_pe++) { - cout<<"PE output files "<<it_pe->PE1.out_fq_file<<" "<<it_pe->PE2.out_fq_file<<" "<<it_pe->PE1.undef_fq_file<<" "<<it_pe->PE2.undef_fq_file<<endl; + cout<<setw(40)<<left<<"PE output files"<<it_pe->PE1.out_fq_file<<" "<<it_pe->PE2.out_fq_file<<" "<<it_pe->PE1.undef_fq_file<<" "<<it_pe->PE2.undef_fq_file<<endl; } for (it_s=single_files.begin();it_s!=single_files.end();it_s++) { - cout<<"SE output file(s) "<<it_s->out_fq_file<<" "<<it_s->undef_fq_file<<endl; + cout<<setw(40)<<left<<"SE output file(s)"<<it_s->out_fq_file<<" "<<it_s->undef_fq_file<<endl; } }