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 "AvgQualStep.h"
23 
24 #include <U2Core/U2SafePoints.h>
25 
26 #include "trimmomatic/util/QualitySettingsWidget.h"
27 
28 namespace U2 {
29 namespace LocalWorkflow {
30 
31 const QString AvgQualStepFactory::ID = "AVGQUAL";
32 
AvgQualStep()33 AvgQualStep::AvgQualStep()
34     : TrimmomaticStep(AvgQualStepFactory::ID) {
35     name = "AVGQUAL";
36     description = tr("<html><head></head><body>"
37                      "<h4>AVGQUAL</h4>"
38                      "<p>This step drops a read if the average quality is below the specified level.</p>"
39                      "<p>Input the following values:</p>"
40                      "<ul>"
41                      "<li><b>Quality threshold</b>: the minimum average quality required to keep a read.</li>"
42                      "</ul>"
43                      "</body></html>");
44 }
45 
createWidget() const46 TrimmomaticStepSettingsWidget *AvgQualStep::createWidget() const {
47     return new QualitySettingsWidget(tr("The minimum average quality required to keep a read."));
48 }
49 
serializeState(const QVariantMap & widgetState) const50 QString AvgQualStep::serializeState(const QVariantMap &widgetState) const {
51     return QualitySettingsWidget::serializeState(widgetState);
52 }
53 
parseState(const QString & command) const54 QVariantMap AvgQualStep::parseState(const QString &command) const {
55     return QualitySettingsWidget::parseState(command, id);
56 }
57 
AvgQualStepFactory()58 AvgQualStepFactory::AvgQualStepFactory()
59     : TrimmomaticStepFactory(ID) {
60 }
61 
createStep() const62 AvgQualStep *AvgQualStepFactory::createStep() const {
63     return new AvgQualStep();
64 }
65 
66 }    // namespace LocalWorkflow
67 }    // namespace U2
68