Mercurial > repos > rliterman > csp2
annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/include/mash/CommandTriangle.h @ 69:33d812a61356
planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author | jpayne |
---|---|
date | Tue, 18 Mar 2025 17:55:14 -0400 |
parents | |
children |
rev | line source |
---|---|
jpayne@69 | 1 // Copyright © 2015, Battelle National Biodefense Institute (BNBI); |
jpayne@69 | 2 // all rights reserved. Authored by: Brian Ondov, Todd Treangen, |
jpayne@69 | 3 // Sergey Koren, and Adam Phillippy |
jpayne@69 | 4 // |
jpayne@69 | 5 // See the LICENSE.txt file included with this software for license information. |
jpayne@69 | 6 |
jpayne@69 | 7 #ifndef INCLUDED_CommandTriangle |
jpayne@69 | 8 #define INCLUDED_CommandTriangle |
jpayne@69 | 9 |
jpayne@69 | 10 #include "Command.h" |
jpayne@69 | 11 #include "CommandDistance.h" |
jpayne@69 | 12 #include "Sketch.h" |
jpayne@69 | 13 |
jpayne@69 | 14 namespace mash { |
jpayne@69 | 15 |
jpayne@69 | 16 class CommandTriangle : public Command |
jpayne@69 | 17 { |
jpayne@69 | 18 public: |
jpayne@69 | 19 |
jpayne@69 | 20 struct TriangleInput |
jpayne@69 | 21 { |
jpayne@69 | 22 TriangleInput(const Sketch & sketchNew, uint64_t indexNew, const Sketch::Parameters & parametersNew, double maxDistanceNew, double maxPValueNew) |
jpayne@69 | 23 : |
jpayne@69 | 24 sketch(sketchNew), |
jpayne@69 | 25 index(indexNew), |
jpayne@69 | 26 parameters(parametersNew), |
jpayne@69 | 27 maxDistance(maxDistanceNew), |
jpayne@69 | 28 maxPValue(maxPValueNew) |
jpayne@69 | 29 {} |
jpayne@69 | 30 |
jpayne@69 | 31 const Sketch & sketch; |
jpayne@69 | 32 uint64_t index; |
jpayne@69 | 33 const Sketch::Parameters & parameters; |
jpayne@69 | 34 double maxDistance; |
jpayne@69 | 35 double maxPValue; |
jpayne@69 | 36 }; |
jpayne@69 | 37 |
jpayne@69 | 38 struct TriangleOutput |
jpayne@69 | 39 { |
jpayne@69 | 40 TriangleOutput(const Sketch & sketchNew, uint64_t indexNew) |
jpayne@69 | 41 : |
jpayne@69 | 42 sketch(sketchNew), |
jpayne@69 | 43 index(indexNew) |
jpayne@69 | 44 { |
jpayne@69 | 45 pairs = new CommandDistance::CompareOutput::PairOutput[index]; |
jpayne@69 | 46 } |
jpayne@69 | 47 |
jpayne@69 | 48 ~TriangleOutput() |
jpayne@69 | 49 { |
jpayne@69 | 50 delete [] pairs; |
jpayne@69 | 51 } |
jpayne@69 | 52 |
jpayne@69 | 53 const Sketch & sketch; |
jpayne@69 | 54 uint64_t index; |
jpayne@69 | 55 |
jpayne@69 | 56 CommandDistance::CompareOutput::PairOutput * pairs; |
jpayne@69 | 57 }; |
jpayne@69 | 58 |
jpayne@69 | 59 CommandTriangle(); |
jpayne@69 | 60 |
jpayne@69 | 61 int run() const; // override |
jpayne@69 | 62 |
jpayne@69 | 63 private: |
jpayne@69 | 64 |
jpayne@69 | 65 double pValueMax; |
jpayne@69 | 66 bool comment; |
jpayne@69 | 67 |
jpayne@69 | 68 void writeOutput(TriangleOutput * output, bool comment, bool edge, double & pValuePeakToSet) const; |
jpayne@69 | 69 }; |
jpayne@69 | 70 |
jpayne@69 | 71 CommandTriangle::TriangleOutput * compare(CommandTriangle::TriangleInput * input); |
jpayne@69 | 72 |
jpayne@69 | 73 } // namespace mash |
jpayne@69 | 74 |
jpayne@69 | 75 #endif |