8 * Created by Sarah Westcott on 7/9/09.
9 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
16 //This class was created using the algorythms described in the
17 // "At Least 1 in 20 16S rRNA Sequence Records Currently Held in the Public Repositories is Estimated To Contain Substantial Anomalies" paper
18 //by Kevin E. Ashelford 1, Nadia A. Chuzhanova 3, John C. Fry 1, Antonia J. Jones 2 and Andrew J. Weightman 1.
20 /***********************************************************/
22 class Pintail : public Chimera {
25 Pintail(string, string);
31 void setCons(string c) { consfile = c; }
32 void setQuantiles(string q) { quanfile = q; }
40 linePair(int i, int j) : start(i), end(j) {}
46 string fastafile, templateFile, consfile, quanfile;
48 vector<linePair*> lines;
49 vector<linePair*> templateLines;
50 vector<Sequence*> querySeqs;
51 vector<Sequence*> templateSeqs;
53 vector<Sequence> bestfit; //bestfit[0] matches queryseqs[0]...
55 vector< vector<float> > obsDistance; //obsDistance[0] is the vector of observed distances for queryseqs[0]...
56 vector< vector<float> > expectedDistance; //expectedDistance[0] is the vector of expected distances for queryseqs[0]...
57 vector<float> deviation; //deviation[0] is the percentage of mismatched pairs over the whole seq between querySeqs[0] and its best match.
58 vector< vector<int> > windowsForeachQuery; // windowsForeachQuery[0] is a vector containing the starting spot in queryseqs[0] aligned sequence for each window.
59 //this is needed so you can move by bases and not just spots in the alignment
61 vector<int> windowSizes; //windowSizes[0] = window size of querySeqs[0]
62 vector<int> windowSizesTemplate; //windowSizesTemplate[0] = window size of templateSeqs[0]
64 vector< map<int, int> > trimmed; //trimmed[0] = start and stop of trimmed sequences for querySeqs[0]
65 map<int, int>::iterator it;
67 vector< vector<float> > Qav; //Qav[0] is the vector of average variablility for queryseqs[0]...
68 vector<float> seqCoef; //seqCoef[0] is the coeff for queryseqs[0]...
69 vector<float> DE; //DE[0] is the deviaation for queryseqs[0]...
70 vector<float> probabilityProfile;
71 vector< vector<float> > quantiles; //quantiles[0] is the vector of deviations with ceiling score of 1, quantiles[1] is the vector of deviations with ceiling score of 2...
73 void trimSeqs(Sequence*, Sequence, map<int, int>&);
74 vector<float> readFreq();
75 vector< vector<float> > readQuantiles();
76 vector< vector<float> > getQuantiles(int, int);
77 vector<float> calcFreq(vector<Sequence*>);
79 vector<Sequence> findPairs(int, int);
80 vector<int> findWindows(Sequence*, int, int, int&);
81 vector<float> calcObserved(Sequence*, Sequence, vector<int>, int);
82 vector<float> calcExpected(vector<float>, float);
83 vector<float> findQav(vector<int>, int);
84 float calcDE(vector<float>, vector<float>);
85 float calcDist(Sequence*, Sequence, int, int);
86 float getCoef(vector<float>, vector<float>);
88 void createProcessesSpots();
89 void createProcesses();
90 void createProcessesQuan();
96 /***********************************************************/