-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBed.cpp
More file actions
executable file
·43 lines (35 loc) · 973 Bytes
/
Bed.cpp
File metadata and controls
executable file
·43 lines (35 loc) · 973 Bytes
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
#include "Bed.h"
Bed::Bed (const std::string & s)
{
std::vector<std::string> v;
v.reserve(12); // max number of fields in BED
std::istringstream is(s);
std::string el;
char delim = ' ';
while (std::getline(is, el, delim))
{
v.push_back(el);
}
_ref = "0";
_start = 0;
_end = 0;
_name = ".";
_score = ".";
size_t n = 0;
if (v.size() > n) _ref = v.at(n++);
if (v.size() > n) _start = atoi(v.at(n++).c_str());
if (v.size() > n) _end = atoi(v.at(n++).c_str());
if (v.size() > n) _name = v.at(n++);
if (v.size() > n) _score = v.at(n++);
if (v.size() > n) _strand = v.at(n++)[0];
if (v.size() > n) _thickStart = atoi(v.at(n++).c_str());
if (v.size() > n) _thickEnd = atoi(v.at(n++).c_str());
// if (v.size() > n) _itemRgb = v.at(n++);
// if (v.size() > n) _blockCount = atoi(v.at(n++).c_str());
// if (v.size() > n) _blockSizes = atoi(v.at(n++).c_str());
// if (v.size() > n) _blockStarts = atoi(v.at(n++).c_str());
}
// do nothing
Bed::~Bed()
{
}