]> git.donarmstrong.com Git - mothur.git/blobdiff - slayer.h
working on chimeraslayer and found bug in shared command.
[mothur.git] / slayer.h
index e898989b17fa73020a367fef11fa1d3b0f688565..ea79727561fbfad37dfaf1478276e529b79df22b 100644 (file)
--- a/slayer.h
+++ b/slayer.h
 /***********************************************************************/
 //This class was modeled after the chimeraSlayer written by the Broad Institute
 /***********************************************************************/
-struct data_struct { //not right needs work...
-       int regionStart;
-       int regionEnd;
-       string parent;
-       float queryToParent;
-       float queryToParentLocal;
-       float divR;
+struct data_struct { //this is crazy big...but follow original.
+       float divr_qla_qrb;
+       float divr_qlb_qra;
+       float qla_qrb;
+       float qlb_qra;
+       float qla;
+       float qrb;
+       float ab; 
+       float qa;
+       float qb; 
+       float lab; 
+       float rab; 
+       float qra; 
+       float qlb; 
+       int winLStart;
+       int winLEnd; 
+       int winRStart; 
+       int winREnd; 
+       Sequence querySeq; 
+       Sequence parentA;
+       Sequence parentB;
+       float bsa;
+       float bsb;
+       float bsMax;
+       float chimeraMax;
+       
 };
 /***********************************************************************/
+//sorts lowest to highest first by bsMax, then if tie by chimeraMax
+inline bool compareDataStruct(data_struct left, data_struct right){
+       if (left.bsMax < right.bsMax) { return true; }
+       else if (left.bsMax == right.bsMax) {
+               return (left.chimeraMax < right.chimeraMax);
+       }else { return false;   }
+} 
+/***********************************************************************/
+struct snps { 
+       char queryChar;
+       char parentAChar;
+       char parentBChar;
+};
+
+/***********************************************************************/
 
 
 class Slayer {
@@ -33,21 +67,25 @@ class Slayer {
                Slayer(int, int, int, float);
                ~Slayer() {};
                
-               void getResults(Sequence*, vector<Sequence*>);
-               //float getPercentID() {        return percentIdenticalQueryChimera;    }
-               //vector<results> getOutput()  {        return outputResults;                   }
+               string getResults(Sequence*, vector<Sequence*>);
+               vector<data_struct> getOutput()  {      return outputResults;                   }
                
                                
        private:
                
                int windowSize, windowStep, parentFragmentThreshold;
                float divRThreshold; 
+               vector<data_struct>  outputResults;
                
                void verticalFilter(vector<Sequence*>);
                float computePercentID(string, string, int, int);
                
                vector<data_struct> runBellerophon(Sequence*, Sequence*, Sequence*);
-               
+               vector<snps> getSNPS(string, string, string, int, int);
+               void bootstrapSNPS(vector<snps>, vector<snps>, float&, float&);
+               float snpQA(vector<snps>);
+               float snpQB(vector<snps>);
+               float snpAB(vector<snps>);
                                
 };