X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=parseIt.cpp;h=c760c79f879775450e4677951d3ee25774a7ffcc;hb=4496388fd52d4354c746f36b1998477f31c2b0dd;hp=e05585d43f5a6a897f874f90506a8add3bc3e571;hpb=3ec78aa9af79921c44d62b65f88865a4b65880be;p=rsem.git diff --git a/parseIt.cpp b/parseIt.cpp index e05585d..c760c79 100644 --- a/parseIt.cpp +++ b/parseIt.cpp @@ -13,9 +13,7 @@ #include "utils.h" #include "GroupInfo.h" - -#include "RefSeq.h" -#include "Refs.h" +#include "Transcripts.h" #include "SingleRead.h" #include "SingleReadQ.h" @@ -30,16 +28,16 @@ using namespace std; int read_type; // 0 SingleRead, 1 SingleReadQ, 2 PairedEndRead, 3 PairedEndReadQ -int N[3]; // note, N = N0 + N1 + N2 , but may not be equal to the total number of reads in data -int nHits; // # of hits -int nUnique, nMulti, nIsoMulti; +READ_INT_TYPE N[3]; // note, N = N0 + N1 + N2 , but may not be equal to the total number of reads in data +HIT_INT_TYPE nHits; // # of hits +READ_INT_TYPE nUnique, nMulti, nIsoMulti; char fn_list[STRLEN]; -char refF[STRLEN], groupF[STRLEN]; +char groupF[STRLEN], tiF[STRLEN]; char imdName[STRLEN]; char datF[STRLEN], cntF[STRLEN]; -Refs refs; GroupInfo gi; +Transcripts transcripts; SamParser *parser; ofstream hit_out; @@ -48,14 +46,14 @@ int n_os; // number of ostreams ostream *cat[3][2]; // cat : category 1-dim 0 N0 1 N1 2 N2; 2-dim 0 mate1 1 mate2 char readOutFs[3][2][STRLEN]; -map counter; -map::iterator iter; +map counter; +map::iterator iter; void init(const char* imdName, char alignFType, const char* alignF) { char* aux = 0; if (strcmp(fn_list, "")) aux = fn_list; - parser = new SamParser(alignFType, alignF, refs, aux); + parser = new SamParser(alignFType, alignF, transcripts, aux); memset(cat, 0, sizeof(cat)); memset(readOutFs, 0, sizeof(readOutFs)); @@ -87,7 +85,7 @@ void parseIt(SamParser *parser) { nUnique = nMulti = nIsoMulti = 0; memset(N, 0, sizeof(N)); - long long cnt = 0; + READ_INT_TYPE cnt = 0; record_val = -2; //indicate no recorded read now while ((val = parser->parseNext(read, hit)) >= 0) { @@ -124,7 +122,7 @@ void parseIt(SamParser *parser) { } ++cnt; - if (verbose && (cnt % 1000000 == 0)) { printf("Parsed %lld entries\n", cnt); } + if (verbose && (cnt % 1000000 == 0)) { cout<< "Parsed "<< cnt<< " entries"<< endl; } } if (record_val >= 0) { @@ -192,10 +190,10 @@ int main(int argc, char* argv[]) { verbose = !quiet; - sprintf(refF, "%s.seq", argv[1]); - refs.loadRefs(refF, 1); sprintf(groupF, "%s.grp", argv[1]); gi.load(groupF); + sprintf(tiF, "%s.ti", argv[1]); + transcripts.readFrom(tiF); sprintf(imdName, "%s.temp/%s", argv[2], argv[3]); sprintf(datF, "%s.dat", imdName); @@ -205,7 +203,7 @@ int main(int argc, char* argv[]) { hit_out.open(datF); - string firstLine(59, ' '); + string firstLine(99, ' '); firstLine.append(1, '\n'); //May be dangerous! hit_out<