presets.cpp 2.84 KB
Newer Older
1
/*
2
 * Copyright 2011, Ben Langmead <langmea@cs.jhu.edu>
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
 *
 * This file is part of Bowtie 2.
 *
 * Bowtie 2 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.
 *
 * Bowtie 2 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 Bowtie 2.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <iostream>
#include "presets.h"
#include "opts.h"

using namespace std;

void PresetsV0::apply(
	const std::string& preset,
	std::string& policy,
	EList<std::pair<int, std::string> >& opts)
{
	// Presets:                 Same as:
	//  For --end-to-end:
	//   --very-fast            -M 5 -R 1 -N 0 -L 22 -i S,1,2.50
	//   --fast                 -M 10 -R 2 -N 0 -L 22 -i S,1,2.50
	//   --sensitive            -M 15 -R 2 -N 0 -L 22 -i S,1,1.15
	//   --very-sensitive       -M 25 -R 3 -N 0 -L 19 -i S,1,0.50
	if(preset == "very-fast") {
38 39
		policy += ";SEED=0";
		policy += ";SEEDLEN=22";
40 41 42 43
		policy += ";DPS=5";
		policy += ";ROUNDS=1";
		policy += ";IVAL=S,0,2.50";
	} else if(preset == "fast") {
44 45
		policy += ";SEED=0";
		policy += ";SEEDLEN=22";
46 47 48 49
		policy += ";DPS=10";
		policy += ";ROUNDS=2";
		policy += ";IVAL=S,0,2.50";
	} else if(preset == "sensitive") {
50 51
		policy += ";SEED=0";
		policy += ";SEEDLEN=22";
52 53 54 55
		policy += ";DPS=15";
		policy += ";ROUNDS=2";
		policy += ";IVAL=S,1,1.15";
	} else if(preset == "very-sensitive") {
56 57
		policy += ";SEED=0";
		policy += ";SEEDLEN=20";
58 59 60 61 62 63 64 65 66 67
		policy += ";DPS=20";
		policy += ";ROUNDS=3";
		policy += ";IVAL=S,1,0.50";
	}
	//  For --local:
	//   --very-fast-local      -M 1 -N 0 -L 25 -i S,1,2.00
	//   --fast-local           -M 2 -N 0 -L 22 -i S,1,1.75
	//   --sensitive-local      -M 2 -N 0 -L 20 -i S,1,0.75 (default)
	//   --very-sensitive-local -M 3 -N 0 -L 20 -i S,1,0.50
	else if(preset == "very-fast-local") {
68 69
		policy += ";SEED=0";
		policy += ";SEEDLEN=25";
70 71 72 73
		policy += ";DPS=5";
		policy += ";ROUNDS=1";
		policy += ";IVAL=S,1,2.00";
	} else if(preset == "fast-local") {
74 75
		policy += ";SEED=0";
		policy += ";SEEDLEN=22";
76 77 78 79
		policy += ";DPS=10";
		policy += ";ROUNDS=2";
		policy += ";IVAL=S,1,1.75";
	} else if(preset == "sensitive-local") {
80 81
		policy += ";SEED=0";
		policy += ";SEEDLEN=20";
82 83 84 85
		policy += ";DPS=15";
		policy += ";ROUNDS=2";
		policy += ";IVAL=S,1,0.75";
	} else if(preset == "very-sensitive-local") {
86 87
		policy += ";SEED=0";
		policy += ";SEEDLEN=20";
88 89 90 91 92
		policy += ";DPS=20";
		policy += ";ROUNDS=3";
		policy += ";IVAL=S,1,0.50";
	}
	else {
93
		cerr << "Unknown preset: " << preset.c_str() << endl;
94 95
	}
}