X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=slayer.h;h=33ccc3fda70ad9e6dca595eb626c0bb9e5dedc1c;hb=3b137af694d322b7162e97275c070c41b42597a3;hp=e898989b17fa73020a367fef11fa1d3b0f688565;hpb=05a0195e07c42c996592ee1c8abb63adedb7f493;p=mothur.git diff --git a/slayer.h b/slayer.h index e898989..33ccc3f 100644 --- a/slayer.h +++ b/slayer.h @@ -15,39 +15,79 @@ /***********************************************************************/ //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 { public: - Slayer(int, int, int, float); + Slayer(int, int, int, float, int, int); ~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; + int windowSize, windowStep, parentFragmentThreshold, iters, percentSNPSample; float divRThreshold; + vector outputResults; + vector< map > baseSpots; - void verticalFilter(vector); + map verticalFilter(vector); float computePercentID(string, string, int, int); - vector runBellerophon(Sequence*, Sequence*, Sequence*); - + vector runBellerophon(Sequence*, Sequence*, Sequence*, map&); + vector getSNPS(string, string, string, int, int); + int bootstrapSNPS(vector, vector, float&, float&); + float snpQA(vector); + float snpQB(vector); + float snpAB(vector); + MothurOut* m; };