Skip to content

Commit

Permalink
2.7.10b_alpha_230301: Issue #1763: Fixed a bug causing segnmentation …
Browse files Browse the repository at this point in the history
…fault in rare cases for 2-pass mapping.
  • Loading branch information
alexdobin committed Mar 1, 2023
1 parent f4fa8e8 commit 45fe3dd
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
@@ -1,3 +1,4 @@
* Issue #1763: Fixed a bug causing segnmentation fault in rare cases for 2-pass mapping.
* Issue #1733: Fixed the issue with counting of intronicAS reads in STARsolo CellReads.stats output with --soloFeatures GeneFull_Ex50pAS option.

STAR 2.7.10b --- 2022/11/01 ::: Bug-fix release.
Expand Down
7 changes: 7 additions & 0 deletions source/ReadAlign.cpp
Expand Up @@ -101,6 +101,13 @@ ReadAlign::ReadAlign (Parameters& Pin, Genome &genomeIn, Transcriptome *TrIn, in

//clipping
P.pClip.initializeClipMates(clipMates);

//debug
{
#ifdef DEBUG_OutputLastRead
lastReadStream.open((P.outFileTmp+"/lastRead_"+to_string(iChunk)).c_str());
#endif
};
};

void ReadAlign::resetN () {//reset resets the counters to 0 for a new read
Expand Down
4 changes: 4 additions & 0 deletions source/ReadAlign.h
Expand Up @@ -177,6 +177,10 @@ class ReadAlign {
//read annotations
ReadAnnotations readAnnot;

#ifdef DEBUG_OutputLastRead
ofstream lastReadStream;
#endif

/////////////////////////////////////////////////////////////////// METHODS
void resetN();//resets the counters to 0
void multMapSelect();
Expand Down
7 changes: 7 additions & 0 deletions source/ReadAlign_oneRead.cpp
Expand Up @@ -110,6 +110,13 @@ int ReadAlign::oneRead() {//process one read: load, map, write
//write out alignments
outputAlignments();

{
#ifdef DEBUG_OutputLastRead
lastReadStream.seekp(ios::beg);
lastReadStream << iReadAll <<" "<< readName <<endl;
#endif
};

return 0;

};
Expand Down
2 changes: 1 addition & 1 deletion source/VERSION
@@ -1 +1 @@
#define STAR_VERSION "2.7.10b_alpha_220111"
#define STAR_VERSION "2.7.10b_alpha_230301"
4 changes: 2 additions & 2 deletions source/sjdbBuildIndex.cpp
Expand Up @@ -161,7 +161,7 @@ void sjdbBuildIndex (Parameters &P, char *Gsj, char *G, PackedArray &SA, PackedA
if ( (ind1 & N2bit)>0 )
{//- strand
uint ind1s = mapGen1.nGenome - (ind1 & strandMask);
if (ind1s>mapGen.chrStart[mapGen.nChrReal])
if (ind1s>=mapGen.chrStart[mapGen.nChrReal])
{//this index was an old sj, may need to shift it
uint sj1 = (ind1s-mapGen.chrStart[mapGen.nChrReal])/mapGen.sjdbLength;//old junction index
ind1s += (oldSJind[sj1]-sj1)*mapGen.sjdbLength;
Expand All @@ -172,7 +172,7 @@ void sjdbBuildIndex (Parameters &P, char *Gsj, char *G, PackedArray &SA, PackedA
};
} else
{//+ strand
if (ind1>mapGen.chrStart[mapGen.nChrReal])
if (ind1>=mapGen.chrStart[mapGen.nChrReal])
{//this index was an old sj, may need to shift it
uint sj1 = (ind1-mapGen.chrStart[mapGen.nChrReal])/mapGen.sjdbLength;//old junction index
ind1 += (oldSJind[sj1]-sj1)*mapGen.sjdbLength;
Expand Down

0 comments on commit 45fe3dd

Please sign in to comment.