forked from DiltheyLab/HLA-LA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpathFinder.h
executable file
·63 lines (50 loc) · 1.73 KB
/
pathFinder.h
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
/*
* pathFinder.h
*
* Created on: Dec 20, 2016
* Author: diltheyat
*/
#ifndef PATHFINDER_H_
#define PATHFINDER_H_
#include <string>
#include "Utilities.h"
#include <exception>
#include <stdexcept>
class pathFinder {
public:
pathFinder(const std::map<std::string, std::string>& arguments) : arguments(arguments)
{
}
virtual ~pathFinder();
std::string find_bwa() const
{
std::string forReturn;
forReturn = arguments.count("bwa_bin") ? arguments.at("bwa_bin") : Utilities::findFileFromAlternatives({"C:/Users/AlexanderDilthey/bwa/bwa.exe", "/home/dilthey/bwa/bwa/bwa", "/apps/well/bwa/0.7.12/bwa"});
if(! Utilities::fileExists(forReturn))
{
throw std::runtime_error("File " + forReturn + " not existing.");
}
assert(Utilities::fileExists(forReturn));
return forReturn;
// Utilities::findFileFromAlternatives({"C:/Users/AlexanderDilthey/bwa/bwa.exe", "/home/dilthey/bwa/bwa/bwa", "/apps/well/bwa/0.7.12/bwa"});
}
std::string find_bowtie() const
{
return Utilities::findFileFromAlternatives({"C:/Users/AlexanderDilthey/bowtie2-2.2.8", "/home/dilthey/bowtie2-2.2.8"});
}
std::string find_samtools() const
{
std::string forReturn;
forReturn = arguments.count("samtools_bin") ? arguments.at("samtools_bin") : Utilities::findFileFromAlternatives({"C:/Users/AlexanderDilthey/samtools/samtools-0.1.19/samtools.exe", "/home/dilthey/samtools-0.1.18/samtools"});
if(! Utilities::fileExists(forReturn))
{
throw std::runtime_error("File " + forReturn + " not existing.");
}
assert(Utilities::fileExists(forReturn));
return forReturn;
return forReturn;
}
protected:
const std::map<std::string, std::string>& arguments;
};
#endif /* PATHFINDER_H_ */