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
|
#include "sjdbLoadFromStream.h"
void sjdbLoadFromStream(ifstream &sjdbStreamIn, SjdbClass &sjdbLoci) {
while (sjdbStreamIn.good()) {
string oneLine,chr1;
uint u1,u2;
char str1;
getline(sjdbStreamIn,oneLine);
istringstream oneLineStream (oneLine);
oneLineStream >> chr1 >> u1 >> u2 >> str1;
if (chr1!="") {
sjdbLoci.chr.push_back(chr1);
sjdbLoci.start.push_back(u1);
sjdbLoci.end.push_back(u2);
switch (str1) {//convert numbers to symbols
case '1':
case '+':
str1='+';
break;
case '2':
case '-':
str1='-';
break;
default:
str1='.';
};
sjdbLoci.str.push_back(str1);
};
};
};
|