Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

mapping performance improvement #773

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions source/ErrorWarning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "TimeFunctions.h"
#include "GlobalVariables.h"

void exitWithError(string messageOut, ostream &streamOut1, ostream &streamOut2, int errorInt, Parameters &P) {
void exitWithError(string messageOut, ostream &streamOut1, ostream &streamOut2, int errorInt, const Parameters &P) {
time_t timeCurrent;
time( &timeCurrent);
if (P.runThreadN>1) pthread_mutex_lock(&g_threadChunks.mutexError);
Expand All @@ -30,4 +30,4 @@ void warningMessage(string messageOut, ostream &streamOut1, ostream &streamOut2,
if (streamOut2.good()) {
streamOut2 << "WARNING: " << messageOut << "\t\t " << timeMonthDayTime(timeCurrent) <<endl;
};
};
};
2 changes: 1 addition & 1 deletion source/ErrorWarning.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
#include "IncludeDefine.h"
#include "Parameters.h"

void exitWithError(string messageOut, ostream &streamOut1, ostream &streamOut2, int errorInt, Parameters &P);
void exitWithError(string messageOut, ostream &streamOut1, ostream &streamOut2, int errorInt, const Parameters &P);
void warningMessage(string messageOut, ostream &streamOut1, ostream &streamOut2, Parameters &P);
#endif
13 changes: 9 additions & 4 deletions source/ReadAlign_assignAlignToWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ void ReadAlign::assignAlignToWindow(uint a1, uint aLength, uint aStr, uint aNrep
{//do not check for overlap if this is an sj-align
uint iA;
for (iA=0; iA<nWA[iW]; iA++) {
if (aFrag==WA[iW][iA][WA_iFrag] && WA[iW][iA][WA_sjA]==sjA \
&& a1+WA[iW][iA][WA_rStart]==WA[iW][iA][WA_gStart]+aRstart \
&& ( (aRstart>=WA[iW][iA][WA_rStart] && aRstart<WA[iW][iA][WA_rStart]+WA[iW][iA][WA_Length]) \
|| (aRstart+aLength>=WA[iW][iA][WA_rStart] && aRstart+aLength<WA[iW][iA][WA_rStart]+WA[iW][iA][WA_Length]) ) ) {//this piece overlaps with iA
auto& align = WA[iW][iA];
if (a1+align[WA_rStart]==align[WA_gStart]+aRstart
&& aFrag==align[WA_iFrag]
&& align[WA_sjA]==sjA
&& ((aRstart >= align[WA_rStart] &&
aRstart < align[WA_rStart]+align[WA_Length])
|| (aRstart+aLength>=align[WA_rStart]
&& aRstart+aLength<align[WA_rStart]+align[WA_Length]))) {
//this piece overlaps with iA
break;
};
};
Expand Down
2 changes: 1 addition & 1 deletion source/ReadAlign_outputTranscriptSAM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ uint ReadAlign::outputTranscriptSAM(Transcript const &trOut, uint nTrOut, uint i
} else if (mateChr<mapGen.nChrReal){//mateChr is given in the function parameters
*outStream <<"\t"<< mapGen.chrName[mateChr] <<"\t"<< mateStart+1-mapGen.chrStart[mateChr] <<"\t"<< 0;
} else {
*outStream <<"\t"<< "*" <<"\t"<< 0 <<"\t"<< 0;
*outStream << "\t*\t0\t0";
};


Expand Down
2 changes: 1 addition & 1 deletion source/Transcript.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class Transcript {
void resetMapG(uint); // reset map to 0 for Lread bases
void add(Transcript*); // add
intScore alignScore(char **Read1, char *G, Parameters &P);
int variationAdjust(const Genome &mapGen, char *R);
int variationAdjust(const Genome &mapGen, const char *R);
string generateCigarP(); //generates CIGAR
void peOverlapSEtoPE(uint* mSta, Transcript &t);
void extractSpliceJunctions(vector<array<uint64,2>> &sjOut, bool &annotYes);
Expand Down
2 changes: 1 addition & 1 deletion source/Transcript_variationAdjust.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "Transcript.h"
#include "serviceFuns.cpp"

int Transcript::variationAdjust(const Genome &mapGen, char *R)
int Transcript::variationAdjust(const Genome &mapGen, const char *R)
{
Variation &Var=*mapGen.Var;

Expand Down
2 changes: 1 addition & 1 deletion source/extendAlign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "Transcript.h"
#include "extendAlign.h"

bool extendAlign( char* R, char* G, uint rStart, uint gStart, int dR, int dG, uint L, uint Lprev, uint nMMprev, uint nMMmax, double pMMmax, bool extendToEnd, Transcript* trA ) {
bool extendAlign(const char* R, const char* G, uint rStart, uint gStart, int dR, int dG, uint L, uint Lprev, uint nMMprev, uint nMMmax, double pMMmax, bool extendToEnd, Transcript* trA ) {

// find the maximum score

Expand Down
2 changes: 1 addition & 1 deletion source/extendAlign.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
#include "Parameters.h"
#include "Transcript.h"

bool extendAlign( char* R, char* G, uint rStart, uint gStart, int dR, int dG, uint L, uint Lprev, uint nMMprev, uint nMMmax, double pMMmax, bool extendToEnd, Transcript* trA );
bool extendAlign(const char* R, const char* G, uint rStart, uint gStart, int dR, int dG, uint L, uint Lprev, uint nMMprev, uint nMMmax, double pMMmax, bool extendToEnd, Transcript* trA );

5 changes: 4 additions & 1 deletion source/stitchAlignToTranscript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
// #include "stitchGapIndel.cpp"


intScore stitchAlignToTranscript(uint rAend, uint gAend, uint rBstart, uint gBstart, uint L, uint iFragB, uint sjAB, Parameters& P, char* R, Genome &mapGen, Transcript *trA, const uint outFilterMismatchNmaxTotal) {
intScore stitchAlignToTranscript(uint rAend, uint gAend, uint rBstart,
uint gBstart, uint L, uint iFragB, uint sjAB,
const Parameters& P, const char* R, const Genome &mapGen,
Transcript *trA, const uint outFilterMismatchNmaxTotal) {
//stitch together A and B, extend in the gap, returns max score

if (trA->nExons>=MAX_N_EXONS)
Expand Down
9 changes: 6 additions & 3 deletions source/stitchAlignToTranscript.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#include "Genome.h"
#include "IncludeDefine.h"
#include "Parameters.h"
#include "Transcript.h"
#include "Genome.h"

intScore stitchAlignToTranscript(uint rAend, uint gAend, uint rBstart, uint gBstart, uint L, uint iFragB, uint sjAB, Parameters& P, char* R, Genome &mapGen, Transcript *trA, uint outFilterMismatchNmaxTotal);

intScore stitchAlignToTranscript(uint rAend, uint gAend, uint rBstart,
uint gBstart, uint L, uint iFragB, uint sjAB,
const Parameters &P, const char *R,
const Genome &mapGen, Transcript *trA,
uint outFilterMismatchNmaxTotal);
Loading