Loading ...
Sorry, an error occurred while loading the content.

patches for Linux

Expand Messages
  • ngotogeninfo
    Hi, I made a patch for ssaha_v30.tar.gz. It seems working fine on Debian/GNU Linux 3.0 (gcc 2.95.4 and 3.0.4). Patch to Global/GlobalDefinitions.cpp fixes a
    Message 1 of 2 , Apr 16, 2003
    • 0 Attachment
      Hi,

      I made a patch for ssaha_v30.tar.gz.
      It seems working fine on Debian/GNU Linux 3.0 (gcc 2.95.4 and 3.0.4).

      Patch to Global/GlobalDefinitions.cpp fixes a problem of
      testSequenceReaderFasta failing in test 17.
      On 32-bit system, value "1 << ( bitsPerSymbol * wordLength )"
      are overflowed from 32-bit int and regarded as 0.
      Adding cast "(unsigned long long)" prevents overflow.

      Patch to QueryManager/MatchAligner.cpp means that
      the length of protein sequences translated from
      second or third position of DNA sequences are equal to or
      shorter than first position sequence and this sometimes
      cause Segmentation Fault (depend on compile option).

      Patches to SequenceReaderMulti.h and SequenceEncoder.cpp
      fix Segmentation fault problem when running
      'ssaha test.fasta test.fasta' in testSSAHA.csh.
      I think pState_ is already deleted by restoreStare(),
      and the destructor has nothing to do.

      Best regards,

      Naohisa Goto
      Genome Information Research Center, Osaka Univ., Japan.
      E-mail: ngoto@...-u.ac.jp && ng@...

      ===================================================================

      diff -u -r SSAHA.orig/Global/GlobalDefinitions.cpp
      SSAHA/Global/GlobalDefinitions.cpp
      --- SSAHA.orig/Global/GlobalDefinitions.cpp Thu May 30 20:29:24 2002
      +++ SSAHA/Global/GlobalDefinitions.cpp Tue Apr 15 22:15:33 2003
      @@ -216,9 +216,9 @@
      register Word oldCarry(0), thisWord;
      register int shiftNum( bitsPerSymbol * (wordLength - i) );
      register Word carryMask
      - ( ( ( 1 << (bitsPerSymbol*i) ) - 1 ) << shiftNum );
      + ( ( ( (unsigned long long)1 << (bitsPerSymbol*i) ) - 1 ) <<
      shiftNum );

      - register Word andMask( ( 1 << ( bitsPerSymbol * wordLength ) ) -
      1 );
      + register Word andMask( ( (unsigned long long)1 << ( bitsPerSymbol
      * wordLength ) ) - 1 );

      for (int j(sequence.size()-1); j>= 0; j--)
      {
      diff -u -r SSAHA.orig/QueryManager/MatchAligner.cpp
      SSAHA/QueryManager/MatchAligner.cpp
      --- SSAHA.orig/QueryManager/MatchAligner.cpp Thu May 30 20:29:26 2002
      +++ SSAHA/QueryManager/MatchAligner.cpp Wed Apr 16 12:23:20 2003
      @@ -613,6 +613,8 @@
      queryFinalFrame = querySize % gNumReadingFrames;
      querySize /= gNumReadingFrames;
      codonize( pQuery, querySize, queryFinalFrame, queryTranslated );
      + queryTranslated[1].push_back(0);
      + queryTranslated[2].push_back(0);
      pQueryTrans[0] = static_cast<const
      char*>(&*queryTranslated[0].begin());
      pQueryTrans[1] = static_cast<const
      char*>(&*queryTranslated[1].begin());
      pQueryTrans[2] = static_cast<const
      char*>(&*queryTranslated[2].begin());
      @@ -623,6 +625,8 @@
      subjectFinalFrame = subjectSize % gNumReadingFrames;
      subjectSize /= gNumReadingFrames;
      codonize( pSubject, subjectSize, subjectFinalFrame,
      subjectTranslated );
      + subjectTranslated[1].push_back(0);
      + subjectTranslated[2].push_back(0);
      pSubjectTrans[0]= static_cast<const
      char*>(&*subjectTranslated[0].begin());
      pSubjectTrans[1]= static_cast<const
      char*>(&*subjectTranslated[1].begin());
      pSubjectTrans[2]= static_cast<const
      char*>(&*subjectTranslated[2].begin());
      @@ -653,6 +657,16 @@
      // path.traceBack(doCell, bandExtension_,
      // fabs(subjectSize-querySize)+bandExtension_); // 0 = band ext

      + if (!isQueryProtein_)
      + {
      + queryTranslated[1].pop_back();
      + queryTranslated[2].pop_back();
      + }
      + if (!isSubjectProtein_)
      + {
      + subjectTranslated[1].pop_back();
      + subjectTranslated[2].pop_back();
      + }

      } // ~void MatchAlignerTranslated::createAlignment

      diff -u -r SSAHA.orig/SequenceReader/SequenceEncoder.cpp
      SSAHA/SequenceReader/SequenceEncoder.cpp
      --- SSAHA.orig/SequenceReader/SequenceEncoder.cpp Thu May 30 20:29:27
      2002
      +++ SSAHA/SequenceReader/SequenceEncoder.cpp Tue Apr 15 21:31:41 2003
      @@ -695,6 +695,7 @@
      for (vector<char>::iterator i(c.begin()); i!=c.end(); i++ )
      os << (unsigned int)*i << "-" <<
      ((*i==flaggedChar) ? '!' : gCodonNames[(unsigned int)*i]) << "
      ";
      + return os;
      } // ~ostream& operator<<( ostream& os, CodonList& c )


      diff -u -r SSAHA.orig/SequenceReader/SequenceReaderFilter.h
      SSAHA/SequenceReader/SequenceReaderFilter.h
      --- SSAHA.orig/SequenceReader/SequenceReaderFilter.h Thu May 30
      20:29:32 2002
      +++ SSAHA/SequenceReader/SequenceReaderFilter.h Tue Apr 15 19:12:57
      2003
      @@ -110,7 +110,7 @@
      SequenceReaderFilterState
      ( SequenceNumber lsn, SequenceReader* ps ) :
      pState_(ps->saveState()), SequenceReaderState(lsn) {}
      - virtual ~SequenceReaderFilterState() { delete pState_; }
      + virtual ~SequenceReaderFilterState() {} //delete pState_;
      // no point in making this private as it's const
      // this is state info for *ps, whatever it is
      SequenceReaderState* pState_;
      diff -u -r SSAHA.orig/SequenceReader/SequenceReaderMulti.h
      SSAHA/SequenceReader/SequenceReaderMulti.h
      --- SSAHA.orig/SequenceReader/SequenceReaderMulti.h Thu May 30
      20:29:32 2002
      +++ SSAHA/SequenceReader/SequenceReaderMulti.h Tue Apr 15 18:38:54
      2003
      @@ -83,7 +83,7 @@
      SequenceReaderState* ps ) :
      thisReader_(tr),
      pState_(ps), SequenceReaderState(lsn) {}
      - virtual ~SequenceReaderMultiState() { delete pState_; }
      + virtual ~SequenceReaderMultiState() {} //delete pState_;
      // no point in making this private as it's const
      const vector<SeqReaderInfo>::iterator thisReader_;
      // this is state info for *thisReader, whatever it is
    • Will Spooner
      Hi Naohisa, That s a great help! Seems to have cleared up all those pesky command-line-option bugs under linux. You ve prompted me to combine a few fixes I ve
      Message 2 of 2 , Apr 16, 2003
      • 0 Attachment
        Hi Naohisa,

        That's a great help! Seems to have cleared up all those pesky
        command-line-option bugs under linux.

        You've prompted me to combine a few fixes I've had sitting around to
        release a new (v3.1) ssaha version which I'll announce later today.

        Thanks, and kind regards,

        Will

        ---
        Dr William Spooner whs@...
        Ensembl Web Developer http://www.ensembl.org



        On Wed, 16 Apr 2003, ngotogeninfo wrote:

        > Hi,
        >
        > I made a patch for ssaha_v30.tar.gz.
        > It seems working fine on Debian/GNU Linux 3.0 (gcc 2.95.4 and 3.0.4).
        >
        > Patch to Global/GlobalDefinitions.cpp fixes a problem of
        > testSequenceReaderFasta failing in test 17.
        > On 32-bit system, value "1 << ( bitsPerSymbol * wordLength )"
        > are overflowed from 32-bit int and regarded as 0.
        > Adding cast "(unsigned long long)" prevents overflow.
        >
        > Patch to QueryManager/MatchAligner.cpp means that
        > the length of protein sequences translated from
        > second or third position of DNA sequences are equal to or
        > shorter than first position sequence and this sometimes
        > cause Segmentation Fault (depend on compile option).
        >
        > Patches to SequenceReaderMulti.h and SequenceEncoder.cpp
        > fix Segmentation fault problem when running
        > 'ssaha test.fasta test.fasta' in testSSAHA.csh.
        > I think pState_ is already deleted by restoreStare(),
        > and the destructor has nothing to do.
        >
        > Best regards,
        >
        > Naohisa Goto
        > Genome Information Research Center, Osaka Univ., Japan.
        > E-mail: ngoto@...-u.ac.jp && ng@...
        >
        > ===================================================================
        >
        > diff -u -r SSAHA.orig/Global/GlobalDefinitions.cpp
        > SSAHA/Global/GlobalDefinitions.cpp
        > --- SSAHA.orig/Global/GlobalDefinitions.cpp Thu May 30 20:29:24 2002
        > +++ SSAHA/Global/GlobalDefinitions.cpp Tue Apr 15 22:15:33 2003
        > @@ -216,9 +216,9 @@
        > register Word oldCarry(0), thisWord;
        > register int shiftNum( bitsPerSymbol * (wordLength - i) );
        > register Word carryMask
        > - ( ( ( 1 << (bitsPerSymbol*i) ) - 1 ) << shiftNum );
        > + ( ( ( (unsigned long long)1 << (bitsPerSymbol*i) ) - 1 ) <<
        > shiftNum );
        >
        > - register Word andMask( ( 1 << ( bitsPerSymbol * wordLength ) ) -
        > 1 );
        > + register Word andMask( ( (unsigned long long)1 << ( bitsPerSymbol
        > * wordLength ) ) - 1 );
        >
        > for (int j(sequence.size()-1); j>= 0; j--)
        > {
        > diff -u -r SSAHA.orig/QueryManager/MatchAligner.cpp
        > SSAHA/QueryManager/MatchAligner.cpp
        > --- SSAHA.orig/QueryManager/MatchAligner.cpp Thu May 30 20:29:26 2002
        > +++ SSAHA/QueryManager/MatchAligner.cpp Wed Apr 16 12:23:20 2003
        > @@ -613,6 +613,8 @@
        > queryFinalFrame = querySize % gNumReadingFrames;
        > querySize /= gNumReadingFrames;
        > codonize( pQuery, querySize, queryFinalFrame, queryTranslated );
        > + queryTranslated[1].push_back(0);
        > + queryTranslated[2].push_back(0);
        > pQueryTrans[0] = static_cast<const
        > char*>(&*queryTranslated[0].begin());
        > pQueryTrans[1] = static_cast<const
        > char*>(&*queryTranslated[1].begin());
        > pQueryTrans[2] = static_cast<const
        > char*>(&*queryTranslated[2].begin());
        > @@ -623,6 +625,8 @@
        > subjectFinalFrame = subjectSize % gNumReadingFrames;
        > subjectSize /= gNumReadingFrames;
        > codonize( pSubject, subjectSize, subjectFinalFrame,
        > subjectTranslated );
        > + subjectTranslated[1].push_back(0);
        > + subjectTranslated[2].push_back(0);
        > pSubjectTrans[0]= static_cast<const
        > char*>(&*subjectTranslated[0].begin());
        > pSubjectTrans[1]= static_cast<const
        > char*>(&*subjectTranslated[1].begin());
        > pSubjectTrans[2]= static_cast<const
        > char*>(&*subjectTranslated[2].begin());
        > @@ -653,6 +657,16 @@
        > // path.traceBack(doCell, bandExtension_,
        > // fabs(subjectSize-querySize)+bandExtension_); // 0 = band ext
        >
        > + if (!isQueryProtein_)
        > + {
        > + queryTranslated[1].pop_back();
        > + queryTranslated[2].pop_back();
        > + }
        > + if (!isSubjectProtein_)
        > + {
        > + subjectTranslated[1].pop_back();
        > + subjectTranslated[2].pop_back();
        > + }
        >
        > } // ~void MatchAlignerTranslated::createAlignment
        >
        > diff -u -r SSAHA.orig/SequenceReader/SequenceEncoder.cpp
        > SSAHA/SequenceReader/SequenceEncoder.cpp
        > --- SSAHA.orig/SequenceReader/SequenceEncoder.cpp Thu May 30 20:29:27
        > 2002
        > +++ SSAHA/SequenceReader/SequenceEncoder.cpp Tue Apr 15 21:31:41 2003
        > @@ -695,6 +695,7 @@
        > for (vector<char>::iterator i(c.begin()); i!=c.end(); i++ )
        > os << (unsigned int)*i << "-" <<
        > ((*i==flaggedChar) ? '!' : gCodonNames[(unsigned int)*i]) << "
        > ";
        > + return os;
        > } // ~ostream& operator<<( ostream& os, CodonList& c )
        >
        >
        > diff -u -r SSAHA.orig/SequenceReader/SequenceReaderFilter.h
        > SSAHA/SequenceReader/SequenceReaderFilter.h
        > --- SSAHA.orig/SequenceReader/SequenceReaderFilter.h Thu May 30
        > 20:29:32 2002
        > +++ SSAHA/SequenceReader/SequenceReaderFilter.h Tue Apr 15 19:12:57
        > 2003
        > @@ -110,7 +110,7 @@
        > SequenceReaderFilterState
        > ( SequenceNumber lsn, SequenceReader* ps ) :
        > pState_(ps->saveState()), SequenceReaderState(lsn) {}
        > - virtual ~SequenceReaderFilterState() { delete pState_; }
        > + virtual ~SequenceReaderFilterState() {} //delete pState_;
        > // no point in making this private as it's const
        > // this is state info for *ps, whatever it is
        > SequenceReaderState* pState_;
        > diff -u -r SSAHA.orig/SequenceReader/SequenceReaderMulti.h
        > SSAHA/SequenceReader/SequenceReaderMulti.h
        > --- SSAHA.orig/SequenceReader/SequenceReaderMulti.h Thu May 30
        > 20:29:32 2002
        > +++ SSAHA/SequenceReader/SequenceReaderMulti.h Tue Apr 15 18:38:54
        > 2003
        > @@ -83,7 +83,7 @@
        > SequenceReaderState* ps ) :
        > thisReader_(tr),
        > pState_(ps), SequenceReaderState(lsn) {}
        > - virtual ~SequenceReaderMultiState() { delete pState_; }
        > + virtual ~SequenceReaderMultiState() {} //delete pState_;
        > // no point in making this private as it's const
        > const vector<SeqReaderInfo>::iterator thisReader_;
        > // this is state info for *thisReader, whatever it is
        >
        >
        >
        > To unsubscribe from this group, send an email to:
        > ssahausers-unsubscribe@yahoogroups.com
        >
        >
        >
        > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.