X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=slayer.h;h=ea79727561fbfad37dfaf1478276e529b79df22b;hb=58cc09a375d1e1afceef3b036574ff21394ccc4d;hp=e898989b17fa73020a367fef11fa1d3b0f688565;hpb=05a0195e07c42c996592ee1c8abb63adedb7f493;p=mothur.git diff --git a/slayer.h b/slayer.h index e898989..ea79727 100644 --- a/slayer.h +++ b/slayer.h @@ -15,15 +15,49 @@ /***********************************************************************/ //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); - //float getPercentID() { return percentIdenticalQueryChimera; } - //vector getOutput() { return outputResults; } + string getResults(Sequence*, vector); + vector getOutput() { return outputResults; } private: int windowSize, windowStep, parentFragmentThreshold; float divRThreshold; + vector outputResults; void verticalFilter(vector); float computePercentID(string, string, int, int); vector runBellerophon(Sequence*, Sequence*, Sequence*); - + vector getSNPS(string, string, string, int, int); + void bootstrapSNPS(vector, vector, float&, float&); + float snpQA(vector); + float snpQB(vector); + float snpAB(vector); };