/usr/include/mash/CommandDistance.h is in libmash-dev 2.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | // Copyright © 2015, Battelle National Biodefense Institute (BNBI);
// all rights reserved. Authored by: Brian Ondov, Todd Treangen,
// Sergey Koren, and Adam Phillippy
//
// See the LICENSE.txt file included with this software for license information.
#ifndef INCLUDED_CommandDistance
#define INCLUDED_CommandDistance
#include "Command.h"
#include "Sketch.h"
namespace mash {
class CommandDistance : public Command
{
public:
struct CompareInput
{
CompareInput(const Sketch & sketchRefNew, const Sketch & sketchQueryNew, uint64_t indexRefNew, uint64_t indexQueryNew, uint64_t pairCountNew, const Sketch::Parameters & parametersNew, double maxDistanceNew, double maxPValueNew)
:
sketchRef(sketchRefNew),
sketchQuery(sketchQueryNew),
indexRef(indexRefNew),
indexQuery(indexQueryNew),
pairCount(pairCountNew),
parameters(parametersNew),
maxDistance(maxDistanceNew),
maxPValue(maxPValueNew)
{}
const Sketch & sketchRef;
const Sketch & sketchQuery;
uint64_t indexRef;
uint64_t indexQuery;
uint64_t pairCount;
const Sketch::Parameters & parameters;
double maxDistance;
double maxPValue;
};
struct CompareOutput
{
CompareOutput(const Sketch & sketchRefNew, const Sketch & sketchQueryNew, uint64_t indexRefNew, uint64_t indexQueryNew, uint64_t pairCountNew)
:
sketchRef(sketchRefNew),
sketchQuery(sketchQueryNew),
indexRef(indexRefNew),
indexQuery(indexQueryNew),
pairCount(pairCountNew)
{
pairs = new PairOutput[pairCount];
}
~CompareOutput()
{
delete [] pairs;
}
struct PairOutput
{
uint64_t numer;
uint64_t denom;
double distance;
double pValue;
bool pass;
};
const Sketch & sketchRef;
const Sketch & sketchQuery;
uint64_t indexRef;
uint64_t indexQuery;
uint64_t pairCount;
PairOutput * pairs;
};
CommandDistance();
int run() const; // override
private:
void writeOutput(CompareOutput * output, bool table) const;
};
CommandDistance::CompareOutput * compare(CommandDistance::CompareInput * input);
void compareSketches(CommandDistance::CompareOutput::PairOutput * output, const Sketch::Reference & refRef, const Sketch::Reference & refQry, uint64_t sketchSize, int kmerSize, double kmerSpace, double maxDistance, double maxPValue);
double pValue(uint64_t x, uint64_t lengthRef, uint64_t lengthQuery, double kmerSpace, uint64_t sketchSize);
} // namespace mash
#endif
|