1 /**
2 * UGENE - Integrated Bioinformatics Tools.
3 * Copyright (C) 2008-2021 UniPro <ugene@unipro.ru>
4 * http://ugene.net
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 * MA 02110-1301, USA.
20 */
21
22 #include "Metaphlan2SupportPlugin.h"
23
24 #include <U2Core/AppContext.h>
25 #include <U2Core/U2SafePoints.h>
26
27 #include "Metaphlan2Support.h"
28 #include "Metaphlan2WorkerFactory.h"
29
30 namespace U2 {
31
32 const QString MetaphlanSupportPlugin::PLUGIN_NAME = QCoreApplication::translate("MetaphlanSupportPlugin", "MetaPhlAn2 external tool support");
33 const QString MetaphlanSupportPlugin::PLUGIN_DESCRIPRION = QCoreApplication::translate("MetaphlanSupportPlugin", "MetaPhlAn2 (METAgenomic PHyLogenetic ANalysis) is a tool for profiling the composition of microbial communities (bacteria, archaea, eukaryotes, and viruses) from whole-metagenome shotgun sequencing data.");
34
U2_PLUGIN_INIT_FUNC()35 extern "C" Q_DECL_EXPORT Plugin *U2_PLUGIN_INIT_FUNC() {
36 MetaphlanSupportPlugin *plugin = new MetaphlanSupportPlugin();
37 return plugin;
38 }
39
MetaphlanSupportPlugin()40 MetaphlanSupportPlugin::MetaphlanSupportPlugin()
41 : Plugin(PLUGIN_NAME, PLUGIN_DESCRIPRION) {
42 ExternalToolRegistry *etRegistry = AppContext::getExternalToolRegistry();
43 CHECK(nullptr != etRegistry, );
44
45 etRegistry->registerEntry(new Metaphlan2Support(Metaphlan2Support::TOOL_ID, Metaphlan2Support::TOOL_NAME));
46
47 LocalWorkflow::Metaphlan2WorkerFactory::init();
48 }
49
~MetaphlanSupportPlugin()50 MetaphlanSupportPlugin::~MetaphlanSupportPlugin() {
51 ExternalToolRegistry *etRegistry = AppContext::getExternalToolRegistry();
52 CHECK(nullptr != etRegistry, );
53
54 etRegistry->unregisterEntry(Metaphlan2Support::TOOL_ID);
55 }
56
57 } // namespace U2
58