36 | 36 |
//addOption("log", Option(Option::Boolean, "L", "Output", "Log scale distances and divide by k-mer size to provide a better analog to phylogenetic distance. The special case of zero shared min-hashes will result in a distance of 1.", ""));
|
37 | 37 |
addOption("pvalue", Option(Option::Number, "v", "Output", "Maximum p-value to report.", "1.0", 0., 1.));
|
38 | 38 |
addOption("distance", Option(Option::Number, "d", "Output", "Maximum distance to report.", "1.0", 0., 1.));
|
|
39 |
addOption("comment", Option(Option::Boolean, "C", "Output", "Show comment fields with reference/query names (denoted with ':').", "1.0", 0., 1.));
|
39 | 40 |
useSketchOptions();
|
40 | 41 |
}
|
41 | 42 |
|
|
50 | 51 |
int threads = options.at("threads").getArgumentAsNumber();
|
51 | 52 |
bool list = options.at("list").active;
|
52 | 53 |
bool table = options.at("table").active;
|
|
54 |
bool comment = options.at("comment").active;
|
53 | 55 |
//bool log = options.at("log").active;
|
54 | 56 |
double pValueMax = options.at("pvalue").getArgumentAsNumber();
|
55 | 57 |
double distanceMax = options.at("distance").getArgumentAsNumber();
|
|
224 | 226 |
|
225 | 227 |
while ( threadPool.outputAvailable() )
|
226 | 228 |
{
|
227 | |
writeOutput(threadPool.popOutputWhenAvailable(), table);
|
|
229 |
writeOutput(threadPool.popOutputWhenAvailable(), table, comment);
|
228 | 230 |
}
|
229 | 231 |
}
|
230 | 232 |
|
231 | 233 |
while ( threadPool.running() )
|
232 | 234 |
{
|
233 | |
writeOutput(threadPool.popOutputWhenAvailable(), table);
|
|
235 |
writeOutput(threadPool.popOutputWhenAvailable(), table, comment);
|
234 | 236 |
}
|
235 | 237 |
|
236 | 238 |
if ( warningCount > 0 && ! parameters.reads )
|
|
241 | 243 |
return 0;
|
242 | 244 |
}
|
243 | 245 |
|
244 | |
void CommandDistance::writeOutput(CompareOutput * output, bool table) const
|
|
246 |
void CommandDistance::writeOutput(CompareOutput * output, bool table, bool comment) const
|
245 | 247 |
{
|
246 | 248 |
uint64_t i = output->indexQuery;
|
247 | 249 |
uint64_t j = output->indexRef;
|
|
266 | 268 |
}
|
267 | 269 |
else if ( pair->pass )
|
268 | 270 |
{
|
269 | |
cout << output->sketchRef.getReference(j).name << '\t' << output->sketchQuery.getReference(i).name << '\t' << pair->distance << '\t' << pair->pValue << '\t' << pair->numer << '/' << pair->denom << endl;
|
|
271 |
cout << output->sketchRef.getReference(j).name;
|
|
272 |
|
|
273 |
if ( comment )
|
|
274 |
{
|
|
275 |
cout << ':' << output->sketchRef.getReference(j).comment;
|
|
276 |
}
|
|
277 |
|
|
278 |
cout << '\t' << output->sketchQuery.getReference(i).name;
|
|
279 |
|
|
280 |
if ( comment )
|
|
281 |
{
|
|
282 |
cout << ':' << output->sketchQuery.getReference(i).comment;
|
|
283 |
}
|
|
284 |
|
|
285 |
cout << '\t' << pair->distance << '\t' << pair->pValue << '\t' << pair->numer << '/' << pair->denom << endl;
|
270 | 286 |
}
|
271 | 287 |
|
272 | 288 |
j++;
|