diff --git a/src/common.h b/src/common.h index ab94349..84db324 100644 --- a/src/common.h +++ b/src/common.h @@ -1,7 +1,7 @@ #ifndef COMMON_H #define COMMON_H -#define FUSIONSCAN_VER "0.6.0" +#define FUSIONSCAN_VER "0.6.1" #define _DEBUG true diff --git a/src/gene.cpp b/src/gene.cpp index 62eb69a..f321e6e 100644 --- a/src/gene.cpp +++ b/src/gene.cpp @@ -86,6 +86,13 @@ Gene Gene::parse(string linestr) { } +int Gene::genePos2ChrPos(int genepos) { + int chrpos = abs(genepos) + mStart; + if(genepos <0) + chrpos *= -1; + return chrpos; +} + string Gene::pos2str(int pos) { int pp = abs(pos) + mStart; stringstream ss; diff --git a/src/gene.h b/src/gene.h index e4a972c..43019b6 100644 --- a/src/gene.h +++ b/src/gene.h @@ -31,6 +31,7 @@ class Gene{ void print(); static Gene parse(string linestr); string pos2str(int pos); + int genePos2ChrPos(int genepos); void getExonIntron(int pos, bool& isExon, int& number); public: diff --git a/src/jsonreporter.cpp b/src/jsonreporter.cpp index 337caa0..35b7ad3 100644 --- a/src/jsonreporter.cpp +++ b/src/jsonreporter.cpp @@ -46,7 +46,7 @@ void JsonReporter::run() { mFile << "\t\t\t\"" << "left" << "\":{" << endl; mFile << "\t\t\t\t\"" << "gene_name" << "\":" << "\"" << fusion.mLeftGene.mName << "\"," << endl; mFile << "\t\t\t\t\"" << "gene_chr" << "\":" << "\"" << fusion.mLeftGene.mChr << "\"," << endl; - mFile << "\t\t\t\t\"" << "position" << "\":" << fusion.mLeftGP.position << "," << endl; + mFile << "\t\t\t\t\"" << "position" << "\":" << fusion.mLeftGene.genePos2ChrPos(fusion.mLeftGP.position) << "," << endl; mFile << "\t\t\t\t\"" << "reference" << "\":" << "\"" << fusion.mLeftRef << "\"," << endl; mFile << "\t\t\t\t\"" << "ref_ext" << "\":" << "\"" << fusion.mLeftRefExt << "\"," << endl; mFile << "\t\t\t\t\"" << "pos_str" << "\":" << "\"" << fusion.mLeftPos << "\"," << endl; @@ -57,7 +57,7 @@ void JsonReporter::run() { mFile << "\t\t\t\"" << "right" << "\":{" << endl; mFile << "\t\t\t\t\"" << "gene_name" << "\":" << "\"" << fusion.mRightGene.mName << "\"," << endl; mFile << "\t\t\t\t\"" << "gene_chr" << "\":" << "\"" << fusion.mRightGene.mChr << "\"," << endl; - mFile << "\t\t\t\t\"" << "position" << "\":" << fusion.mRightGP.position << "," << endl; + mFile << "\t\t\t\t\"" << "position" << "\":" << fusion.mRightGene.genePos2ChrPos(fusion.mRightGP.position) << "," << endl; mFile << "\t\t\t\t\"" << "reference" << "\":" << "\"" << fusion.mRightRef << "\"," << endl; mFile << "\t\t\t\t\"" << "ref_ext" << "\":" << "\"" << fusion.mRightRefExt << "\"," << endl; mFile << "\t\t\t\t\"" << "pos_str" << "\":" << "\"" << fusion.mRightPos << "\"," << endl;