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 "BowtieSupport.h"
23 
24 #include <U2Core/AppContext.h>
25 
26 namespace U2 {
27 
28 // BowtieSupport
29 const QString BowtieSupport::ET_BOWTIE_ID = "USUPP_BOWTIE";
30 const QString BowtieSupport::ET_BOWTIE_BUILD_ID = "USUPP_BOWTIE_BUILD";
31 
getBowtieToolNameById(const QString & id)32 static QString getBowtieToolNameById(const QString &id) {
33     return id == BowtieSupport::ET_BOWTIE_ID ? "Bowtie aligner" : "Bowtie build indexer";
34 }
35 
BowtieSupport(const QString & id)36 BowtieSupport::BowtieSupport(const QString &id)
37     : ExternalTool(id, "bowtie1", getBowtieToolNameById(id)) {
38     if (AppContext::getMainWindow() != nullptr) {
39         icon = QIcon(":external_tool_support/images/cmdline.png");
40         grayIcon = QIcon(":external_tool_support/images/cmdline_gray.png");
41         warnIcon = QIcon(":external_tool_support/images/cmdline_warn.png");
42     }
43     if (id == ET_BOWTIE_ID) {
44 #ifdef Q_OS_WIN
45         executableFileName = "bowtie-align-s.exe";
46 #else
47         executableFileName = "bowtie-align-s";
48 #endif
49     } else {
50 #ifdef Q_OS_WIN
51         executableFileName = "bowtie-build-s.exe";
52 #else
53         executableFileName = "bowtie-build-s";
54 #endif
55     }
56     validationArguments.append("--version");
57     validMessage = "version";
58     description = tr("<i>Bowtie</i> is an ultrafast, memory-efficient short read aligner. "
59                      "It aligns short DNA sequences (reads) to the human genome at "
60                      "a rate of over 25 million 35-bp reads per hour. "
61                      "Bowtie indexes the genome with a Burrows-Wheeler index to keep "
62                      "its memory footprint small: typically about 2.2 GB for the human "
63                      "genome (2.9 GB for paired-end).");
64     versionRegExp = QRegExp("version (\\d+\\.\\d+\\.\\d+)");
65     toolKitName = "Bowtie";
66 }
67 
68 }    // namespace U2
69