-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
1,734 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/**** | ||
DIAMOND protein aligner | ||
Copyright (C) 2020 QIAGEN A/S (Aarhus, Denmark) | ||
Code developed by Patrick Ettenhuber <[email protected]> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
****/ | ||
|
||
#pragma once | ||
#include <string> | ||
class ClusteringAlgorithm { | ||
public: | ||
virtual void run() = 0; | ||
virtual std::string get_key() = 0; | ||
virtual std::string get_description() = 0; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/**** | ||
DIAMOND protein aligner | ||
Copyright (C) 2020 QIAGEN A/S (Aarhus, Denmark) | ||
Code developed by Patrick Ettenhuber <[email protected]> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
****/ | ||
|
||
#include "cluster_registry.h" | ||
|
||
using namespace std; | ||
|
||
namespace Workflow { namespace Cluster{ | ||
map<string, ClusteringAlgorithm*> ClusterRegistry::regMap; | ||
MCL ClusterRegistry::mcl; | ||
MultiStep ClusterRegistry::multiStep; | ||
ClusterRegistry::StaticConstructor ClusterRegistry::_staticConstructor; | ||
}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/**** | ||
DIAMOND protein aligner | ||
Copyright (C) 2020 QIAGEN A/S (Aarhus, Denmark) | ||
Code developed by Patrick Ettenhuber <[email protected]> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
****/ | ||
|
||
#pragma once | ||
#include "cluster.h" | ||
#include "mcl.h" | ||
#include "multi_step_cluster.h" | ||
|
||
using namespace std; | ||
|
||
namespace Workflow { namespace Cluster{ | ||
class ClusterRegistry{ | ||
private: | ||
ClusterRegistry(){}; | ||
// To include new clustering algorithms add the instantiation here and in the cluster_registry.cpp file. Then add it to the StaticConstructor below | ||
static MCL mcl; | ||
static MultiStep multiStep; | ||
public: | ||
static map<string, ClusteringAlgorithm*> regMap; | ||
static ClusteringAlgorithm* get(string key){ | ||
map<string, ClusteringAlgorithm*>::iterator ca = ClusterRegistry::regMap.find(key); | ||
if(ca == ClusterRegistry::regMap.end()){ | ||
throw std::runtime_error("Clustering algorithm not found."); | ||
} | ||
return ca->second; | ||
} | ||
static bool has(string key){ | ||
return ClusterRegistry::regMap.find(key) != ClusterRegistry::regMap.end(); | ||
} | ||
static vector<string> getKeys(){ | ||
auto it = regMap.begin(); | ||
vector<string> keys; | ||
while(it != regMap.end()){ | ||
keys.push_back(it->first); | ||
it++; | ||
} | ||
return keys; | ||
} | ||
static struct StaticConstructor { | ||
StaticConstructor() { | ||
// Add any new clustering algorithm here | ||
regMap.emplace(multiStep.get_key(), &multiStep); | ||
regMap.emplace(mcl.get_key(), &mcl); | ||
} | ||
} _staticConstructor; | ||
}; | ||
|
||
}} |
Oops, something went wrong.