File: SALS.cpp

package info (click to toggle)
blasr 5.3%2B0-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,064 kB
  • sloc: cpp: 13,753; ansic: 614; python: 314; makefile: 237; xml: 201; sh: 72
file content (40 lines) | stat: -rw-r--r-- 995 bytes parent folder | download | duplicates (4)
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
#include <string>
#include <iostream>
#include "utils.hpp"
#include "suffixarray/SuffixArray.hpp"
#include "suffixarray/SuffixArrayTypes.hpp"

using namespace std;

int main(int argc, char* argv[]) {

    if (argc <= 1) {
        cout << "sals checks if a suffix array has lookup table or not." <<endl;
        cout << "usage sals genome.sa" <<endl;
        exit(1);
    }

    string saFileName = argv[1];

    DNASuffixArray sa;
    if (!sa.LightRead(saFileName)) {
        cout << "The file is not in a sa format." << endl;
        exit(1);
    }

    if (sa.componentList[DNASuffixArray::CompArray]) {
        cout << " * has a suffix array." << endl;
    }
    else {
        cout << " * does not contain a suffix array." << endl;
    }

    if (sa.componentList[DNASuffixArray::CompLookupTable]) {
        cout << " * has a lookup table for word size. " << sa.lookupPrefixLength 
            << endl;
    }  
    else {
        cout << " * does not have a lookup table." << endl;
    }
}