diff --git a/configure.ac b/configure.ac
index a0afaccd530786cf8b19e1079d051cc755b254fc..9c00933d9de0274bab9283d6fd1e85ce3c94d2b3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
 dnl Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.59)
-AC_INIT(rock, 1.7)
+AC_INIT(rock, 1.8)
 
 
 AC_CANONICAL_SYSTEM
diff --git a/doc/rock.pod b/doc/rock.pod
index 6154e68a3dbf45cc6841007dfd648e06771d362a..3e5c84305ca754fa4da48c931881699b44551ee7 100644
--- a/doc/rock.pod
+++ b/doc/rock.pod
@@ -11,7 +11,7 @@
 
 =over 4
 
-=item B<rock> [B<-h>] [B<-i> F<file>] [B<-o> F<file>] [B<-k> F<k_mer_size>] [B<-p>] [B<-q> F<nucl_qual_score_threshold>] [B<-C> F<kappa>] [B<-c> F<kappa_prime>] [B<-l> F<lambda>] [B<-n> F<nb_distinct_k_mer>] [B<-m> F<min_valid_k_mer_per_read>] [B<-g> F<CMS size in GB>] [Args]
+=item B<rock> [B<-h>] [B<-i> F<file>] [B<-o> F<file>] [B<-k> F<k_mer_size>] [B<-p> F<filter_PE_mode>] [B<-q> F<nucl_qual_score_threshold>] [B<-C> F<kappa>] [B<-c> F<kappa_prime>] [B<-l> F<lambda>] [B<-n> F<nb_distinct_k_mer>] [B<-m> F<min_valid_k_mer_per_read>] [B<-g> F<CMS size in GB>] [Args]
 
 =back
 
@@ -47,13 +47,17 @@ Default is 10.
 To be used together with -q.
 Specify minimum number of correct k-mers required to keep a read for CMS filter.
 Indicate only a integer in version 1.4 and later.
-By default, PE reads are processed independantly (ie kept in the CMS if at least PE1 or PE2 has coverage<=C and>=c.
+By default, PE reads are processed independantly (ie kept in the CMS if at least PE1 or PE2 has coverage<=C and >=c).
 As -m defaults to 1,it means that as there is at least 1 valid k-mer in each part of the PE it is kept.
 
 =item -p
 
-Use this option to indicate ROCK that you want the CMS to handle pair end reads as single. Behavior is then to concatenate the 2 ends of the PE (once their k-mers are converted into number) and process them as a single read.
-No argument.
+Use this option to tell ROCK how you want the paired end reads to be processed.
+Argument can take value 0,1 or 2.
+0 means that PE are processed as single.
+1 means that PE are processed separately and that the read will be removed by the low filter if both parts of it have a median coverage below the given threshold (strict filter).
+2 means that PE are processed separately and that the read will be removed by the low filter if one part of it has a median coverage below the given threshold (lenient filter).
+Default value is 1.
 
 
 =item -C
diff --git a/src/CountMinSketch.hpp b/src/CountMinSketch.hpp
index f2a0ab37c6812a3973b4d172a68c31f404ad8c5f..3d82b0b0d88696eb4e92d97306a5fba71d97870e 100644
--- a/src/CountMinSketch.hpp
+++ b/src/CountMinSketch.hpp
@@ -76,8 +76,9 @@ typedef struct {
     int kappa;
     int kappa_prime;
     int filter_size; // max amount of RAM wanted for the CMS.
-    int filter_PE_as_single; // indicates whether PE reads must be treated as single by the cms. Indeed it may appear that 1 end contains useful k-mer but that other end contains k-mer such that "global" median is below threshold>
+    int filter_PE_separately; // indicates whether PE reads must be treated as single by the cms. Indeed it may appear that 1 end contains useful k-mer but that other end contains k-mer such that "global" median is below threshold.
                              // In this case, read is rejected by the CMS (default behavior). We want to do an experimentation to see if keeping such reads wold lead to better results in assembling.
+                                // Values can be 0 (process PE as single),1 (process PE separately with strict implementation for kappa_prime) or 2 (process PE separately with lenient implementation for kappa prime).
 } CMSparams;
 
 template <typename T>
@@ -106,7 +107,7 @@ private:
     int lambda;
     int kappa;
     int kappa_prime;
-    int filter_PE_as_single;
+    int filter_PE_separately;
 
     T ** cms_lambda_array;
     T mask;
@@ -140,7 +141,7 @@ private:
 
     inline int isRCovBelowThresPartial(const readNumericValues& read_val, const int& threshold, const int& start=0,const int& stop=0);
 
-    void init(int glambda,int gkappa,int gkappa_prime,int filter_PE_as_single=1);
+    void init(int glambda,int gkappa,int gkappa_prime,int filter_PE_separately=1);
 
     // for unit tests.
     friend void test_CMS(int lambda,int kappa,int kappa_prime);
@@ -148,12 +149,12 @@ private:
 
 public:
 
-    CountMinSketch(int glambda,int gkappa,int gkappa_prime,int filter_PE_as_single=1) {
-        init(glambda,gkappa,gkappa_prime,filter_PE_as_single);
+    CountMinSketch(int glambda,int gkappa,int gkappa_prime,int filter_PE_separately=0) {
+        init(glambda,gkappa,gkappa_prime,filter_PE_separately);
     }
 
     CountMinSketch(CMSparams parms) {
-        init(parms.lambda,parms.kappa,parms.kappa_prime,parms.filter_PE_as_single);
+        init(parms.lambda,parms.kappa,parms.kappa_prime,parms.filter_PE_separately);
     }
 
     ~CountMinSketch() {
@@ -187,7 +188,7 @@ public:
     unsigned long getNbDistinctKMers();
 
     int arePEFilteredAsSingle() {
-        return filter_PE_as_single;
+        return !filter_PE_separately;
     }
 };
 
@@ -219,7 +220,6 @@ template<typename T> inline int CountMinSketch<T>::isRCovBelowThres(const T_read
         j=lambda;
         min=mask;
         while (--j>=0 && min>threshold) {
-            // printf("nb=%d k_mer=%ld\n",nb,*(p_start+nb));
             h=hash64to32(*(p_start+nb),j);
             min=cms_lambda_array[j] [h];
         }
@@ -240,11 +240,12 @@ template<typename T> inline int CountMinSketch<T>::isRCovBelowThres(const T_read
             nb++;
         }
         PE2_below_thres=2*a2>b2;
-        //printf("PE1_below_thres=%d, PE2_below_thres=%d \n",PE1_below_thres,PE2_below_thres);
         if (threshold==kappa) return (PE1_below_thres || PE2_below_thres);
-        else return(PE1_below_thres && PE2_below_thres);
+        else {
+            if  (filter_PE_separately==1) return(PE1_below_thres && PE2_below_thres);
+            return(PE1_below_thres || PE2_below_thres);
+        }
     }
-    //printf("PE1_below_thres=%d\n",PE1_below_thres);
     return PE1_below_thres;
 }
 
@@ -302,11 +303,11 @@ template<typename T> inline int CountMinSketch<T>::isRCovBelowThres(const T_read
 
 
 
-template<typename T> void CountMinSketch<T>::init(int glambda,int gkappa,int gkappa_prime,int gfilter_PE_as_single) {
+template<typename T> void CountMinSketch<T>::init(int glambda,int gkappa,int gkappa_prime,int gfilter_PE_separately) {
     lambda=glambda;
     kappa=gkappa;
     kappa_prime=gkappa_prime;
-    filter_PE_as_single=gfilter_PE_as_single;
+    filter_PE_separately=gfilter_PE_separately;
     int j;
     mask=get_mask<T>::value;
     cms_lambda_array= (T**) malloc(lambda*sizeof(T*));
diff --git a/src/FqBaseBackend.cpp b/src/FqBaseBackend.cpp
index 07e4fd1aa0eda51a1bf2e02594fd695000f61b33..ebbfbaf611a6b0d8c3c3815f24c3dc5a5fb33ab2 100644
--- a/src/FqBaseBackend.cpp
+++ b/src/FqBaseBackend.cpp
@@ -202,15 +202,7 @@ int FqBaseBackend::getRead(const unsigned long& offset, char * fq_record) {
         throw errno;
     }
     nread=read(i_f_desc,fq_record,MAX_FQ_RECORD_LENGTH);
-    /*if (strstr(fq_record,"@SRR1222430.1378154 1378154 length=35")==fq_record) {
-        printf("found @SRR1222430.1378154 1378154 length=35\n");
-    }
-    if (strstr(fq_record,"@SRR1222430.1527342 1527342 length=35")==fq_record) {
-        printf("found @SRR1222430.1527342 1527342 length=35\n");
-    }
-    if (strstr(fq_record,"@SRR1222430.1918478 1918478 length=35")==fq_record) {
-        printf("found @SRR1222430.1918478 1918478 length=35\n");
-    }*/
+    
 
 #ifdef DEBUG
     assert(nread<=MAX_FQ_RECORD_LENGTH);
@@ -251,7 +243,7 @@ void FqBaseBackend::onIncScore(T_fq_rec_info& rec_info,T_buf_info& buf_info,int&
     unsigned int s=(int)*buf_info.pchar;
     // printf("s=%u; qual_thres.nucl_score_threshold=%d \n",s,qual_thres.nucl_score_threshold);
     unsigned int remaining_nucl=rec_info.nb_nucleotides_in_read-rec_info.idx_nucl_in_read;
-    if (s<=qual_thres.nucl_score_threshold) { // maybe TODO rewrite this with chained ternary operators once it is clear to see if it improves performances.Not useful: performance bottleneck is not here but in median calculation (42% of time approximatively for both filters).
+    if ((qual_thres.nucl_score_threshold-k_phred_32) and (s<=qual_thres.nucl_score_threshold)) { // maybe TODO rewrite this with chained ternary operators once it is clear to see if it improves performances.Not useful: performance bottleneck is not here but in median calculation (42% of time approximatively for both filters).
         if (rec_info.idx_nucl_in_read<=qual_thres.k-1) { // error is found in the first k nucleotides
             int nb_k_mers=rec_info.nb_nucleotides_in_read-qual_thres.k+1;
             (nb_k_mers>rec_info.idx_nucl_in_read+1)?rec_info.nb_k_mers_in_error=rec_info.idx_nucl_in_read+1:rec_info.nb_k_mers_in_error=nb_k_mers;
diff --git a/src/FqMainBackend.cpp b/src/FqMainBackend.cpp
index 025e505617583e25fdb20d1b9d618b3dc328004a..760b4f66cfc8622907206284cd72280791418ba8 100644
--- a/src/FqMainBackend.cpp
+++ b/src/FqMainBackend.cpp
@@ -104,7 +104,7 @@ void FqMainBackend::onEndFastqRecord(T_fq_rec_info& rec_info,const T_buf_info& b
      //debug_processBuf(on_record_end,bufinfo,rec_info.rstart_offset);
      int nb_k_mer=rec_info.nb_nucleotides_in_read+1-qual_thres.k;
      rec_info.nb_nucleotides_in_read_PE2>0?nb_k_mer_PE2=rec_info.nb_nucleotides_in_read_PE2+1-qual_thres.k:nb_k_mer_PE2=0;
-     if (treat_PE_as_single) {
+     if (!treat_PE_separately) {
          nb_k_mer+=nb_k_mer_PE2;
          (nb_k_mer-rec_info.nb_k_mers_in_error-rec_info.nb_k_mers_in_error_in_PE2>=qual_thres.min_correct_k_mers_in_read)?ref_k_dim.push_back(rp):writeToUndefFile(bufinfo);
      } else {
diff --git a/src/FqMainBackend.h b/src/FqMainBackend.h
index 2f65204e4912cf5ed4f1635c426b1c8a40f68532..656ab4bb210533bdcf5d52c848591276482f944c 100644
--- a/src/FqMainBackend.h
+++ b/src/FqMainBackend.h
@@ -17,7 +17,8 @@
 
 
 class FqMainBackend : public FqBaseBackend {
-    static int treat_PE_as_single;
+    // static int treat_PE_as_single;
+    static int treat_PE_separately;
     FqAuxBackend * p_auxFqProcessor; /* Another fastq processor component is necessary for handling the case of PE reads.*/
     srp * p_scoreReadStruct; /* Where we store information about the reads. */
     // char current_id[50]; used only for debug
@@ -40,8 +41,8 @@ public:
 
     void processBuf(T_buf_info&,unsigned char f_id,unsigned long cur_offset);
 
-    static void setTreatPEAsSingle(const int& treat_PE){
-        FqMainBackend::treat_PE_as_single=treat_PE;
+    static void setTreatPEMode(const int& treat_PE){
+        FqMainBackend::treat_PE_separately=treat_PE;
     }
 };
 
diff --git a/src/ROCKparams.cpp b/src/ROCKparams.cpp
index 7b9b08692822ca5d33e3cf0fff349c0a187e498e..65f5c8db998c48d75049314240c65cbaf9a035e5 100644
--- a/src/ROCKparams.cpp
+++ b/src/ROCKparams.cpp
@@ -5,6 +5,7 @@
  *      Author: vlegrand
  */
 #include <limits.h>
+#include <stdlib.h>
 #include <iostream>
 #include <fstream>
 #include <string>
@@ -24,6 +25,10 @@ void ROCKparams::computeLambda() {
     if (parms.kappa>get_mask<unsigned char>::value) parms.lambda=parms.lambda/sizeof(unsigned short);
 }
 
+int ROCKparams::getfilterPEMode() {
+    return parms.filter_PE_separately;
+}
+
 
 void ROCKparams::processMainArgs(int optind, const int argc, char ** argv,std::vector<string>& v_input_lines) {
             if (optind==argc) return; // no arguments
@@ -263,7 +268,7 @@ void ROCKparams::initFromMainOptsArgs(int argc,char ** argv) {
     int i,q,m;
     std::vector<string> v_input_lines;
     std::vector<string> v_output_lines;
-    static int PE_as_single=0;
+    static int PE_separately=1;
 /*
     static struct option long_options[] =
     {
@@ -274,7 +279,7 @@ void ROCKparams::initFromMainOptsArgs(int argc,char ** argv) {
     //int option_index=0;
 
     // while((i = getopt_long(argc, argv, "i:o:l:k:c:C:g:n:vq:m:",long_options,&option_index)) != -1) {
-    while((i = getopt(argc, argv, "i:o:l:k:c:C:g:n:vq:m:p")) != -1) {
+    while((i = getopt(argc, argv, "i:o:l:k:c:C:g:n:vq:m:p:")) != -1) {
         switch(i) {
             case 0:
                 break;
@@ -317,11 +322,19 @@ void ROCKparams::initFromMainOptsArgs(int argc,char ** argv) {
                 verbose_mode=1;
                 break;
             case 'p':
-                PE_as_single=1;
+                if (strlen(optarg)>1) {
+                    cout<<"value for -p option must be 0, 1 or 2";
+                    usage(EXIT_FAILURE);
+                }
+                PE_separately=atoi(optarg);
+                if (PE_separately<0 or PE_separately>2) {
+                    cout<<"value for -p option must be 0, 1 or 2";
+                    usage(EXIT_FAILURE);
+                }
                 break;
             case 'q':
                 q=atoi(optarg);
-                if (q<=0) {
+                if (q<0) {
                     cout<<"q must be >=0"<<endl;
                     usage(EXIT_FAILURE);
                 }
@@ -343,7 +356,7 @@ void ROCKparams::initFromMainOptsArgs(int argc,char ** argv) {
         cout<<"Incompatible options: when PE are processed independently, minimum number of correct k-mers in each end is 1."<<endl;
         usage(EXIT_FAILURE);
     }*/
-    parms.filter_PE_as_single=PE_as_single;
+    parms.filter_PE_separately=PE_separately;
     //cout<<PE_as_single<<endl;
     processMainArgs(optind, argc, argv,v_input_lines);
     optArgConsistency(input_file,output_file,g,parms,nb_k_mers,v_input_lines);
diff --git a/src/ROCKparams.h b/src/ROCKparams.h
index a12076794069bffe206c87b37676bb43d8a07e5a..f726a9f895513849b501bf3afee5e6ecf6e5dc94 100644
--- a/src/ROCKparams.h
+++ b/src/ROCKparams.h
@@ -79,6 +79,7 @@ class ROCKparams{
 public:
 
     FasqQualThreshold getQualThreshold();
+    int getfilterPEMode();
 
     ROCKparams() {
         f_id=0; // to generate id of input/output fastq files. +1=total number of files.
@@ -88,7 +89,7 @@ public:
         parms.kappa=70;
         parms.kappa_prime=5;
         parms.lambda=0;
-        parms.filter_PE_as_single=0;
+        parms.filter_PE_separately=1;
         qual_thres.min_correct_k_mers_in_read=1;
         qual_thres.nucl_score_threshold=10+k_phred_32;
         qual_thres.k=k;
diff --git a/src/fqreader.cpp b/src/fqreader.cpp
index cad0bbe46a6effdbe0049fdc9cfe9214d1793c6e..d918e68fbfa4b385775db92a8f358168a3a557fe 100644
--- a/src/fqreader.cpp
+++ b/src/fqreader.cpp
@@ -21,7 +21,7 @@
 
 
 FasqQualThreshold FqBaseBackend::qual_thres;
-int FqMainBackend::treat_PE_as_single;
+int FqMainBackend::treat_PE_separately;
 
 /*
  * Processes 1 file containing single reads.
@@ -56,10 +56,10 @@ void processPEFiles(char * fq_1, unsigned char f_id1,char * fq_2, unsigned char
  * pointers to Fqbackend objects.
  * This function ALLOCATES MEMORY with new.
  */
-void processInputFiles(const std::vector<IO_fq_files>& single_files,const vector<PE_files>& v_PE_files,FqBaseBackend * array_be[],const FasqQualThreshold& a_qual_thres, srp* io_sr,const int& PE_as_single) {
+void processInputFiles(const std::vector<IO_fq_files>& single_files,const vector<PE_files>& v_PE_files,FqBaseBackend * array_be[],const FasqQualThreshold& a_qual_thres, srp* io_sr,const int& PE_process_mode) {
     unsigned char f_id=1;
     FqBaseBackend::setQualThreshold(a_qual_thres);
-    FqMainBackend::setTreatPEAsSingle(PE_as_single);
+    FqMainBackend::setTreatPEMode(PE_process_mode);
     std::vector<IO_fq_files>::const_iterator it_single;
     for (it_single=single_files.begin();it_single!=single_files.end();it_single++) {
         FqMainBackend * be_fq=new FqMainBackend(io_sr);
diff --git a/src/fqreader.h b/src/fqreader.h
index 8d1036ddb0890eec7b39bee2e7a0aad54845ba22..17ce828ee3a317be0c6688c298d10834e5e39c44 100644
--- a/src/fqreader.h
+++ b/src/fqreader.h
@@ -19,5 +19,5 @@ using namespace std;
 
 void processSingleFile(char *, unsigned char, srp*);
 void processPEFiles(char * fq_1, unsigned char f_id1,char * gq_2, unsigned char f_id2,srp *io_sr,char * fq_1_test_undef=NULL,char * fq_2_test_undef=NULL,size_t test_bufsize=0);
-void processInputFiles(const std::vector<IO_fq_files>& ,const vector<PE_files>& ,FqBaseBackend * [], const FasqQualThreshold&,srp*,const int& PE_as_single=1 );
+void processInputFiles(const std::vector<IO_fq_files>& ,const vector<PE_files>& ,FqBaseBackend * [], const FasqQualThreshold&,srp*,const int& PE_process_mode);
 #endif
diff --git a/src/main_utils.cpp b/src/main_utils.cpp
index 73c933904fcf1494c8312e8a587a98fef80b4e96..d5da68ad0197fba66b79332d1f9f1fa44c7d087a 100644
--- a/src/main_utils.cpp
+++ b/src/main_utils.cpp
@@ -117,7 +117,7 @@ void usage(int status) {
   cout<<"    -l <int>       .... size of the count min sketch (default: at most 4, depending on the available RAM)"<<endl;
   cout<<"    -n <int>       .... (expected) number of distinct k-mers within the processed reads."<<endl;
   cout<<"    -g <int>       .... maximum RAM to use (in Gb) for the CMS."<<endl;
-  cout<<"    -p             .... treat PE as single. Default is NO."<<endl;
+  cout<<"    -p <int>       .... treat PE as single, separately with strict -c filter, separately with lenient -c fileter. Default is 1."<<endl;
   cout<<"    -q <int>       .... minimum quality threshold for nucleotides. Default is 10."<<endl;
   cout<<"    -m <int>       .... minimum of valid k-mer threshold for reads. Default is 1."<<endl;
   cout<<"    -v             .... verbose"<<endl;
diff --git a/src/read_utils.cpp b/src/read_utils.cpp
index 8108db64220a112086a2b304d10a50f3f6287f2e..f7a40fb65cf956fa31de86f7da70c503b99f3f6a 100644
--- a/src/read_utils.cpp
+++ b/src/read_utils.cpp
@@ -79,7 +79,7 @@ void processFqRecord(DnaSeqStr * dna_seq,const int & nucl_qual_score_thres) {
         cnt++;
     }
     // here, change read if there is a threshold for nucleotide quality score.
-    if (nucl_qual_score_thres) UpdateReadForScoreThreshold(dna_seq,nucl_qual_score_thres,idx_start_qual_score);
+    if (nucl_qual_score_thres-k_phred_32) UpdateReadForScoreThreshold(dna_seq,nucl_qual_score_thres,idx_start_qual_score);
 
 #ifdef DEBUG
     assert(nb_l>=2);
diff --git a/src/rock.cpp b/src/rock.cpp
index a375b0c57cdfe23e103fea10390e1f6c845091d5..240950011f520897265cd176a800475d60feea0e 100644
--- a/src/rock.cpp
+++ b/src/rock.cpp
@@ -69,7 +69,7 @@ int main(int argc,char * argv[]) {
     cout<<"processed input args; going to start reading fastq files"<<endl;
     printRUsage();
 #endif
-    processInputFiles(single_files,v_PE_files,map_id_backend,main_parms.getQualThreshold(),&sr);
+    processInputFiles(single_files,v_PE_files,map_id_backend,main_parms.getQualThreshold(),&sr,main_parms.getfilterPEMode());
 #ifdef BENCHMARK
     cout<<"finished loading fastq file into sr structure"<<endl;
     cout<<"size of srp structure="<<sizeof(sr)<<endl;
diff --git a/src/unit_test_fqreader.cpp b/src/unit_test_fqreader.cpp
index d9771e4e4828f6f6d6cdd8dd609eddfdf54ffce5..f64b83e8d85180813e16960c2e2883c5cee9e1ba 100644
--- a/src/unit_test_fqreader.cpp
+++ b/src/unit_test_fqreader.cpp
@@ -30,7 +30,7 @@ using namespace std;
 void test_processSingleFile() {
     srp sr;
     unsigned char f_id=1;
-    FqMainBackend::setTreatPEAsSingle(1);
+    FqMainBackend::setTreatPEMode(0);
     processSingleFile((char *) "../test/data/unit/test_single.fq",f_id,&sr);
     srp::reverse_iterator rit;
     i_dim::iterator it_offs;
@@ -75,7 +75,7 @@ void test_processSingleFileWithMQOption() {
     qual_thres.nucl_score_threshold=14+k_phred_32;
     qual_thres.min_correct_k_mers_in_read=100;
     FqBaseBackend::setQualThreshold(qual_thres);
-    FqMainBackend::setTreatPEAsSingle(1);
+    FqMainBackend::setTreatPEMode(0);
     FqMainBackend be_fq=FqMainBackend(&sr);
     
     be_fq.setUndefFile((char *) "../test/data/unit/test_single.undef.fq");
@@ -153,7 +153,7 @@ void test_processPEfilesWithA() {
     unsigned char f_id4=4;
 
     srp sr;
-    FqMainBackend::setTreatPEAsSingle(1);
+    FqMainBackend::setTreatPEMode(0);
     processPEFiles(fq_3_test, f_id3,fq_4_test, f_id4,&sr);
     srp::reverse_iterator rit;
     i_dim::iterator it_offs;
@@ -210,7 +210,7 @@ void test_processPEFiles() {
     unsigned char f_id2=2;
 
     srp sr;
-    FqMainBackend::setTreatPEAsSingle(1);
+    FqMainBackend::setTreatPEMode(0);
     processPEFiles(fq_1_test, f_id1,fq_2_test, f_id2,&sr);
     srp::reverse_iterator rit;
     i_dim::iterator it_offs;
@@ -269,7 +269,7 @@ void aux_testPEFilesMQ(FasqQualThreshold qual_thres,int nb_expected_reads) {
 
     unsigned char f_id1=1;
     unsigned char f_id2=2;
-    FqMainBackend::setTreatPEAsSingle(1);
+    FqMainBackend::setTreatPEMode(0);
     FqBaseBackend::setQualThreshold(qual_thres);
     processPEFiles(fq_1_test, f_id1,fq_2_test, f_id2,&sr,fq_1_test_undef,fq_2_test_undef);
 
@@ -298,7 +298,7 @@ void test_processPEFilesWithMQOptions() {
     qual_thres.k=20;
     qual_thres.nucl_score_threshold=14+k_phred_32;
     qual_thres.min_correct_k_mers_in_read=76;
-    FqMainBackend::setTreatPEAsSingle(1);
+    FqMainBackend::setTreatPEMode(0);
 
     aux_testPEFilesMQ(qual_thres,4); // last fq records contains only 77 correct k-mers.
 
@@ -351,7 +351,7 @@ void test_processAllFiles() {
     unsigned char f_single=3;
 
     srp sr;
-    FqMainBackend::setTreatPEAsSingle(1);
+    FqMainBackend::setTreatPEMode(0);
     processPEFiles(fq_1_test, f_id1,fq_2_test, f_id2,&sr);
     processSingleFile(fq_single,f_single,&sr);
 
@@ -378,7 +378,7 @@ void test_processPE_not_as_single() {
     qual_thres.nucl_score_threshold=2+k_phred_32;
 
     FqBaseBackend::setQualThreshold(qual_thres);
-    FqMainBackend::setTreatPEAsSingle(0);
+    FqMainBackend::setTreatPEMode(1);
     processPEFiles(fq_1_test, f_id1,fq_2_test, f_id2,&sr,fq_1_test_undef,fq_2_test_undef,1000);
 
     srp::reverse_iterator rit;
@@ -422,7 +422,7 @@ void test_processPE_not_as_single2() {
     qual_thres.nucl_score_threshold=10+k_phred_32;
 
     FqBaseBackend::setQualThreshold(qual_thres);
-    FqMainBackend::setTreatPEAsSingle(0);
+    FqMainBackend::setTreatPEMode(1);
     processPEFiles(fq_1_test, f_id1,fq_2_test, f_id2,&sr,fq_1_test_undef,fq_2_test_undef,1000);
 
     srp::reverse_iterator rit;
@@ -465,7 +465,7 @@ void test_processPE_not_as_singleWithMQ() {
     qual_thres.nucl_score_threshold=10+k_phred_32;
 
     FqBaseBackend::setQualThreshold(qual_thres);
-    FqMainBackend::setTreatPEAsSingle(0);
+    FqMainBackend::setTreatPEMode(1);
     processPEFiles(fq_1_test, f_id1,fq_2_test, f_id2,&sr,fq_1_test_undef,fq_2_test_undef,1000);
 
     srp::reverse_iterator rit;
@@ -494,7 +494,7 @@ void test_processPE_not_as_singleWithMQ() {
     qual_thres.nucl_score_threshold=15+k_phred_32;
 
     FqBaseBackend::setQualThreshold(qual_thres);
-    FqMainBackend::setTreatPEAsSingle(0);
+    FqMainBackend::setTreatPEMode(1);
     processPEFiles(fq_1_test, f_id1,fq_2_test, f_id2,&sr,fq_1_test_undef,fq_2_test_undef,1000);
 
 
@@ -521,7 +521,7 @@ void test_processPE_not_as_singleWithMQ() {
     qual_thres.nucl_score_threshold=18+k_phred_32;
 
     FqBaseBackend::setQualThreshold(qual_thres);
-    FqMainBackend::setTreatPEAsSingle(0);
+    FqMainBackend::setTreatPEMode(1);
     processPEFiles(fq_1_test, f_id1,fq_2_test, f_id2,&sr,fq_1_test_undef,fq_2_test_undef,1000);
 
 
@@ -574,10 +574,10 @@ void test_processInputFiles() {
     default_qual_thres.min_correct_k_mers_in_read=0; // aim of that test is not to check undef file creation. Disable it by putting 0 here
     default_qual_thres.nucl_score_threshold=0; // leave default values for that test
     
-    FqMainBackend::setTreatPEAsSingle(1);
+    FqMainBackend::setTreatPEMode(0);
 
     FqBaseBackend * array_be[k_max_input_files];
-    processInputFiles(v_single,v_pe,array_be,default_qual_thres,&sr);
+    processInputFiles(v_single,v_pe,array_be,default_qual_thres,&sr,1);
 
     // check that result is correct in sr.
     check_processAllFilesResults(sr);
@@ -621,7 +621,7 @@ AAAAAEEAEEEEEEEEE6EE/EEEEEEEEAEEAEEEEEEEEEEEEEEAEEEA/A/EEEAEEEEEE/EE</EAEEEEEE/E
     qual_thres.min_correct_k_mers_in_read=78;
     T_buf_info buf_info;
     FqBaseBackend::setQualThreshold(qual_thres);
-    FqMainBackend::setTreatPEAsSingle(1);
+    FqMainBackend::setTreatPEMode(0);
     FqMainBackend be(&sr);
     be.setUndefFile((char *) "../test/data/unit/test_processBuf.undef.fq");
     buf_info.buf=buf;
@@ -680,7 +680,7 @@ AAAAAEEEEEEEEEEAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEAEEEAEEEEEEEEEEEEEEAEEEEEEEEEEEE
     T_buf_info buf_info;
     T_buf_info PE2_buf_info;
     FqBaseBackend::setQualThreshold(qual_thres);
-    FqMainBackend::setTreatPEAsSingle(1);
+    FqMainBackend::setTreatPEMode(0);
 
     FqMainBackend be(&sr);
     be.setUndefFile((char *) "../test/data/unit/test_processBuf_PE1.undef.fq");
@@ -748,7 +748,7 @@ void Aux_MimicBigPEFilesWithMQOptions(const FasqQualThreshold& qual_thres,const
 
     // FqBaseBackend::bufsize=bufsize; // choose a very small buf size to mimic behavior on big files and reun the test in a short time
     FqBaseBackend::setQualThreshold(qual_thres);
-    FqMainBackend::setTreatPEAsSingle(1);
+    FqMainBackend::setTreatPEMode(0);
 
     processPEFiles(fq_1_test, f_id1,fq_2_test, f_id2,&sr,fq_1_test_undef,fq_2_test_undef,bufsize);
 
diff --git a/test/Makefile.am b/test/Makefile.am
index cbaa00857f238d2e60437735cc67c7625da61dc4..6131da00c91ae684422d72bc2ba87440a655ed5f 100755
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -20,6 +20,7 @@ data/fastq.raw/klebsiella_5_2_bad_scores.fq data/iofiles.args/output_files_2_PE_
 data/unit/test_PE1_PE_not_as_single.fq data/unit/test_PE2_PE_not_as_single.fq \
 data/unit/expected_PE1_PE_not_as_single.undef.fastq data/unit/expected_PE2_PE_not_as_single.undef.fastq \
 data/unit/test_PE1_PE_not_as_single_pathological.fq data/unit/test_PE2_PE_not_as_single_pathological.fq \
-data/unit/fake_PE1.fq data/unit/fake_PE2.fq
+data/unit/fake_PE1.fq data/unit/fake_PE2.fq \
+data/iofiles.args/output_files_2_PE_separated_lenient.txt data/fastq.raw/klebsiella_6_1_bad_scores.fq data/fastq.raw/klebsiella_6_2_bad_scores.fq
 
 
diff --git a/test/data/fastq.raw/klebsiella_5_1_bad_scores.fq b/test/data/fastq.raw/klebsiella_5_1_bad_scores.fq
index f1b49b1dcd177e62170fc3e952ef6d4db6713803..23531af41b955983819662a23aec64d1d77a2e29 100644
--- a/test/data/fastq.raw/klebsiella_5_1_bad_scores.fq
+++ b/test/data/fastq.raw/klebsiella_5_1_bad_scores.fq
@@ -17,4 +17,4 @@ GATCGGAAGAGCACACGTCTGAACTCCAGTCACCTTGTAATCTCGTATGCCGTCTTCTGCTTGAAAAAAAACCATGGCTC
 @SRR1222430.5 5 length=208
 CGCTTATGGAAATGTGACGATCGTCACCGTTCCGCCCCGGGAGAACGGGGCGGAAAAAGAGGGCGATTTTAGTGCCAGCAGAAGTGATGAACCACCTGGCTAATCAGCTCCCGGGTCGGCTTGATAAAGCGCGTCTCCAGATACTCGTCAGGCTGATGGGCCTGATTGATGGAGCCCGGGCCGAGAACCAGCGTCGGACACAGCGTCT
 +SRR1222430.5 5 length=208
-CCDDCCFFFFFFGGGGGGGGGGGHHHGHGHGHHGGGGGGGGGGGHHGGGGGGGGGGHHGGHHGGGGGHGHHHHHHHHHGHHHHHHHHHHHHHHHGGHHHHHHHHHHHHHHHGGGGGGGGGGGGHHHHHHHGGGGGGGGGGGGGGGGGGGGGGGGGGFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
\ No newline at end of file
+CCDDCCFFFFFFGGGGGGGGGGGHHHGHGHGHHGGGGGGGGGGGHHGGGGGGGGGGHHGGHHGGGGGHGHHHHHHHHHGHHHHHHHHHHHHHHHGGHHHHHHHHHHHHHHHGGGGGGGGGGGGHHHHHHHGGGGGGGGGGGGGGGGGGGGGGGGGGFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
diff --git a/test/data/fastq.raw/klebsiella_6_1_bad_scores.fq b/test/data/fastq.raw/klebsiella_6_1_bad_scores.fq
new file mode 100644
index 0000000000000000000000000000000000000000..1e81522a1ab50a23a7668193b2080c6a1f650f45
--- /dev/null
+++ b/test/data/fastq.raw/klebsiella_6_1_bad_scores.fq
@@ -0,0 +1,24 @@
+@SRR1222430.1 1 length=251
+GCCCGCGAAGCGGAGCTGGCCGCCTGCAAAGGCCGTTCGCGCTCGCTGTCGCTGGATCTGTACGCCCAGTGGCGCTGCATGGAGGACAACCACGGCAAGTGGCGCTTCACCTCGCCGACCCATACCGTGCTGGCCTTCGCCCAGGCGCTGAAAGAGCTGGCGCAGGAGGGCGGCGTCAGCGCTCGCCATCAGCGCTACCGCAACAATCAGCGCCGTCTGGTGGCAGGGATGCGCGCGCTCGGCTTCCGGCC
++SRR1222430.1 1 length=251
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@SRR1222430.2 2 length=250
+AGAAATTCGCCATCAGAATAAAAACCTCATATGCACATTTTCTTGTTATTGCACAGCCTGTGCCACTTTAGCGCCAGCCTCTCCGGCAATCGTGGAGAAATTAAGGAGATAGTGTAATTTATCATGTTGCTTTTGCCGTATCGTAAAGAAACCTCGAGCTTTCCTGCCAGCAGGTAGCGAGTCTGCTTCGTCACCGCAGACCGGCGCATTATCCCTTGCCGGTGTGAAACCTCATTTCATTTAAGTCAAA
++SRR1222430.2 2 length=250
+BBBBBFFFBBBBFGGGGGGGGGHHGGHHHHHHHHGFGHHHHHHHHGHHHFFFHHFHHHHHHEHGFHHHFGFGFGGGEGGFHHFHGCGGGHHGHHGGHFAFHHHEGFHHGGHHFHFHHHHHEHHHHHHHHHHHGHHHGGGGHHGHFGGFDGFGFHGEGFCDHGGHHHHHHHGHHEHHGHGGGGHGFHHEHGHGGGGDFGGGHHGADA?DBGGGGGGFFFFBBFFFFFFFFFFFFFFFFFBFFFFFFFFF/B
+@SRR1222430.3 3 length=236
+CAAACACCTGACGCGGTTCCAGCAGGTACTCCTGCACGCCAATTTCCGGGCGGGCAGTAAAGCGCTGTTTGCAGCCCGTCTGGTGCAGGCGCCCCAGATAGCGGCCAACCCATTCCATCTGATCAAGGTTATCCGCTTCGAACTGACGACCGCCAAGGCTTGGGAAAACGGCAAAGTAGAATCCCTGATGCTGATGAAGCGTGCTGTCATTAAATAAGAGCGGCGCAGCAACGGGC
++SRR1222430.3 3 length=236
+CCCCCFFCFFFFGGGGGGGGGGHHHHHFGHHHHHHHHGGGGGHHHHHGGGGGGGGGGHHHHHHGGGGGHHHHHHHHGGGGHGHGHHGGHGGGGGGGGHHHHHGGGGGHGGGGHHHHGHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@SRR1222430.4 4 length=249
+GATCGGAAGAGCACACGTCTGAACTCCAGTCACCTTGTAATCTCGTATGCCGTCTTCTGCTTGAAAAAAAACCATGGCTCGGCGCCCAGGGCATCGTCCCGCAATCCGATGACTGGATGGTCGTCGCCAAAGGCACGATCAACGTCCAGCCTGCGGTGGTGATTGCCATCACTGGCACCTTCCAGGGCGGCAGTATTGGCGAAGTGTCCGGCCTCAAAATTGCCGCCGCCATGGTGCTGGCGGCGGATG
++SRR1222430.4 4 length=249
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!CAFGFDA1GAEG2FGFAFFCEFGCA/GFD!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@SRR1222430.5 5 length=208
+CGCTTATGGAAATGTGACGATCGTCACCGTTCCGCCCCGGGAGAACGGGGCGGAAAAAGAGGGCGATTTTAGTGCCAGCAGAAGTGATGAACCACCTGGCTAATCAGCTCCCGGGTCGGCTTGATAAAGCGCGTCTCCAGATACTCGTCAGGCTGATGGGCCTGATTGATGGAGCCCGGGCCGAGAACCAGCGTCGGACACAGCGTCT
++SRR1222430.5 5 length=208
+CCDDCCFFFFFFGGGGGGGGGGGHHHGHGHGHHGGGGGGGGGGGHHGGGGGGGGGGHHGGHHGGGGGHGHHHHHHHHHGHHHHHHHHHHHHHHHGGHHHHHHHHHHHHHHHGGGGGGGGGGGGHHHHHHHGGGGGGGGGGGGGGGGGGGGGGGGGGFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+@SRR1222430.6 6 length=236
+CAAACACCTGACGCGGTTCCAGCAGGTACTCCTGCACGCCAATTTCCGGGCGGGCAGTAAAGCGCTGTTTGCAGCCCGTCTGGTGCAGGCGCCCCAGATAGCGGCCAACCCATTCCATCTGATCAAGGTTATCCGCTTCGAACTGACGACCGCCAAGGCTTGGGAAAACGGCAAAGTAGAATCCCTGATGCTGATGAAGCGTGCTGTCATTAAATAAGAGCGGCGCAGCAACGGGC
++SRR1222430.6 6 length=236
+CCCCCFFCFFFFGGGGGGGGGGHHHHHFGHHHHHHHHGGGGGHHHHHGGGGGGGGGGHHHHHHGGGGGHHHHHHHHGGGGHGHGHHGGHGGGGGGGGHHHHHGGGGGHGGGGHHHHGHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
diff --git a/test/data/fastq.raw/klebsiella_6_2_bad_scores.fq b/test/data/fastq.raw/klebsiella_6_2_bad_scores.fq
new file mode 100644
index 0000000000000000000000000000000000000000..7ab7ee06509752898cc022089ef4419d9a59c2a8
--- /dev/null
+++ b/test/data/fastq.raw/klebsiella_6_2_bad_scores.fq
@@ -0,0 +1,24 @@
+@SRR1222430.1 1 length=250
+CGATGCTGCGCTGCATCAATAAGCTGGAAGAGATCACCAGCGGCGATCTGATTGTCGATGGTCTGAAGGTCAACGACCCGAAGGTGGACGAACGTCTGATTCGTCAGGAAGCCGGGATGGTTTTCCAGCAGTTTTATCTGTTCCCGCACCTCACGGCGCTGGAAAACGTGATGTTTGGCCCGCTGCGGGTACGCGGCGCCAGCAAGCAGGCGGCGAGTGCAGGCTATCGTCGAGCAGCGGCCGGAAGCCG
++SRR1222430.1 1 length=250
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@SRR1222430.2 2 length=251
+AGAAATTCGCCAGGGTGATCAACGTCTCATCGTCGGCGAGGGTCAGCGCCTGCGCGGGACAGTTTTCCACACAGGCCGGCCCCGCCTCGCGGCCCTGGCATAGATCGCACTTGTGCGCGCTGGCTTTCACCAGGCCTGCGGCCTGCGGCGTCACCACCACCTGCATCACCCCGAACGGGCAGGCCACCATGCAGGATTTACAGCCAATGCATTTCTCCTGACGGACCTGAACGCTGTCGCCGGACTGGGCG
++SRR1222430.2 2 length=251
+>1>AAFFF?11AEGGFFCGGGGGFGHFH2FF1F00EEE/AAEE0FGGFGEGGHGGCGC?EEFHEFEEHDF1EECHEFE/@@/BCCCFGAC@CC@C.CEGFHFHGHFHCEC?FH;CC?CG@@?-AF.BB0BFGF?E./EF;@?;AFF@<-@@??BFF?F-:A?BF999BBBF@@?@@@F-;@B@FF-A-9FF/BFFE/F//B/BBEFBFFFFF/BFFFFFFFEB?-@=B-/BBF--:;/A-B>--;>?EFE9
+@SRR1222430.3 3 length=236
+GCCCGTTGCTGCGCCGCTCTTATTTAATGACAGCACGCTTCATCAGCATCAGGGATTCTACTTTGCCGTTTTCCCAAGCCTTGGCGGTCGTCAGTTCGAAGCGGATAACCTTGATCAGATGGAATGGGTTGGCCGCTATCTGGGGCGCCTGCACCAGACGGGCTGCAAACAGCGCTTTACTGCCCGCCCGGAAATTGGCGTGCAGGAGTACCTGCTGGAACCGCGTCAGGTGTTTG
++SRR1222430.3 3 length=236
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!HHHEFGGCFGHHHHGGFGGGGGGGGGGGGGGGGGFFFEFFFFFFFBFFFFF=;ABFF/FA:DB;BF.9.BFFFFFFF/AFFFFFABDFFB/9BD.;
+@SRR1222430.4 4 length=250
+GCATGGAAAAGGGGTGTGGTGGGGAAAAGGGGAGATCCCTGCTGGAGCCCTACCCCTTAAAAAAAAAAACACAGCACCGGCTGCGTCGGGATACCGTAGCGTATCTCTACCGCCGCCATCACCCGCGCGCGTGCCATTTGGTCACCCAACAATGTGCCCATATGTCCTCCCACAGATGAGTACGTGATGCCAATCCTCATCGCAGAATAGCCTCTCAGTGGCCCCTTTGTAACCCACATACCCTACTTGG
++SRR1222430.4 4 length=250
+>>11111111111A100A0AAEA00A0A0//////011B11/1B10B0A/0B000/B0BB111/>/E////0?0/<0<////</<///////0??///.>-...0=1<=1D----::-::00/.----------;/:;;//-:/;/--9---;/9//////;/99/////-----9///;///----///9;9//-/9////-;--///////-//////;---9--/////:/----////;/--////
+@SRR1222430.5 5 length=208
+AGACGCTGTGTCCGACGCTGGTTCTCGGCCCGGGCTCCATCAATCAGGCCCATCAGCCTGACGAGTATCTGGAGACGCGCTTTATCAAGCCGACCCGGGAGCTGATTAGCCAGGTGGTTCATCACTTCTGCTGGCACTAAAATCGCCCTCTTTTTCCGCCCCGTTCTCCCGGGGCGGAACGGTGACGATCGTCACATTTCCATAAGCG
++SRR1222430.5 5 length=208
+DDDDDDCDDFFFGGGGGGGGGGHHHHGGGGGGGGGGHGHHHHHHHHHHHGGGHHHHHHHHHHGGGGHHHHHHHHHGGGGGGGGHHHHHHHGGGGGGGGGGGGHHHHHHHHHHHHGHGGGHHHHHHHHHHHHHHHGHHHHHHHHHGGGGGHHHHHHHHGGGGGGGGGGGGGGFGGFFFFFFFFDFFFFFFFFFFEFFFFFFFFFFFFFF
+@SRR1222430.6 6 length=208
+AGACGCTGTGTCCGACGCTGGTTCTCGGCCCGGGCTCCATCAATCAGGCCCATCAGCCTGACGAGTATCTGGAGACGCGCTTTATCAAGCCGACCCGGGAGCTGATTAGCCAGGTGGTTCATCACTTCTGCTGGCACTAAAATCGCCCTCTTTTTCCGCCCCGTTCTCCCGGGGCGGAACGGTGACGATCGTCACATTTCCATAAGCG
++SRR1222430.6 6 length=208
+DDDDDDCDDFFFGGGGGGGGGGHHHHGGGGGGGGGGHGHHHHHHHHHHHGGGHHHHHHHHHHGGGGHHHHHHHHHGGGGGGGGHHHHHHHGGGGGGGGGGGGHHHHHHHHHHHHGHGGGHHHHHHHHHHHHHHHGHHHHHHHHHGGGGGHHHHHHHHGGGGGGGGGGGGGGFGGFFFFFFFFDFFFFFFFFFFEFFFFFFFFFFFFFF
diff --git a/test/data/iofiles.args/output_files_2_PE_separated_lenient.txt b/test/data/iofiles.args/output_files_2_PE_separated_lenient.txt
new file mode 100644
index 0000000000000000000000000000000000000000..704fe9f9a1855b882d8104c7871035d564216d0a
--- /dev/null
+++ b/test/data/iofiles.args/output_files_2_PE_separated_lenient.txt
@@ -0,0 +1 @@
+tmp/klebsiella_6_1_2_qual_thres.fq,tmp/klebsiella_6_2_2_qual_thres.fq
diff --git a/test/rock.sh b/test/rock.sh
index 7c30d3ee38072b11103beed10d965345d7f368dd..524608b25262272903a5977c969bd512c211c00c 100755
--- a/test/rock.sh
+++ b/test/rock.sh
@@ -55,23 +55,27 @@ mkdir data/fastq.filtered || exit 6
 echo " "
 echo "##################################################################################"
 echo "doing more checks on options and error messages"
-../src/rock -C 500000 -p -i ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100.txt -o ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100_filtered.txt|grep "Bad value for kappa"  >/dev/null || exit 7
-../src/rock -C 500 -c 600 -p -i ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100.txt -o ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100_filtered.txt|grep "ERROR lower filter is higher than high filter" >/dev/null || exit 8
-../src/rock -C 500 -c 400 -k 60 -p -i ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100.txt -o ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100_filtered.txt|grep "Bad value for k" >/dev/null || exit 9
-../src/rock -C 500 -c 400 -k 10 -l 0 -p -i ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100.txt -o ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100_filtered.txt|grep "Bad value for lambda" >/dev/null || exit 10
-../src/rock -C 500 -c 400 -k 10 -l 500 -p -i ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100.txt -o ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100_filtered.txt|grep "Not enough RAM on the machine" >/dev/null || exit 11
-../src/rock -C 500 -c 400 -k 10 -l 12 -g 25 -p -i ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100.txt -o ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100_filtered.txt|grep "options are mutually exclusive" >/dev/null|| exit 12
-../src/rock -C 500 -c 400 -k 10 -g 10000 -p -i ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100.txt -o ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100_filtered.txt|grep "This machine only has" >/dev/null || exit 13
-../src/rock -C 500 -c 400 -k 10 -l 12 -n 85000000 -p -i ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100.txt -o ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100_filtered.txt|grep "options are mutually exclusive">/dev/null || exit 14
-../src/rock -C 500 -c 400 -k 10 -q 3 -m 0 -p -i ${srcdir}/test/data/iofiles.args/extract_klebsiella_long_reads_100.txt|grep "minimum number of valid k-mer for keeping a read must be an integer">/dev/null || exit 15
-../src/rock -C 500 -c 400 -k 10 -q -1 -m 2 -p -i ${srcdir}/test/data/iofiles.args/extract_klebsiella_long_reads_100.txt|grep "q must be">/dev/null || exit 16
+../src/rock -C 500000 -p 0 -i ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100.txt -o ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100_filtered.txt|grep "Bad value for kappa"  >/dev/null || exit 7
+../src/rock -C 500 -c 600 -p 0 -i ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100.txt -o ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100_filtered.txt|grep "ERROR lower filter is higher than high filter" >/dev/null || exit 8
+../src/rock -C 500 -c 400 -k 60 -p 0 -i ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100.txt -o ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100_filtered.txt|grep "Bad value for k" >/dev/null || exit 9
+../src/rock -C 500 -c 400 -k 10 -l 0 -p 0 -i ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100.txt -o ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100_filtered.txt|grep "Bad value for lambda" >/dev/null || exit 10
+../src/rock -C 500 -c 400 -k 10 -l 500 -p 0 -i ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100.txt -o ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100_filtered.txt|grep "Not enough RAM on the machine" >/dev/null || exit 11
+../src/rock -C 500 -c 400 -k 10 -l 12 -g 25 -i ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100.txt -o ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100_filtered.txt|grep "options are mutually exclusive" >/dev/null|| exit 12
+../src/rock -C 500 -c 400 -k 10 -g 10000 -i ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100.txt -o ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100_filtered.txt|grep "This machine only has" >/dev/null || exit 13
+../src/rock -C 500 -c 400 -k 10 -l 12 -n 85000000 -i ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100.txt -o ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100_filtered.txt|grep "options are mutually exclusive">/dev/null || exit 14
+../src/rock -C 500 -c 400 -k 10 -q 3 -m 0 -p 0 -i ${srcdir}/test/data/iofiles.args/extract_klebsiella_long_reads_100.txt|grep "minimum number of valid k-mer for keeping a read must be an integer">/dev/null || exit 15
+../src/rock -C 500 -c 400 -k 10 -q -1 -m 2 -p 0 -i ${srcdir}/test/data/iofiles.args/extract_klebsiella_long_reads_100.txt|grep "q must be">/dev/null || exit 16
+../src/rock -C 500 -c 400 -k 10 -q 4 -m 2 -p 10 -i ${srcdir}/test/data/iofiles.args/extract_klebsiella_long_reads_100.txt|grep "value for -p option must be 0, 1 or 2">/dev/null || exit 17
+../src/rock -C 500 -c 400 -k 10 -q 4 -m 2 -p 1,5 -i ${srcdir}/test/data/iofiles.args/extract_klebsiella_long_reads_100.txt|grep "value for -p option must be 0, 1 or 2">/dev/null || exit 18
+../src/rock -C 500 -c 400 -k 10 -q 4 -m 2 -p -1 -i ${srcdir}/test/data/iofiles.args/extract_klebsiella_long_reads_100.txt|grep "value for -p option must be 0, 1 or 2">/dev/null || exit 17
+
 #../src/rock -C 500 -c 400 -k 10 -q 2 -m 2 -i ${srcdir}/test/data/iofiles.args/extract_klebsiella_long_reads_100.txt|grep "Incompatible options">/dev/null || exit 161
 
 # here check that we have enough memory for running the tests.
 ../src/unit_test_cms CHECK_MEM
 if [ $? = 0 ] ## we have enough memory to run the tests in rock_mem.sh
 then 
-    ${srcdir}/rock_mem.sh ||exit 141
+    ${srcdir}/rock_mem.sh ||exit 255
 fi
 
 # unit tests
@@ -90,12 +94,12 @@ echo "unit testing for read utils"
 echo " "
 echo "##################################################################################"
 echo "unit testing for fqwriter"
-../src/unit_test_fqwriter || exit 25
+../src/unit_test_fqwriter || exit 24
 
 echo " "
 echo "#################################################################################"
 echo "unit testing for main utils"
-../src/unit_test_main_utils || exit 26
+../src/unit_test_main_utils || exit 25
 
 # cleanup
 echo " "
@@ -106,17 +110,17 @@ echo "erase_indata="$erase_indata
 if [ "$erase_indata" = "true" ] 
 then
     echo "erasing data/fastq.raw"
-    rm -fr data/fastq.raw || exit 211
+    rm -fr data/fastq.raw || exit 26
 fi
 if [ "$erase_indata" = "true" ] 
 then
    echo "erasing data/unit"
-   rm -fr data/unit || exit 212
+   rm -fr data/unit || exit 27
 fi
 if [ "$erase_indata" = "true" ] 
 then
    echo "erasing data/iofiles.args"
-   rm -fr data/iofiles.args || exit 212
+   rm -fr data/iofiles.args || exit 28
 fi
 
 
diff --git a/test/rock_mem.sh b/test/rock_mem.sh
index e21876fd4db67926643a9fec03757fd2e4a73907..d4956a709b561544921272c72143d2ead21d9b0b 100755
--- a/test/rock_mem.sh
+++ b/test/rock_mem.sh
@@ -10,67 +10,67 @@ echo "##########################################################################
 echo "testing high filter"
 
 
-../src/rock -C 100 -l 2 -p -i ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100.txt -o ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100_filtered.txt #>/dev/null || exit 15
+../src/rock -C 100 -c 0 -l 2 -p 0 -i ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100.txt -o ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100_filtered.txt >/dev/null || exit 101
 
 # output files should be the same size, contain the same elements but not in the same order.
 nb_PE1=`grep -c "@" ${srcdir}/data/fastq.raw/klebsiella_100_1.fq`
 nb_PE2=`grep -c "@" ${srcdir}/data/fastq.raw/klebsiella_100_2.fq`
 
 
-ls -l ${srcdir}/
-ls -l ${srcdir}/data/
-ls -l data/fastq.filtered/
+#ls -l ${srcdir}/
+#ls -l ${srcdir}/data/
+#ls -l data/fastq.filtered/
 
-[ -f "data/fastq.filtered/SRR1222430_1.filtered.fastq" ] || exit 151
-[ -f "data/fastq.filtered/SRR1222430_2.filtered.fastq" ] || exit 152
+[ -f "data/fastq.filtered/SRR1222430_1.filtered.fastq" ] || exit 102
+[ -f "data/fastq.filtered/SRR1222430_2.filtered.fastq" ] || exit 103
 
 nb_PE1_filtered=`grep -c "@" data/fastq.filtered/SRR1222430_1.filtered.fastq`
 nb_PE2_filtered=`grep -c "@" data/fastq.filtered/SRR1222430_2.filtered.fastq`
 
-test $nb_PE1=$nb_PE1_filtered || exit 16
-test $nb_PE2=$nb_PE2_filtered || exit 17
+test $nb_PE1 -eq $nb_PE1_filtered || exit 104
+test $nb_PE2 -eq $nb_PE2_filtered || exit 105
 
 # test low filter.
 echo " "
 echo "##################################################################################"
 echo "testing low filter"
-../src/rock -C 100 -c 99 -l 2 -p -i ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100.txt -o ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100_filtered.txt >/dev/null || exit 18
+../src/rock -C 100 -c 99 -l 2 -p 0 -i ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100.txt -o ${srcdir}/data/iofiles.args/extract_klebsiella_long_reads_100_filtered.txt >/dev/null || exit 106
 
-[ -f "data/fastq.filtered/SRR1222430_1.filtered.fastq" ] || exit 181
-[ -f "data/fastq.filtered/SRR1222430_2.filtered.fastq" ] || exit 182
+[ -f "data/fastq.filtered/SRR1222430_1.filtered.fastq" ] || exit 107
+[ -f "data/fastq.filtered/SRR1222430_2.filtered.fastq" ] || exit 108
 
 nb_PE1_filtered=`grep -c "@" data/fastq.filtered/SRR1222430_1.filtered.fastq`
 nb_PE2_filtered=`grep -c "@" data/fastq.filtered/SRR1222430_2.filtered.fastq`
 
-test $nb_PE1_filtered=0 || exit 19
-test $nb_PE2_filtered=0 || exit 20
+test $nb_PE1_filtered -eq 0 || exit 109
+test $nb_PE2_filtered -eq 0 || exit 110
 
 # test that input fastq file names can be provided in command-line.
 echo " "
 echo "##################################################################################"
 echo "testing that input fastq file names can be provided in command line."
-../src/rock -C 100 -c 1 -l 2 -p ${srcdir}/data/fastq.raw/klebsiella_100_1.fq,${srcdir}/data/fastq.raw/klebsiella_100_2.fq ${srcdir}/data/unit/test_single.fq ${srcdir}/data/unit/test_single2.fq >/dev/null || exit 181
+../src/rock -C 100 -c 1 -l 2 -p 0 ${srcdir}/data/fastq.raw/klebsiella_100_1.fq,${srcdir}/data/fastq.raw/klebsiella_100_2.fq ${srcdir}/data/unit/test_single.fq ${srcdir}/data/unit/test_single2.fq >/dev/null || exit 111
 
-[ -f "klebsiella_100_1.rock.fq" ] || exit 1811
-[ -f "klebsiella_100_2.rock.fq" ] || exit 1812
-[ -f "test_single.rock.fq" ] || exit 1813
-[ -f "test_single2.rock.fq" ] || exit 1814
+[ -f "klebsiella_100_1.rock.fq" ] || exit 112
+[ -f "klebsiella_100_2.rock.fq" ] || exit 113
+[ -f "test_single.rock.fq" ] || exit 114
+[ -f "test_single2.rock.fq" ] || exit 115
 
 
 
 # checking that output files were sorted in decreasing order of quality score. For that expect to have SRR122430.1.1 as 1rst record in filtered file.
-ret=`head -4 "klebsiella_100_1.rock.fq"|grep "SRR122430.1.1"`
-test $ret=2 || exit 1815
+ret=`head -4 "klebsiella_100_1.rock.fq"|grep -c "SRR1222430.1.1"`
+test $ret -eq 2 || exit 116
 
 echo "erasing test result files"
-rm -f "klebsiella_100_1.rock.fq" || exit 1816
-rm -f "klebsiella_100_2.rock.fq" || exit 1817
-rm -f "test_single.rock.fq"|| exit 1818
-rm -f "test_single2.rock.fq"|| exit 1819
-rm -f "klebsiella_100_1.undefined.fq" || exit 18191
-rm -f "klebsiella_100_2.undefined.fq" || exit 18192
-rm -f "test_single.undefined.fq" || exit 18193
-rm -f "test_single2.undefined.fq" || exit 19194
+rm -f "klebsiella_100_1.rock.fq" || exit 117
+rm -f "klebsiella_100_2.rock.fq" || exit 118
+rm -f "test_single.rock.fq"|| exit 119
+rm -f "test_single2.rock.fq"|| exit 120
+rm -f "klebsiella_100_1.undefined.fq" || exit 121
+rm -f "klebsiella_100_2.undefined.fq" || exit 122
+rm -f "test_single.undefined.fq" || exit 123
+rm -f "test_single2.undefined.fq" || exit 124
 
 
 
@@ -78,19 +78,19 @@ rm -f "test_single2.undefined.fq" || exit 19194
 echo " "
 echo "##################################################################################"
 echo "testing verbose mode"
-../src/rock -C 100 -c 1 -l 2 -p -v ${srcdir}/data/fastq.raw/klebsiella_100_1.fq,${srcdir}/data/fastq.raw/klebsiella_100_2.fq ${srcdir}/data/unit/test_single.fq ${srcdir}/data/unit/test_single2.fq|grep "CMS size=" >/dev/null || exit 182
+../src/rock -C 100 -c 1 -l 2 -p 0 -v ${srcdir}/data/fastq.raw/klebsiella_100_1.fq,${srcdir}/data/fastq.raw/klebsiella_100_2.fq ${srcdir}/data/unit/test_single.fq ${srcdir}/data/unit/test_single2.fq|grep "CMS size=" >/dev/null || exit 125
 
-../src/rock -C 100 -c 1 -v -p -n 1000 ${srcdir}/data/fastq.raw/klebsiella_100_1.fq,${srcdir}/data/fastq.raw/klebsiella_100_2.fq ${srcdir}/data/unit/test_single.fq ${srcdir}/data/unit/test_single2.fq|grep "expected probability of collision was:" >/dev/null || exit 183
+../src/rock -C 100 -c 1 -v -p 0 -n 1000 ${srcdir}/data/fastq.raw/klebsiella_100_1.fq,${srcdir}/data/fastq.raw/klebsiella_100_2.fq ${srcdir}/data/unit/test_single.fq ${srcdir}/data/unit/test_single2.fq|grep "expected probability of collision was:" >/dev/null || exit 126
 
 echo "erasing test result files"
-rm -f "klebsiella_100_1.rock.fq" || exit 1816
-rm -f "klebsiella_100_2.rock.fq" || exit 1817
-rm -f "test_single.rock.fq"|| exit 1818
-rm -f "test_single2.rock.fq"|| exit 1819
-rm -f "klebsiella_100_1.undefined.fq" || exit 18191
-rm -f "klebsiella_100_2.undefined.fq" || exit 18192
-rm -f "test_single.undefined.fq" || exit 18193
-rm -f "test_single2.undefined.fq" || exit 19194
+rm -f "klebsiella_100_1.rock.fq" || exit 127
+rm -f "klebsiella_100_2.rock.fq" || exit 128
+rm -f "test_single.rock.fq"|| exit 129
+rm -f "test_single2.rock.fq"|| exit 130
+rm -f "klebsiella_100_1.undefined.fq" || exit 131
+rm -f "klebsiella_100_2.undefined.fq" || exit 132
+rm -f "test_single.undefined.fq" || exit 133
+rm -f "test_single2.undefined.fq" || exit 134
 
 echo " "
 echo "##################################################################################"
@@ -108,30 +108,30 @@ expected_diff2="> @SRR1222430.37 37 length=251 \
 > A3>333BFA2FF4GBFFDGGCGED?FGEGGHGFFFEEG?AF13@50>///11B13@@1/>//B0?>////<//B/00??@/--:--.;:C000;:0/0009.-9:.00:-.;9/9...-;.--9@--9:////-9-9..////9/;//;9///.9-..--------..99.9.//////;-;--9-.////://9/9.;.-;-99-.//.;////-;?9;...9-9-----9;-.;.;/.-9.;/99=--;"
 
 mkdir tmp
-../src/rock -C 100 -c 1 -l 2 -p -o ${srcdir}/data/iofiles.args/output_files_noNQ_Thres.txt  ${srcdir}/data/fastq.raw/klebsiella_100_1.fq,${srcdir}/data/fastq.raw/klebsiella_100_2.fq || exit 191
+../src/rock -C 100 -c 1 -l 2 -p 0 -o ${srcdir}/data/iofiles.args/output_files_noNQ_Thres.txt  ${srcdir}/data/fastq.raw/klebsiella_100_1.fq,${srcdir}/data/fastq.raw/klebsiella_100_2.fq >/dev/null || exit 140
 
-../src/rock -C 100 -c 1 -l 2 -q 2 -p -o ${srcdir}/data/iofiles.args/output_files_NQ_Thres_very_low.txt  ${srcdir}/data/fastq.raw/klebsiella_100_1.fq,${srcdir}/data/fastq.raw/klebsiella_100_2.fq || exit 192
+../src/rock -C 100 -c 1 -l 2 -q 2 -p 0 -o ${srcdir}/data/iofiles.args/output_files_NQ_Thres_very_low.txt  ${srcdir}/data/fastq.raw/klebsiella_100_1.fq,${srcdir}/data/fastq.raw/klebsiella_100_2.fq >/dev/null || exit 141
 
-ret1=`diff tmp/klebsiella_100_1_very_low_qual_thres.fq tmp/klebsiella_100_1_no_qual_thres.fq`
-test $ret1=0 || exit 1921
-ret2=`diff tmp/klebsiella_100_2_very_low_qual_thres.fq tmp/klebsiella_100_2_no_qual_thres.fq`
-test $ret2=0 || exit 1922
+ret1=`diff tmp/klebsiella_100_1_very_low_qual_thres.fq tmp/klebsiella_100_1_no_qual_thres.fq|wc -l`
+test $ret1 -eq 0 || exit 142
+ret2=`diff tmp/klebsiella_100_2_very_low_qual_thres.fq tmp/klebsiella_100_2_no_qual_thres.fq|wc -l`
+test $ret2 -eq 0 || exit 143
 
-../src/rock -C 100 -c 1 -l 2 -q 12 -p -o ${srcdir}/data/iofiles.args/output_files_NQ_Thres_12.txt ${srcdir}/data/fastq.raw/klebsiella_100_1.fq,${srcdir}/data/fastq.raw/klebsiella_100_2.fq||exit 193
+../src/rock -C 100 -c 1 -l 2 -q 12 -p 0 -o ${srcdir}/data/iofiles.args/output_files_NQ_Thres_12.txt ${srcdir}/data/fastq.raw/klebsiella_100_1.fq,${srcdir}/data/fastq.raw/klebsiella_100_2.fq >/dev/null ||exit 144
 
-../src/rock -C 100 -c 1 -l 2 -q 13 -p -o ${srcdir}/data/iofiles.args/output_files_NQ_Thres_13.txt ${srcdir}/data/fastq.raw/klebsiella_100_1.fq,${srcdir}/data/fastq.raw/klebsiella_100_2.fq||exit 194
+../src/rock -C 100 -c 1 -l 2 -q 13 -p 0 -o ${srcdir}/data/iofiles.args/output_files_NQ_Thres_13.txt ${srcdir}/data/fastq.raw/klebsiella_100_1.fq,${srcdir}/data/fastq.raw/klebsiella_100_2.fq >/dev/null ||exit 145
 
 ret1=`diff tmp/klebsiella_100_1_13_qual_thres.fq tmp/klebsiella_100_1_12_qual_thres.fq|grep -c "@SRR1222430.37"`
-test $ret1 = 1 || exit 1931
+test $ret1 -eq  1 || exit 146
 
 ret2=`diff tmp/klebsiella_100_1_13_qual_thres.fq tmp/klebsiella_100_1_12_qual_thres.fq|grep -c "length"`
-test $ret2 = 2 || exit 1932
+test $ret2 -eq  2 || exit 147
 
 ret1=`diff tmp/klebsiella_100_2_13_qual_thres.fq tmp/klebsiella_100_2_12_qual_thres.fq|grep -c "@SRR1222430.37"`
-test $ret1 = 1 || exit 1933
+test $ret1 -eq  1 || exit 148
 
 ret2=`diff tmp/klebsiella_100_2_13_qual_thres.fq tmp/klebsiella_100_2_12_qual_thres.fq|grep -c "length"`
-test $ret2 = 2 || exit 1934
+test $ret2 -eq  2 || exit 149
 
 rm -fr tmp
 
@@ -140,114 +140,114 @@ echo "##########################################################################
 echo "testing ROCK with a quality score threshold for nucleotides and minimum number of valid k-mer to keep a read."
 
 mkdir tmp
-../src/rock -C 100 -c 1 -l 2 -p -o ${srcdir}/data/iofiles.args/output_files_noNQ_Thres.txt  ${srcdir}/data/fastq.raw/klebsiella_100_1.fq,${srcdir}/data/fastq.raw/klebsiella_100_2.fq || exit 191
+../src/rock -C 100 -c 1 -l 2 -p 0 -o ${srcdir}/data/iofiles.args/output_files_noNQ_Thres.txt  ${srcdir}/data/fastq.raw/klebsiella_100_1.fq,${srcdir}/data/fastq.raw/klebsiella_100_2.fq >/dev/null || exit 150
 
-../src/rock -C 100 -c 1 -l 2 -q 2 -m 5 -p -o ${srcdir}/data/iofiles.args/output_files_NQ_Thres_very_low.txt  ${srcdir}/data/fastq.raw/klebsiella_100_1.fq,${srcdir}/data/fastq.raw/klebsiella_100_2.fq || exit 192
+../src/rock -C 100 -c 1 -l 2 -q 2 -m 5 -p 0 -o ${srcdir}/data/iofiles.args/output_files_NQ_Thres_very_low.txt  ${srcdir}/data/fastq.raw/klebsiella_100_1.fq,${srcdir}/data/fastq.raw/klebsiella_100_2.fq >/dev/null || exit 151
 
-ret1=`diff tmp/klebsiella_100_1_very_low_qual_thres.fq tmp/klebsiella_100_1_no_qual_thres.fq`
-test $ret1=0 || exit 19211
-ret2=`diff tmp/klebsiella_100_2_very_low_qual_thres.fq tmp/klebsiella_100_2_no_qual_thres.fq`
-test $ret2=0 || exit 19212
+ret1=`diff tmp/klebsiella_100_1_very_low_qual_thres.fq tmp/klebsiella_100_1_no_qual_thres.fq|wc -l`
+test $ret1 -eq 0 || exit 152
+ret2=`diff tmp/klebsiella_100_2_very_low_qual_thres.fq tmp/klebsiella_100_2_no_qual_thres.fq|wc -l`
+test $ret2 -eq 0 || exit 153
 
 
-[ -f "tmp/klebsiella_100_1.undefined.fq" ] || exit 19213
-[ -f "tmp/klebsiella_100_2.undefined.fq" ] || exit 19214
+[ -f "tmp/klebsiella_100_1.undefined.fq" ] || exit 154
+[ -f "tmp/klebsiella_100_2.undefined.fq" ] || exit 155
 
 ret1=`cat tmp/klebsiella_100_1.undefined.fq|wc -l`
 ret2=`cat tmp/klebsiella_100_2.undefined.fq|wc -l`
 
-test $ret1=0 || exit 19215
-test $ret1=0 || exit 19216
+test $ret1 -eq 0 || exit 156
+test $ret1 -eq 0 || exit 157
 
-../src/rock -C 100 -c 1 -l 2 -q 13 -m 500 -p -o ${srcdir}/data/iofiles.args/output_files_NQ_Thres_13.txt ${srcdir}/data/fastq.raw/klebsiella_100_1.fq,${srcdir}/data/fastq.raw/klebsiella_100_2.fq || exit 192161
+../src/rock -C 100 -c 1 -l 2 -q 13 -m 500 -p 0 -o ${srcdir}/data/iofiles.args/output_files_NQ_Thres_13.txt ${srcdir}/data/fastq.raw/klebsiella_100_1.fq,${srcdir}/data/fastq.raw/klebsiella_100_2.fq >/dev/null || exit 158
 
-[ -f "tmp/klebsiella_100_1.undefined.fq" ] || exit 19215
-[ -f "tmp/klebsiella_100_2.undefined.fq" ] || exit 19216
+[ -f "tmp/klebsiella_100_1.undefined.fq" ] || exit 159
+[ -f "tmp/klebsiella_100_2.undefined.fq" ] || exit 160
 
 ret1=`cat tmp/klebsiella_100_1.undefined.fq|wc -l`
 ret2=`cat tmp/klebsiella_100_2.undefined.fq|wc -l`
 
-test $ret1 = 400 || exit 19217
-test $ret1 = 400 || exit 19218
+test $ret1 -eq 400 || exit 161
+test $ret1 -eq 400 || exit 162
 
-../src/rock -C 100 -c 1 -l 2 -q 13 -m 300 -p -o ${srcdir}/data/iofiles.args/output_files_NQ_Thres_13.txt ${srcdir}/data/fastq.raw/klebsiella_100_1.fq,${srcdir}/data/fastq.raw/klebsiella_100_2.fq || exit 192162
+../src/rock -C 100 -c 1 -l 2 -q 13 -m 300 -p 0 -o ${srcdir}/data/iofiles.args/output_files_NQ_Thres_13.txt ${srcdir}/data/fastq.raw/klebsiella_100_1.fq,${srcdir}/data/fastq.raw/klebsiella_100_2.fq >/dev/null || exit 163
 
-[ -f "tmp/klebsiella_100_1.undefined.fq" ] || exit 192191
-[ -f "tmp/klebsiella_100_2.undefined.fq" ] || exit 192192
+[ -f "tmp/klebsiella_100_1.undefined.fq" ] || exit 164
+[ -f "tmp/klebsiella_100_2.undefined.fq" ] || exit 165
 
 ret1=`cat tmp/klebsiella_100_1.undefined.fq|wc -l`
 ret2=`cat tmp/klebsiella_100_2.undefined.fq|wc -l`
 
-test $ret1 = 136 || exit 192193
-test $ret1 = 136 || exit 192194
+test $ret1 -eq 136 || exit 166
+test $ret1 -eq 136 || exit 167
 
 echo " "
 echo "##################################################################################"
-echo "testing ROCK with a quality score threshold for nucleotides and PE processed separately"
-../src/rock -C 100 -c 1 -l 2 -q 2 -o ${srcdir}/data/iofiles.args/output_files_2_PE_separated.txt ${srcdir}/data/fastq.raw/klebsiella_5_1_bad_scores.fq,${srcdir}/data/fastq.raw/klebsiella_5_2_bad_scores.fq || exit 201
+echo "testing ROCK with a quality score threshold for nucleotides and PE processed separately with strict filter "
+../src/rock -C 100 -c 1 -l 2 -q 2 -p 1 -o ${srcdir}/data/iofiles.args/output_files_2_PE_separated.txt ${srcdir}/data/fastq.raw/klebsiella_5_1_bad_scores.fq,${srcdir}/data/fastq.raw/klebsiella_5_2_bad_scores.fq >/dev/null || exit 168
 
-[ -f "tmp/klebsiella_5_1_bad_scores.undefined.fq" ] || exit 20100
-[ -f "tmp/klebsiella_5_2_bad_scores.undefined.fq" ] || exit 20101
+[ -f "tmp/klebsiella_5_1_bad_scores.undefined.fq" ] || exit 169
+[ -f "tmp/klebsiella_5_2_bad_scores.undefined.fq" ] || exit 170
 
 ret1=`cat tmp/klebsiella_5_1_bad_scores.undefined.fq|wc -l`
 ret2=`cat tmp/klebsiella_5_2_bad_scores.undefined.fq|wc -l`
 
-test $ret1=8 || exit 201100
-test $ret1=8 || exit 201101
+test $ret1 -eq 8 || exit 171
+test $ret2 -eq 8 || exit 171
 
 ret1=`grep -c SRR1222430.1 tmp/klebsiella_5_1_bad_scores.undefined.fq`
 ret2=`grep -c SRR1222430.1 tmp/klebsiella_5_2_bad_scores.undefined.fq`
 
-test $ret1=2 || exit 201200
-test $ret1=2 || exit 201201
+test $ret1 -eq 2 || exit 172
+test $ret2 -eq 2 || exit 172
 
-ret1=`grep -c SRR1222430.5 tmp/klebsiella_5_1_bad_scores.undefined.fq`
-ret2=`grep -c SRR1222430.5 tmp/klebsiella_5_2_bad_scores.undefined.fq`
+ret1=`grep -c SRR1222430.4 tmp/klebsiella_5_1_bad_scores.undefined.fq`
+ret2=`grep -c SRR1222430.4 tmp/klebsiella_5_2_bad_scores.undefined.fq`
 
-test $ret1=2 || exit 201300
-test $ret1=2 || exit 201301
+test $ret1 -eq 2 || exit 173
+test $ret2 -eq 2 || exit 173
 
 ret1=`grep -c SRR1222430.2 tmp/klebsiella_5_1_bad_scores.undefined.fq`
 ret2=`grep -c SRR1222430.2 tmp/klebsiella_5_2_bad_scores.undefined.fq`
 
-test $ret1=0 || exit 201400
-test $ret1=0 || exit 201401
+test $ret1 -eq 0 || exit 174
+test $ret2 -eq 0 || exit 174
 
 ret1=`grep -c SRR1222430.3 tmp/klebsiella_5_1_bad_scores.undefined.fq`
 ret2=`grep -c SRR1222430.3 tmp/klebsiella_5_2_bad_scores.undefined.fq`
 
-test $ret1=0 || exit 201500
-test $ret1=0 || exit 201501
+test $ret1 -eq 0 || exit 175
+test $ret2 -eq 0 || exit 175
 
-ret1=`grep -c SRR1222430.4 tmp/klebsiella_5_1_bad_scores.undefined.fq`
-ret2=`grep -c SRR1222430.4 tmp/klebsiella_5_2_bad_scores.undefined.fq`
+ret1=`grep -c SRR1222430.5 tmp/klebsiella_5_1_bad_scores.undefined.fq`
+ret2=`grep -c SRR1222430.5 tmp/klebsiella_5_2_bad_scores.undefined.fq`
 
-test $ret1=0 || exit 201600
-test $ret1=0 || exit 201601
+test $ret1 -eq 0 || exit 176
+test $ret2 -eq 0 || exit 176
 
 ret1=`cat tmp/klebsiella_5_1_2_qual_thres.fq|wc -l`
 ret2=`cat tmp/klebsiella_5_1_2_qual_thres.fq|wc -l`
 
-test $ret1=12 || exit 201700
-test $ret1=12 || exit 201701
+test $ret1 -eq 8 || exit 177
+test $ret2 -eq 8 || exit 177
 
 ret1=`grep -c SRR1222430.2 tmp/klebsiella_5_1_2_qual_thres.fq`
 ret2=`grep -c SRR1222430.2 tmp/klebsiella_5_2_2_qual_thres.fq`
 
-test $ret1=2 || exit 201800
-test $ret1=2 || exit 201801
+test $ret1 -eq 2 || exit 178
+test $ret2 -eq 2 || exit 178
 
 ret1=`grep -c SRR1222430.3 tmp/klebsiella_5_1_2_qual_thres.fq`
 ret2=`grep -c SRR1222430.3 tmp/klebsiella_5_2_2_qual_thres.fq`
 
-test $ret1=2 || exit 201802
-test $ret1=2 || exit 201803
+test $ret1 -eq 0 || exit 179
+test $ret2 -eq 0 || exit 179
 
-ret1=`grep -c SRR1222430.4 tmp/klebsiella_5_1_2_qual_thres.fq`
-ret2=`grep -c SRR1222430.4 tmp/klebsiella_5_2_2_qual_thres.fq`
+ret1=`grep -c SRR1222430.5 tmp/klebsiella_5_1_2_qual_thres.fq`
+ret2=`grep -c SRR1222430.5 tmp/klebsiella_5_2_2_qual_thres.fq`
 
-test $ret1=2 || exit 201804
-test $ret1=2 || exit 201805
+test $ret1 -eq 2 || exit 180
+test $ret2 -eq 2 || exit 180
 
 rm -f tmp/klebsiella_5_1_bad_scores.undefined.fq
 rm -f tmp/klebsiella_5_2_bad_scores.undefined.fq
@@ -257,71 +257,71 @@ rm -f tmp/klebsiella_5_2_2_qual_thres.fq
 
 echo " "
 echo "##################################################################################"
-echo "testing ROCK with a quality score threshold for nucleotides, PE processed separately and -m option"
-../src/rock -C 100 -c 1 -l 2 -q 2 -m 2 -o ${srcdir}/data/iofiles.args/output_files_2_PE_separated.txt ${srcdir}/data/fastq.raw/klebsiella_5_1_bad_scores.fq,${srcdir}/data/fastq.raw/klebsiella_5_2_bad_scores.fq || exit 202
+echo "testing ROCK with a quality score threshold for nucleotides, PE processed separately (strict filter)  and -m option"
+../src/rock -C 100 -c 1 -l 2 -q 2 -m 2 -p 1 -o ${srcdir}/data/iofiles.args/output_files_2_PE_separated.txt ${srcdir}/data/fastq.raw/klebsiella_5_1_bad_scores.fq,${srcdir}/data/fastq.raw/klebsiella_5_2_bad_scores.fq >/dev/null || exit 281
 
-[ -f "tmp/klebsiella_5_1_bad_scores.undefined.fq" ] || exit 20200
-[ -f "tmp/klebsiella_5_2_bad_scores.undefined.fq" ] || exit 20201
+[ -f "tmp/klebsiella_5_1_bad_scores.undefined.fq" ] || exit 182
+[ -f "tmp/klebsiella_5_2_bad_scores.undefined.fq" ] || exit 182
 
 ret1=`cat tmp/klebsiella_5_1_bad_scores.undefined.fq|wc -l`
 ret2=`cat tmp/klebsiella_5_2_bad_scores.undefined.fq|wc -l`
 
-test $ret1=8 || exit 202100
-test $ret1=8 || exit 202101
+test $ret1 -eq 8 || exit 183
+test $ret2 -eq 8 || exit 183
 
 ret1=`grep -c SRR1222430.1 tmp/klebsiella_5_1_bad_scores.undefined.fq`
 ret2=`grep -c SRR1222430.1 tmp/klebsiella_5_2_bad_scores.undefined.fq`
 
-test $ret1=2 || exit 202200
-test $ret1=2 || exit 202201
+test $ret1 -eq 2 || exit 184
+test $ret2 -eq 2 || exit 184
 
-ret1=`grep -c SRR1222430.5 tmp/klebsiella_5_1_bad_scores.undefined.fq`
-ret2=`grep -c SRR1222430.5 tmp/klebsiella_5_2_bad_scores.undefined.fq`
+ret1=`grep -c SRR1222430.4 tmp/klebsiella_5_1_bad_scores.undefined.fq`
+ret2=`grep -c SRR1222430.4 tmp/klebsiella_5_2_bad_scores.undefined.fq`
 
-test $ret1=2 || exit 202300
-test $ret1=2 || exit 202301
+test $ret1 -eq 2 || exit 185
+test $ret2 -eq 2 || exit 185
 
 ret1=`grep -c SRR1222430.2 tmp/klebsiella_5_1_bad_scores.undefined.fq`
 ret2=`grep -c SRR1222430.2 tmp/klebsiella_5_2_bad_scores.undefined.fq`
 
-test $ret1=0 || exit 202400
-test $ret1=0 || exit 202401
+test $ret1 -eq 0 || exit 186
+test $ret2 -eq 0 || exit 186
 
 ret1=`grep -c SRR1222430.3 tmp/klebsiella_5_1_bad_scores.undefined.fq`
 ret2=`grep -c SRR1222430.3 tmp/klebsiella_5_2_bad_scores.undefined.fq`
 
-test $ret1=0 || exit 202500
-test $ret1=0 || exit 202501
+test $ret1 -eq 0 || exit 187
+test $ret2 -eq 0 || exit 187
 
-ret1=`grep -c SRR1222430.4 tmp/klebsiella_5_1_bad_scores.undefined.fq`
-ret2=`grep -c SRR1222430.4 tmp/klebsiella_5_2_bad_scores.undefined.fq`
+ret1=`grep -c SRR1222430.5 tmp/klebsiella_5_1_bad_scores.undefined.fq`
+ret2=`grep -c SRR1222430.5 tmp/klebsiella_5_2_bad_scores.undefined.fq`
 
-test $ret1=0 || exit 202600
-test $ret1=0 || exit 202601
+test $ret1 -eq 0 || exit 188
+test $ret2 -eq 0 || exit 188
 
 ret1=`cat tmp/klebsiella_5_1_2_qual_thres.fq|wc -l`
 ret2=`cat tmp/klebsiella_5_1_2_qual_thres.fq|wc -l`
 
-test $ret1=12 || exit 202700
-test $ret1=12 || exit 202701
+test $ret1 -eq 8 || exit 189
+test $ret2 -eq 8 || exit 189
 
 ret1=`grep -c SRR1222430.2 tmp/klebsiella_5_1_2_qual_thres.fq`
 ret2=`grep -c SRR1222430.2 tmp/klebsiella_5_2_2_qual_thres.fq`
 
-test $ret1=2 || exit 202800
-test $ret1=2 || exit 202801
+test $ret1 -eq 2 || exit 190
+test $ret2 -eq 2 || exit 190
 
 ret1=`grep -c SRR1222430.3 tmp/klebsiella_5_1_2_qual_thres.fq`
 ret2=`grep -c SRR1222430.3 tmp/klebsiella_5_2_2_qual_thres.fq`
 
-test $ret1=2 || exit 202802
-test $ret1=2 || exit 202803
+test $ret1 -eq 0 || exit 191
+test $ret2 -eq 0 || exit 191
 
-ret1=`grep -c SRR1222430.4 tmp/klebsiella_5_1_2_qual_thres.fq`
-ret2=`grep -c SRR1222430.4 tmp/klebsiella_5_2_2_qual_thres.fq`
+ret1=`grep -c SRR1222430.5 tmp/klebsiella_5_1_2_qual_thres.fq`
+ret2=`grep -c SRR1222430.5 tmp/klebsiella_5_2_2_qual_thres.fq`
 
-test $ret1=2 || exit 202804
-test $ret1=2 || exit 202805
+test $ret1 -eq 2 || exit 192
+test $ret2 -eq 2 || exit 192
 
 rm -f tmp/klebsiella_5_1_bad_scores.undefined.fq
 rm -f tmp/klebsiella_5_2_bad_scores.undefined.fq
@@ -332,56 +332,238 @@ rm -f tmp/klebsiella_5_2_2_qual_thres.fq
 
 echo " "
 echo "##################################################################################"
-echo "testing ROCK with no quality score threshold for nucleotides and PE processed separately"
+echo "testing ROCK with no quality score threshold for nucleotides, no low filter and PE processed separately (strict filter)"
 
-../src/rock -C 100 -c 1 -l 2 -o ${srcdir}/data/iofiles.args/output_files_2_PE_separated.txt ${srcdir}/data/fastq.raw/klebsiella_5_1_bad_scores.fq,${srcdir}/data/fastq.raw/klebsiella_5_2_bad_scores.fq || exit 203
+../src/rock -C 100 -c 0 -l 2 -q 0 -p 1 -o ${srcdir}/data/iofiles.args/output_files_2_PE_separated.txt ${srcdir}/data/fastq.raw/klebsiella_5_1_bad_scores.fq,${srcdir}/data/fastq.raw/klebsiella_5_2_bad_scores.fq >/dev/null || exit 193
 
-[ -f "tmp/klebsiella_5_1_bad_scores.undefined.fq" ] || exit 30100
-[ -f "tmp/klebsiella_5_2_bad_scores.undefined.fq" ] || exit 30101
+[ -f "tmp/klebsiella_5_1_bad_scores.undefined.fq" ] || exit 194
+[ -f "tmp/klebsiella_5_2_bad_scores.undefined.fq" ] || exit 194
 
 ret1=`cat tmp/klebsiella_5_1_bad_scores.undefined.fq|wc -l`
 ret2=`cat tmp/klebsiella_5_2_bad_scores.undefined.fq|wc -l`
 
-test $ret1=0 || exit 301100
-test $ret1=0 || exit 301101
+test $ret1 -eq 0 || exit 195
+test $ret2 -eq 0 || exit 195
+
+ret1=`cat tmp/klebsiella_5_1_2_qual_thres.fq|wc -l`
+ret2=`cat tmp/klebsiella_5_1_2_qual_thres.fq|wc -l`
+
+test $ret1 -eq 20 || exit 196
+test $ret2 -eq 20 || exit 196
 
+ret1=`grep -c SRR1222430.2 tmp/klebsiella_5_1_2_qual_thres.fq`
+ret2=`grep -c SRR1222430.2 tmp/klebsiella_5_2_2_qual_thres.fq`
+
+test $ret1 -eq 2 || exit 197
+test $ret2 -eq 2 || exit 197
+
+ret1=`grep -c SRR1222430.3 tmp/klebsiella_5_1_2_qual_thres.fq`
+ret2=`grep -c SRR1222430.3 tmp/klebsiella_5_2_2_qual_thres.fq`
+
+test $ret1 -eq 2 || exit 198
+test $ret2 -eq 2 || exit 198
+
+ret1=`grep -c SRR1222430.4 tmp/klebsiella_5_1_2_qual_thres.fq`
+ret2=`grep -c SRR1222430.4 tmp/klebsiella_5_2_2_qual_thres.fq`
+
+test $ret1 -eq 2 || exit 199
+test $ret2 -eq 2 || exit 199
+
+ret1=`grep -c SRR1222430.1 tmp/klebsiella_5_1_2_qual_thres.fq`
+ret2=`grep -c SRR1222430.1 tmp/klebsiella_5_2_2_qual_thres.fq`
+
+test $ret1 -eq 2 || exit 200
+test $ret2 -eq 2 || exit 200
+
+ret1=`grep -c SRR1222430.5 tmp/klebsiella_5_1_2_qual_thres.fq`
+ret2=`grep -c SRR1222430.5 tmp/klebsiella_5_2_2_qual_thres.fq`
+
+test $ret1 -eq 2 || exit 201
+test $ret2 -eq 2 || exit 201
+
+rm -f tmp/klebsiella_5_1_bad_scores.undefined.fq
+rm -f tmp/klebsiella_5_2_bad_scores.undefined.fq
+rm -f tmp/klebsiella_5_1_2_qual_thres.fq
+rm -f tmp/klebsiella_5_2_2_qual_thres.fq
+
+
+echo " "
+echo "##################################################################################"
+echo "testing ROCK with no quality score threshold for nucleotides, no low filter and PE processed separately (lenient filter). Results should be the same as with strict filter"
 
+../src/rock -C 100 -c 0 -l 2 -q 0 -p 2 -o ${srcdir}/data/iofiles.args/output_files_2_PE_separated.txt ${srcdir}/data/fastq.raw/klebsiella_5_1_bad_scores.fq,${srcdir}/data/fastq.raw/klebsiella_5_2_bad_scores.fq >/dev/null || exit 202
+
+[ -f "tmp/klebsiella_5_1_bad_scores.undefined.fq" ] || exit 202
+[ -f "tmp/klebsiella_5_2_bad_scores.undefined.fq" ] || exit 202
+
+ret1=`cat tmp/klebsiella_5_1_bad_scores.undefined.fq|wc -l`
+ret2=`cat tmp/klebsiella_5_2_bad_scores.undefined.fq|wc -l`
+
+test $ret1 -eq 0 || exit 203
+test $ret2 -eq 0 || exit 203
 
 ret1=`cat tmp/klebsiella_5_1_2_qual_thres.fq|wc -l`
 ret2=`cat tmp/klebsiella_5_1_2_qual_thres.fq|wc -l`
 
-test $ret1=20 || exit 201700
-test $ret1=20 || exit 201701
+test $ret1 -eq 20 || exit 204
+test $ret2 -eq 20 || exit 204
 
 ret1=`grep -c SRR1222430.2 tmp/klebsiella_5_1_2_qual_thres.fq`
 ret2=`grep -c SRR1222430.2 tmp/klebsiella_5_2_2_qual_thres.fq`
 
-test $ret1=2 || exit 301800
-test $ret1=2 || exit 301801
+test $ret1 -eq 2 || exit 205
+test $ret2 -eq 2 || exit 205
 
 ret1=`grep -c SRR1222430.3 tmp/klebsiella_5_1_2_qual_thres.fq`
 ret2=`grep -c SRR1222430.3 tmp/klebsiella_5_2_2_qual_thres.fq`
 
-test $ret1=2 || exit 301802
-test $ret1=2 || exit 301803
+test $ret1 -eq 2 || exit 206
+test $ret2 -eq 2 || exit 206
 
 ret1=`grep -c SRR1222430.4 tmp/klebsiella_5_1_2_qual_thres.fq`
 ret2=`grep -c SRR1222430.4 tmp/klebsiella_5_2_2_qual_thres.fq`
 
-test $ret1=2 || exit 301804
-test $ret1=2 || exit 301805
+test $ret1 -eq 2 || exit 207
+test $ret2 -eq 2 || exit 207
 
 ret1=`grep -c SRR1222430.1 tmp/klebsiella_5_1_2_qual_thres.fq`
 ret2=`grep -c SRR1222430.1 tmp/klebsiella_5_2_2_qual_thres.fq`
 
-test $ret1=2 || exit 301806
-test $ret1=2 || exit 301807
+test $ret1 -eq 2 || exit 208
+test $ret2 -eq 2 || exit 208
 
 ret1=`grep -c SRR1222430.5 tmp/klebsiella_5_1_2_qual_thres.fq`
 ret2=`grep -c SRR1222430.5 tmp/klebsiella_5_2_2_qual_thres.fq`
 
-test $ret1=2 || exit 301808
-test $ret1=2 || exit 301809
+test $ret1 -eq 2 || exit 209
+test $ret2 -eq 2 || exit 209
+
+
+rm -f tmp/klebsiella_5_1_bad_scores.undefined.fq
+rm -f tmp/klebsiella_5_2_bad_scores.undefined.fq
+rm -f tmp/klebsiella_5_1_2_qual_thres.fq
+rm -f tmp/klebsiella_5_2_2_qual_thres.fq
+
+
+echo " "
+echo "##################################################################################"
+echo "testing ROCK with a quality score threshold for nucleotides, PE processed separately (lenient filter)  and -m option"
+../src/rock -C 100 -c 1 -l 2 -q 2 -m 2 -p 2 -o ${srcdir}/data/iofiles.args/output_files_2_PE_separated_lenient.txt ${srcdir}/data/fastq.raw/klebsiella_6_1_bad_scores.fq,${srcdir}/data/fastq.raw/klebsiella_6_2_bad_scores.fq >/dev/null || exit 210
+
+[ -f "tmp/klebsiella_6_1_bad_scores.undefined.fq" ] || exit 211
+[ -f "tmp/klebsiella_6_2_bad_scores.undefined.fq" ] || exit 211
+
+ret1=`cat tmp/klebsiella_6_1_bad_scores.undefined.fq|wc -l`
+ret2=`cat tmp/klebsiella_6_2_bad_scores.undefined.fq|wc -l`
+
+test $ret1 -eq 8 || exit 212
+test $ret2 -eq 8 || exit 212
+
+ret1=`grep -c SRR1222430.1 tmp/klebsiella_6_1_bad_scores.undefined.fq`
+ret2=`grep -c SRR1222430.1 tmp/klebsiella_6_2_bad_scores.undefined.fq`
+
+test $ret1 -eq 2 || exit 213
+test $ret2 -eq 2 || exit 213
+
+ret1=`grep -c SRR1222430.4 tmp/klebsiella_6_1_bad_scores.undefined.fq`
+ret2=`grep -c SRR1222430.4 tmp/klebsiella_6_2_bad_scores.undefined.fq`
+
+test $ret1 -eq 2 || exit 214
+test $ret2 -eq 2 || exit 214
+
+ret1=`grep -c SRR1222430.2 tmp/klebsiella_6_1_bad_scores.undefined.fq`
+ret2=`grep -c SRR1222430.2 tmp/klebsiella_6_2_bad_scores.undefined.fq`
+
+test $ret1 -eq 0 || exit 215
+test $ret2 -eq 0 || exit 215
+
+ret1=`grep -c SRR1222430.3 tmp/klebsiella_6_1_bad_scores.undefined.fq`
+ret2=`grep -c SRR1222430.3 tmp/klebsiella_6_2_bad_scores.undefined.fq`
+
+test $ret1 -eq 0 || exit 216
+test $ret2 -eq 0 || exit 216
+
+ret1=`grep -c SRR1222430.5 tmp/klebsiella_6_1_bad_scores.undefined.fq`
+ret2=`grep -c SRR1222430.5 tmp/klebsiella_6_2_bad_scores.undefined.fq`
+
+test $ret1 -eq 0 || exit 217
+test $ret2 -eq 0 || exit 217
+
+ret1=`grep -c SRR1222430.6 tmp/klebsiella_6_1_bad_scores.undefined.fq`
+ret2=`grep -c SRR1222430.6 tmp/klebsiella_6_2_bad_scores.undefined.fq`
+
+test $ret1 -eq 0 || exit 218
+test $ret2 -eq 0 || exit 218
+
+ret1=`cat tmp/klebsiella_6_1_2_qual_thres.fq|wc -l`
+ret2=`cat tmp/klebsiella_6_1_2_qual_thres.fq|wc -l`
+
+test $ret1 -eq 8 || exit 219
+test $ret2 -eq 8 || exit 219
+
+ret1=`grep -c SRR1222430.2 tmp/klebsiella_6_1_2_qual_thres.fq`
+ret2=`grep -c SRR1222430.2 tmp/klebsiella_6_2_2_qual_thres.fq`
+
+test $ret1 -eq 2 || exit 220
+test $ret2 -eq 2 || exit 220
+
+ret1=`grep -c SRR1222430.3 tmp/klebsiella_6_1_2_qual_thres.fq`
+ret2=`grep -c SRR1222430.3 tmp/klebsiella_6_2_2_qual_thres.fq`
+
+test $ret1 -eq 0 || exit 221
+test $ret2 -eq 0 || exit 221
+
+ret1=`grep -c SRR1222430.5 tmp/klebsiella_6_1_2_qual_thres.fq`
+ret2=`grep -c SRR1222430.5 tmp/klebsiella_6_2_2_qual_thres.fq`
+
+test $ret1 -eq 2 || exit 222
+test $ret2 -eq 2 || exit 222
+
+ret1=`grep -c SRR1222430.6 tmp/klebsiella_6_1_2_qual_thres.fq`
+ret2=`grep -c SRR1222430.6 tmp/klebsiella_6_2_2_qual_thres.fq`
+
+test $ret1 -eq 0 || exit 223
+test $ret2 -eq 0 || exit 223
+
+mv tmp/klebsiella_6_1_bad_scores.undefined.fq tmp/klebsiella_6_1_bad_scores.undefined.fq.lenient
+mv tmp/klebsiella_6_2_bad_scores.undefined.fq tmp/klebsiella_6_2_bad_scores.undefined.fq.lenient
+mv tmp/klebsiella_6_1_2_qual_thres.fq tmp/klebsiella_6_1_2_qual_thres.fq.lenient
+mv tmp/klebsiella_6_2_2_qual_thres.fq tmp/klebsiella_6_2_2_qual_thres.fq.lenient
+
+echo " Now use the scrict filter on the same data and check that the only difference is read SRR1222430.6 that should be kept by scrict filter"
+
+../src/rock -C 100 -c 1 -l 2 -q 2 -m 2 -p 1 -o ${srcdir}/data/iofiles.args/output_files_2_PE_separated_lenient.txt ${srcdir}/data/fastq.raw/klebsiella_6_1_bad_scores.fq,${srcdir}/data/fastq.raw/klebsiella_6_2_bad_scores.fq >/dev/null || exit 224
+
+ret1=`diff tmp/klebsiella_6_1_bad_scores.undefined.fq tmp/klebsiella_6_1_bad_scores.undefined.fq.lenient|wc -l`
+test $ret1 -eq 0 ||exit 225
+
+ret2=`diff tmp/klebsiella_6_2_bad_scores.undefined.fq tmp/klebsiella_6_2_bad_scores.undefined.fq.lenient|wc -l`
+test $ret2 -eq 0 ||exit 226
+
+ret3=`diff tmp/klebsiella_6_1_2_qual_thres.fq tmp/klebsiella_6_1_2_qual_thres.fq.lenient|grep -c SRR1222430.6`
+test $ret3 -eq 2 ||exit 227
+
+ret4=`diff tmp/klebsiella_6_1_2_qual_thres.fq tmp/klebsiella_6_1_2_qual_thres.fq.lenient|wc -l`
+test $ret4 -eq 5 || exit 228 # put 5 because there are 4 lines for 1 read and 1rts line that looks like: "9,12d8"
+
+ret5=`diff tmp/klebsiella_6_2_2_qual_thres.fq tmp/klebsiella_6_2_2_qual_thres.fq.lenient|grep -c SRR1222430.6`
+test $ret5 -eq 2 ||exit 229
+
+ret6=`diff tmp/klebsiella_6_2_2_qual_thres.fq tmp/klebsiella_6_2_2_qual_thres.fq.lenient|wc -l`
+test $ret6 -eq 5 || exit 230
+
+
+
+rm -f tmp/klebsiella_6_1_bad_scores.undefined.fq
+rm -f tmp/klebsiella_6_2_bad_scores.undefined.fq
+rm -f tmp/klebsiella_6_1_2_qual_thres.fq
+rm -f tmp/klebsiella_6_2_2_qual_thres.fq
+rm -fr tmp/klebsiella_6_1_bad_scores.undefined.fq.lenient
+rm -fr tmp/klebsiella_6_2_bad_scores.undefined.fq.lenient
+rm -fr tmp/klebsiella_6_1_2_qual_thres.fq.lenient
+rm -fr tmp/klebsiella_6_2_2_qual_thres.fq.lenient
+
+
 
 rm -fr tmp
 
@@ -389,7 +571,9 @@ rm -fr tmp
 echo " "
 echo "##################################################################################"
 echo "unit testing for cms component"
-../src/unit_test_cms || exit 24
+../src/unit_test_cms || exit 240
+
+exit 0