]> git.donarmstrong.com Git - mothur.git/blobdiff - clusterfragmentscommand.cpp
true chimera testing using reference sequences
[mothur.git] / clusterfragmentscommand.cpp
index f345d3d05ad9a28f49b6dffc3a61721f99289020..24070d2bb0e8b8f781eece4e35e7dec4f42d6797 100644 (file)
@@ -166,7 +166,7 @@ void ClusterFragmentsCommand::help(){
                m->mothurOut("The cluster.fragments command parameters are fasta, name, diffs and percent. The fasta parameter is required. \n");
                m->mothurOut("The names parameter allows you to give a list of seqs that are identical. This file is 2 columns, first column is name or representative sequence, second column is a list of its identical sequences separated by commas.\n");
                m->mothurOut("The diffs parameter allows you to set the number of differences allowed, default=0. \n");
-               m->mothurOut("The percent parameter allows you to set percentage of differences allowed, default=0. percent=2 means if the number of difference is less than two percent of the length of the fragment, then cluster.\n");
+               m->mothurOut("The percent parameter allows you to set percentage of differences allowed, default=0. percent=2 means if the number of difference is less than or equal to two percent of the length of the fragment, then cluster.\n");
                m->mothurOut("You may use diffs and percent at the same time to say something like: If the number or differences is greater than 1 or more than 2% of the fragment length, don't merge. \n");
                m->mothurOut("The cluster.fragments command should be in the following format: \n");
                m->mothurOut("cluster.fragments(fasta=yourFastaFile, names=yourNamesFile) \n");
@@ -213,7 +213,7 @@ int ClusterFragmentsCommand::execute(){
                                        if (alignSeqs[j].active) {  //this sequence has not been merged yet
                                                
                                                string jBases = alignSeqs[j].seq.getUnaligned();
-                                                                                               
+                                                                                                       
                                                if (isFragment(iBases, jBases)) {
                                                        //merge
                                                        alignSeqs[i].names += ',' + alignSeqs[j].names;
@@ -291,7 +291,7 @@ bool ClusterFragmentsCommand::isFragment(string seq1, string seq2){
                                int percentDiff = floor((seq2.length() * (percent / 100.0)));
                                if (percentDiff < totalDiffs) { totalDiffs = percentDiff; }
                        }
-                               
+                       
                        Alignment* alignment = new NeedlemanOverlap(-1.0, 1.0, -1.0, (seq1.length()+totalDiffs+1));
                                                        
                        //use needleman to align 
@@ -314,6 +314,7 @@ bool ClusterFragmentsCommand::isFragment(string seq1, string seq2){
                        }
                        
                        if (numDiffs <= totalDiffs) { fragment = true; }
+                       
                }
                
                return fragment;