jpayne@69: // Copyright © 2015, Battelle National Biodefense Institute (BNBI); jpayne@69: // all rights reserved. Authored by: Brian Ondov, Todd Treangen, jpayne@69: // Sergey Koren, and Adam Phillippy jpayne@69: // jpayne@69: // See the LICENSE.txt file included with this software for license information. jpayne@69: jpayne@69: #ifndef INCLUDED_CommandTriangle jpayne@69: #define INCLUDED_CommandTriangle jpayne@69: jpayne@69: #include "Command.h" jpayne@69: #include "CommandDistance.h" jpayne@69: #include "Sketch.h" jpayne@69: jpayne@69: namespace mash { jpayne@69: jpayne@69: class CommandTriangle : public Command jpayne@69: { jpayne@69: public: jpayne@69: jpayne@69: struct TriangleInput jpayne@69: { jpayne@69: TriangleInput(const Sketch & sketchNew, uint64_t indexNew, const Sketch::Parameters & parametersNew, double maxDistanceNew, double maxPValueNew) jpayne@69: : jpayne@69: sketch(sketchNew), jpayne@69: index(indexNew), jpayne@69: parameters(parametersNew), jpayne@69: maxDistance(maxDistanceNew), jpayne@69: maxPValue(maxPValueNew) jpayne@69: {} jpayne@69: jpayne@69: const Sketch & sketch; jpayne@69: uint64_t index; jpayne@69: const Sketch::Parameters & parameters; jpayne@69: double maxDistance; jpayne@69: double maxPValue; jpayne@69: }; jpayne@69: jpayne@69: struct TriangleOutput jpayne@69: { jpayne@69: TriangleOutput(const Sketch & sketchNew, uint64_t indexNew) jpayne@69: : jpayne@69: sketch(sketchNew), jpayne@69: index(indexNew) jpayne@69: { jpayne@69: pairs = new CommandDistance::CompareOutput::PairOutput[index]; jpayne@69: } jpayne@69: jpayne@69: ~TriangleOutput() jpayne@69: { jpayne@69: delete [] pairs; jpayne@69: } jpayne@69: jpayne@69: const Sketch & sketch; jpayne@69: uint64_t index; jpayne@69: jpayne@69: CommandDistance::CompareOutput::PairOutput * pairs; jpayne@69: }; jpayne@69: jpayne@69: CommandTriangle(); jpayne@69: jpayne@69: int run() const; // override jpayne@69: jpayne@69: private: jpayne@69: jpayne@69: double pValueMax; jpayne@69: bool comment; jpayne@69: jpayne@69: void writeOutput(TriangleOutput * output, bool comment, bool edge, double & pValuePeakToSet) const; jpayne@69: }; jpayne@69: jpayne@69: CommandTriangle::TriangleOutput * compare(CommandTriangle::TriangleInput * input); jpayne@69: jpayne@69: } // namespace mash jpayne@69: jpayne@69: #endif