-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcsprRef.h
More file actions
64 lines (46 loc) · 1.89 KB
/
csprRef.h
File metadata and controls
64 lines (46 loc) · 1.89 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//
// csprRead.hpp
// CasperOffTarget
//
// Created by Brian Mendoza on 3/8/18.
// Copyright © 2018 University of Tennessee. All rights reserved.
//
#ifndef csprRead_h
#define csprRead_h
#include <stdio.h>
#include <vector>
#include <string>
#include "FileOp.h"
#include "CSeqTranslate.h"
using namespace std;
class csprRef {
public:
void LoadcsprFile(string name, string dbfile, int seq_l);
string *AccessRefString() { return &RefTargets; }
/*Obtaining information from the private containers. These ask for the index of the target you are searching for,
which means that the index of the RefTargets match is the input. All of these divide by 9 to first get the id
of the RefTargets target and then proceed to return the appropriate value. */
long getLoc(long l) { return Locs[l / 8]; }
int getChrScaf(long);
int getScore(long x) { return Scores[x / 8]; }
// returns the last id of the last chromosome before the multis so that anything greater is in the multis
long multiStart() { return multistart; }
vector<string> getMultis(long ind) { return multiLocs[ind]; }
int chromCount() { return Chrpos.size(); }
private:
//Base info from the .cspr file. This is a long string that has every target in succession.
string RefTargets;
//Also base info from .cspr file has the location and scores at the vector index of the Reftarget position
vector<long> Locs; //all decompressed locations in succession
vector<int> Scores; //all decompressed scores in succession
// Vector below stores the locations where the chromosome/scaffolds stop in RefTargets (number represents how many targets are in each)
vector<long> Chrpos;
//Stores the vectors of multi tails and their positions separated by commas
vector<vector<string>> multiLocs;
long multistart;
private:
void processMultis(string dbfile);
vector<string> Msplit(const string &text, char sep);
SeqTranslate S;
};
#endif /* csprRead_hpp */