NVBIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
params.h
Go to the documentation of this file.
1 /*
2  * nvbio
3  * Copyright (c) 2011-2014, NVIDIA CORPORATION. All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * * Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * * Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * * Neither the name of the NVIDIA CORPORATION nor the
13  * names of its contributors may be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  * DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 #pragma once
29 
31 #include <string.h>
32 #include <string>
33 #include <map>
34 
35 namespace nvbio {
36 namespace bowtie2 {
37 namespace cuda {
38 
41 
46 };
47 
51 };
52 
53 static const char* s_mapping_mode[] = {
54  "best",
55  "best-exact",
56  "all"
57 };
58 inline const char* mapping_mode(const uint32 mode)
59 {
60  return s_mapping_mode[ mode ];
61 }
62 
63 inline uint32 mapping_mode(const char* str)
64 {
65  if (strcmp( str, "best" ) == 0)
66  return BestMappingApprox;
67  else if (strcmp( str, "best-exact" ) == 0)
68  return BestMappingExact;
69  else
70  return AllMapping;
71 }
72 
73 static const char* s_scoring_mode[] = {
74  "ed",
75  "sw"
76 };
77 inline const char* scoring_mode(const uint32 mode)
78 {
79  return s_scoring_mode[ mode ];
80 }
81 
82 inline uint32 scoring_mode(const char* str)
83 {
84  if (strcmp( str, "ed" ) == 0)
85  return EditDistanceMode;
86  else if (strcmp( str, "sw" ) == 0)
87  return SmithWatermanMode;
88  else
89  return EditDistanceMode;
90 }
91 
95 struct ParamsPOD
96 {
97  bool keep_stats;
98  bool randomized;
99  bool fw;
100  bool rc;
122 
123  // paired-end options
131 
132  // Scoring scheme
134 
135  // Internal fields
138 };
139 
143 struct Params : public ParamsPOD
144 {
145  std::string report;
146  std::string scoring_file;
147 
151  std::string persist_file;
152 
154 };
155 
159 std::map<std::string,std::string> load_options(const char* name);
160 
164 void parse_options(Params& params, const std::map<std::string,std::string>& options, bool init);
165 
167 
168 } // namespace cuda
169 } // namespace bowtie2
170 } // namespace nvbio