File: param_tabs.cpp

package info (click to toggle)
seqan2 2.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 228,748 kB
  • sloc: cpp: 257,602; ansic: 91,967; python: 8,326; sh: 1,056; xml: 570; makefile: 229; awk: 51; javascript: 21
file content (48 lines) | stat: -rw-r--r-- 1,962 bytes parent folder | download | duplicates (2)
1
2
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
38
39
40
41
42
43
44
45
46
47
48
/*==========================================================================
             RazerS - Fast Read Mapping with Controlled Loss Rate
                   https://www.seqan.de/apps/razers3.html

 ============================================================================
  Copyright (C) 2012 by David Weese

  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 3 of the License, or (at your options) any later version.

  This program 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
  Lesser General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <https://www.gnu.org/licenses/>.
  ==========================================================================*/

#include <iostream>

#include "param_tabs.h"

// The 68k lines of parameters are included from another file.
static GappedParamsRecord RECORDS[] = {
     #include "param_tabs.inc"
};

bool getGappedParamsRecords(seqan2::String<GappedParamsRecord> & records,
                            unsigned n,
                            char errorModel)
{
    if (n < 15u || n > 75u)
        return false;  // We do not have parameter for these settings.
    if (errorModel != 'L' && errorModel != 'H')
        return false;  // Invalid error model.

    // We can iterate until readLength == 0 since the generator script creates
    // a terminator record with this property and read length 0 does not make
    // sense otherwise.
    for (unsigned i = 0; RECORDS[i].readLength != 0; ++i)
        if (RECORDS[i].readLength == n && RECORDS[i].type == errorModel)
            appendValue(records, RECORDS[i]);

    return true;
}