[med-svn] [Git][med-team/sra-sdk][master] sra-sdk 3.0.9+dfsg-3: Support libre2-11 API (#1053411).

Aaron M. Ucko (@ucko) gitlab at salsa.debian.org
Mon May 6 03:54:44 BST 2024



Aaron M. Ucko pushed to branch master at Debian Med / sra-sdk


Commits:
c83c83f2 by Aaron M. Ucko at 2024-05-05T22:45:49-04:00
sra-sdk 3.0.9+dfsg-3: Support libre2-11 API (#1053411).

* debian/control: Build depend on libabsl-dev so binaries using libre2
  (sharq and relevant tests) can unconditionally link against
  -labsl_string_view for simplicitly.
* debian/patches/support_libre2-11.patch (new): Prepare for (but don't
  require!) newer libre2 versions where re2::StringPiece has changed
  from a custom class to a typedef for absl::string_view, whose API is
  somewhat different.

- - - - -


4 changed files:

- debian/changelog
- debian/control
- debian/patches/series
- + debian/patches/support_libre2-11.patch


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,15 @@
+sra-sdk (3.0.9+dfsg-3) experimental; urgency=medium
+
+  * debian/control: Build depend on libabsl-dev so binaries using libre2
+    (sharq and relevant tests) can unconditionally link against
+    -labsl_string_view for simplicitly.
+  * debian/patches/support_libre2-11.patch (new): Prepare for (but don't
+    require!) newer libre2 versions where re2::StringPiece has changed
+    from a custom class to a typedef for absl::string_view, whose API is
+    somewhat different.  (Closes: #1053411.)
+
+ -- Aaron M. Ucko <ucko at debian.org>  Sun, 05 May 2024 22:45:27 -0400
+
 sra-sdk (3.0.9+dfsg-2) experimental; urgency=medium
 
   * debian/patches/fix_arm64_build.patch (new): Fix arm64 builds by


=====================================
debian/control
=====================================
@@ -10,6 +10,7 @@ Build-Depends: debhelper-compat (= 13),
                d-shlibs,
                dh-python,
                javahelper,
+	       libabsl-dev,
                libncbi-vdb-dev (>= 3.0.9+dfsg~),
                libfuse-dev,
                libhdf5-dev,


=====================================
debian/patches/series
=====================================
@@ -39,3 +39,4 @@ fix_ngs-c++-underlinkage.patch
 use_c_locale_for_comma.patch
 no_sse4.2.patch
 fix_arm64_build.patch
+support_libre2-11.patch


=====================================
debian/patches/support_libre2-11.patch
=====================================
@@ -0,0 +1,428 @@
+--- a/tools/loaders/sharq/regexpr.hpp
++++ b/tools/loaders/sharq/regexpr.hpp
+@@ -11,6 +11,7 @@
+ #include <iostream>
+ 
+ #include <re2/re2.h>
++#include <re2/stringpiece.h>
+ 
+ class CRegExprMatcher
+ /// Encapsulation for RE2 regexpr matcher
+@@ -58,7 +59,7 @@ public:
+ */        
+     bool Matches(const re2::StringPiece& input)
+     {
+-        mLastInput = input.as_string();
++        mLastInput.assign(input.data(), input.size());
+         return re2::RE2::PartialMatchN(input, *re, args.empty() ? nullptr : &args[0], (int)args.size());
+     }
+ 
+--- a/test/loaders/sharq/test-regexpr.cpp
++++ b/test/loaders/sharq/test-regexpr.cpp
+@@ -60,17 +60,17 @@ TEST_CASE(YesMatch)
+     CRegExprMatcher m( R"([@>+]([!-~]*?)[: ]?([!-~]+?Basecall)(_[12]D[_0]*?|_Alignment[_0]*?|_Barcoding[_0]*?|)(_twodirections|_2d|-2D|_template|-1D|_complement|-complement|\.1C|\.1T|\.2D|)[: ]([!-~]*?)[: ]?([!-~ ]+?_ch)_?(\d+)(_read|_file)_?(\d+)(_strand\d*.fast5|_strand\d*.*|)(\s+|$))" );
+     REQUIRE( m.Matches( "@f286a4e1-fb27-4ee7-adb8-60c863e55dbb_Basecall_Alignment_template MINICOL235_20170120_FN__MN16250_sequencing_throughput_ONLL3135_25304_ch143_read16010_strand" ) );
+     REQUIRE_EQ( size_t( 11 ), m.GetMatch().size() );
+-    REQUIRE_EQ( string(""), m.GetMatch()[0].as_string() );
+-    REQUIRE_EQ( string("f286a4e1-fb27-4ee7-adb8-60c863e55dbb_Basecall"), m.GetMatch()[1].as_string() );
+-    REQUIRE_EQ( string("_Alignment"), m.GetMatch()[2].as_string() );
+-    REQUIRE_EQ( string("_template"), m.GetMatch()[3].as_string() );
+-    REQUIRE_EQ( string(""), m.GetMatch()[4].as_string() );
+-    REQUIRE_EQ( string("MINICOL235_20170120_FN__MN16250_sequencing_throughput_ONLL3135_25304_ch"), m.GetMatch()[5].as_string() );
+-    REQUIRE_EQ( string("143"), m.GetMatch()[6].as_string() );
+-    REQUIRE_EQ( string("_read"), m.GetMatch()[7].as_string() );
+-    REQUIRE_EQ( string("16010"), m.GetMatch()[8].as_string() );
+-    REQUIRE_EQ( string("_strand"), m.GetMatch()[9].as_string() );
+-    REQUIRE_EQ( string(""), m.GetMatch()[10].as_string() );
++    REQUIRE_EQ( re2::StringPiece(""), m.GetMatch()[0] );
++    REQUIRE_EQ( re2::StringPiece("f286a4e1-fb27-4ee7-adb8-60c863e55dbb_Basecall"), m.GetMatch()[1] );
++    REQUIRE_EQ( re2::StringPiece("_Alignment"), m.GetMatch()[2] );
++    REQUIRE_EQ( re2::StringPiece("_template"), m.GetMatch()[3] );
++    REQUIRE_EQ( re2::StringPiece(""), m.GetMatch()[4] );
++    REQUIRE_EQ( re2::StringPiece("MINICOL235_20170120_FN__MN16250_sequencing_throughput_ONLL3135_25304_ch"), m.GetMatch()[5] );
++    REQUIRE_EQ( re2::StringPiece("143"), m.GetMatch()[6] );
++    REQUIRE_EQ( re2::StringPiece("_read"), m.GetMatch()[7] );
++    REQUIRE_EQ( re2::StringPiece("16010"), m.GetMatch()[8] );
++    REQUIRE_EQ( re2::StringPiece("_strand"), m.GetMatch()[9] );
++    REQUIRE_EQ( re2::StringPiece(""), m.GetMatch()[10] );
+ }
+ 
+ int main (int argc, char *argv [])
+--- a/tools/loaders/sharq/fastq_defline_matcher.hpp
++++ b/tools/loaders/sharq/fastq_defline_matcher.hpp
+@@ -59,7 +59,7 @@ public:
+      * @return true if defline matches
+      * @return false if defline does not match
+      */
+-    virtual bool Matches(const string_view& defline)
++    virtual bool Matches(const re2::StringPiece& defline)
+     {
+         return re.Matches(defline);
+     }
+@@ -107,7 +107,7 @@ public:
+     {
+     }
+ 
+-    bool Matches(const string_view& defline) override {return false;}
++    bool Matches(const re2::StringPiece& defline) override {return false;}
+     virtual void GetMatch(CFastqRead& read) override  {}
+     virtual uint8_t GetPlatform() const override { return 0;}
+ 
+@@ -185,13 +185,13 @@ public:
+             re.GetMatch()[0].CopyToString(&m_tmp_spot);
+             s_add_sep(m_tmp_spot, re.GetMatch()[1]);
+         }
+-        re.GetMatch()[2].AppendToString(&m_tmp_spot); //lane
++        m_tmp_spot.append(re.GetMatch()[2].data(), re.GetMatch()[2].size()); //lane
+         s_add_sep(m_tmp_spot, re.GetMatch()[3]);
+-        re.GetMatch()[4].AppendToString(&m_tmp_spot); //tile
++        m_tmp_spot.append(re.GetMatch()[4].data(), re.GetMatch()[4].size()); //tile
+         s_add_sep(m_tmp_spot, re.GetMatch()[5]);
+-        re.GetMatch()[6].AppendToString(&m_tmp_spot); //x
++        m_tmp_spot.append(re.GetMatch()[6].data(), re.GetMatch()[6].size()); //x
+         s_add_sep(m_tmp_spot, re.GetMatch()[7]);
+-        re.GetMatch()[8].AppendToString(&m_tmp_spot); //y
++        m_tmp_spot.append(re.GetMatch()[8].data(), re.GetMatch()[8].size()); //y
+         read.MoveSpot(std::move(m_tmp_spot));
+ 
+         read.SetReadNum(re.GetMatch()[10]);
+@@ -274,15 +274,15 @@ public:
+             numDiscards = countExtraNumbersInIllumina(prefix, re.GetMatch()[7], x, y);
+             if (numDiscards == 2 && x.find('.') != re2::StringPiece::npos) {
+                 string new_suffix;
+-                re.GetMatch()[5].AppendToString(&new_suffix); // sep3
++                new_suffix.append(re.GetMatch()[5].data(), re.GetMatch()[5].size()); // sep3
+                 x.AppendToString(&new_suffix); //x 
+-                re.GetMatch()[7].AppendToString(&new_suffix); // sep4
++                new_suffix.append(re.GetMatch()[7].data(), re.GetMatch()[7].size()); // sep4
+                 y.AppendToString(&new_suffix); //y
+                 new_suffix.append(read.Suffix());
+                 read.SetSuffix(new_suffix);
+             } else if (numDiscards == 1 && y.find('.') != re2::StringPiece::npos) {
+                 string new_suffix;
+-                re.GetMatch()[7].AppendToString(&new_suffix); // sep4
++                new_suffix.append(re.GetMatch()[7].data(), re.GetMatch()[7].size()); // sep4
+                 y.AppendToString(&new_suffix); //y
+                 new_suffix.append(read.Suffix());
+                 read.SetSuffix(new_suffix);
+@@ -437,7 +437,7 @@ public:
+     virtual void GetMatch(CFastqRead& read) override
+     {
+         CDefLineMatcherIlluminaNewBase::GetMatch(read);
+-        const string m9 = re.GetMatch()[9].as_string();
++        const auto &m9 = re.GetMatch()[9];
+         if ( m9.size() > 2 ) {
+             if ( mSuffixPattern.Matches( m9 ) ) {
+                 read.SetSuffix( mSuffixPattern.GetMatch()[2] );
+@@ -564,11 +564,11 @@ public:
+ 
+         // flowcell, lane, column, row, readNo, spotGroup, readNum, endSep
+         m_tmp_spot.clear();
+-        re.GetMatch()[0].AppendToString(&m_tmp_spot); //flowcell
+-        re.GetMatch()[1].AppendToString(&m_tmp_spot); //lane
+-        re.GetMatch()[2].AppendToString(&m_tmp_spot); //column
+-        re.GetMatch()[3].AppendToString(&m_tmp_spot); //row
+-        re.GetMatch()[4].AppendToString(&m_tmp_spot); // readNo
++        m_tmp_spot.append(re.GetMatch()[0].data(), re.GetMatch()[0].size()); //flowcell
++        m_tmp_spot.append(re.GetMatch()[1].data(), re.GetMatch()[1].size()); //lane
++        m_tmp_spot.append(re.GetMatch()[2].data(), re.GetMatch()[2].size()); //column
++        m_tmp_spot.append(re.GetMatch()[3].data(), re.GetMatch()[3].size()); //row
++        m_tmp_spot.append(re.GetMatch()[4].data(), re.GetMatch()[4].size()); // readNo
+         read.MoveSpot(std::move(m_tmp_spot));
+ 
+         if (!re.GetMatch()[6].empty() && re.GetMatch()[6].starts_with("/"))
+@@ -602,11 +602,11 @@ public:
+         //  0         1     2       3    4       5       6     7        8           9         10         11
+         //  flowcell, lane, column, row, readNo, suffix, sep1, readNum, filterRead, reserved, spotGroup, endSep
+         m_tmp_spot.clear();
+-        re.GetMatch()[0].AppendToString(&m_tmp_spot); //flowcell
+-        re.GetMatch()[1].AppendToString(&m_tmp_spot); //lane
+-        re.GetMatch()[2].AppendToString(&m_tmp_spot); //column
+-        re.GetMatch()[3].AppendToString(&m_tmp_spot); //row
+-        re.GetMatch()[4].AppendToString(&m_tmp_spot); // readNo
++        m_tmp_spot.append(re.GetMatch()[0].data(), re.GetMatch()[0].size()); //flowcell
++        m_tmp_spot.append(re.GetMatch()[1].data(), re.GetMatch()[1].size()); //lane
++        m_tmp_spot.append(re.GetMatch()[2].data(), re.GetMatch()[2].size()); //column
++        m_tmp_spot.append(re.GetMatch()[3].data(), re.GetMatch()[3].size()); //row
++        m_tmp_spot.append(re.GetMatch()[4].data(), re.GetMatch()[4].size()); // readNo
+         read.MoveSpot(std::move(m_tmp_spot));
+ 
+         read.SetSuffix(re.GetMatch()[5]);
+@@ -675,7 +675,9 @@ public:
+                 const string Barcode = "barcode";
+                 if ( barcode.find( Barcode ) == 0 )
+                 {   // self.spotGroup = re.sub(r'barcode(\d+)$',r'BC\1',self.spotGroup,1)
+-                    read.SetSpotGroup( string( "BC" ) + barcode.substr( Barcode.size() ).as_string() );
++                    read.SetSpotGroup( string( "BC" )
++				       + string(barcode.data() + Barcode.size(),
++						barcode.size() - Barcode.size()) );
+                 }
+                 else
+                 {
+@@ -764,19 +766,19 @@ public:
+         m_tmp_spot.clear();
+         if ( !re.GetMatch()[3].empty() )
+         {   // self.name = poreStart + self.channel + poreMid + self.readNo + poreEnd
+-            re.GetMatch()[0].AppendToString(&m_tmp_spot); //poreStart
+-            re.GetMatch()[1].AppendToString(&m_tmp_spot); //channel
+-            re.GetMatch()[2].AppendToString(&m_tmp_spot); //poreMid
+-            re.GetMatch()[3].AppendToString(&m_tmp_spot); //readNo
+-            re.GetMatch()[4].AppendToString(&m_tmp_spot); //poreEnd
++            m_tmp_spot.append(re.GetMatch()[0].data(), re.GetMatch()[0].size()); //poreStart
++            m_tmp_spot.append(re.GetMatch()[1].data(), re.GetMatch()[1].size()); //channel
++            m_tmp_spot.append(re.GetMatch()[2].data(), re.GetMatch()[2].size()); //poreMid
++            m_tmp_spot.append(re.GetMatch()[3].data(), re.GetMatch()[3].size()); //readNo
++            m_tmp_spot.append(re.GetMatch()[4].data(), re.GetMatch()[4].size()); //poreEnd
+ 
+             read.SetNanoporeReadNo( re.GetMatch()[3] );
+         }
+         else
+         {   // self.name = poreStart + self.channel + poreEnd
+-            re.GetMatch()[0].AppendToString(&m_tmp_spot); //poreStart
+-            re.GetMatch()[1].AppendToString(&m_tmp_spot); //channel
+-            re.GetMatch()[4].AppendToString(&m_tmp_spot); //poreEnd
++            m_tmp_spot.append(re.GetMatch()[0].data(), re.GetMatch()[0].size()); //poreStart
++            m_tmp_spot.append(re.GetMatch()[1].data(), re.GetMatch()[1].size()); //channel
++            m_tmp_spot.append(re.GetMatch()[4].data(), re.GetMatch()[4].size()); //poreEnd
+ 
+             if ( getPoreReadNo2.Matches(re.GetLastInput()) )
+             {
+@@ -789,7 +791,7 @@ public:
+ 
+         poreMid = re.GetMatch()[2];
+         poreRead = re.GetMatch()[5];
+-        re.GetMatch()[6].AppendToString( &poreFile );
++        poreFile.append(re.GetMatch()[6].data(), re.GetMatch()[6].size());
+         PostProcess( read );
+     }
+ 
+@@ -847,11 +849,11 @@ public:
+ 
+         poreMid = re.GetMatch()[7];
+         //self.poreFile = poreStart + self.channel + poreMid + self.readNo + poreEnd
+-        re.GetMatch()[5].AppendToString( &poreFile ); //poreStart
+-        re.GetMatch()[6].AppendToString( &poreFile ); //channel
+-        re.GetMatch()[7].AppendToString( &poreFile ); //poreMid
+-        re.GetMatch()[8].AppendToString( &poreFile ); //readNo
+-        re.GetMatch()[9].AppendToString( &poreFile ); //poreEnd
++        poreFile.append(re.GetMatch()[5].data(), re.GetMatch()[5].size()); //poreStart
++        poreFile.append(re.GetMatch()[6].data(), re.GetMatch()[6].size()); //channel
++        poreFile.append(re.GetMatch()[7].data(), re.GetMatch()[7].size()); //poreMid
++        poreFile.append(re.GetMatch()[8].data(), re.GetMatch()[8].size()); //readNo
++        poreFile.append(re.GetMatch()[9].data(), re.GetMatch()[9].size()); //poreEnd
+ 
+         poreRead = re.GetMatch()[3];
+         PostProcess( read );
+@@ -891,11 +893,11 @@ public:
+ 
+         poreMid = re.GetMatch()[7];
+         // poreFile = poreStart + self.readNo + poreMid + self.channel + poreEnd
+-        re.GetMatch()[5].AppendToString( &poreFile ); //poreStart
+-        re.GetMatch()[6].AppendToString( &poreFile ); //readNo
+-        re.GetMatch()[7].AppendToString( &poreFile ); //poreMid
+-        re.GetMatch()[8].AppendToString( &poreFile ); //channel
+-        re.GetMatch()[9].AppendToString( &poreFile ); //poreEnd
++        poreFile.append(re.GetMatch()[5].data(), re.GetMatch()[5].size()); //poreStart
++        poreFile.append(re.GetMatch()[6].data(), re.GetMatch()[6].size()); //readNo
++        poreFile.append(re.GetMatch()[7].data(), re.GetMatch()[7].size()); //poreMid
++        poreFile.append(re.GetMatch()[8].data(), re.GetMatch()[8].size()); //channel
++        poreFile.append(re.GetMatch()[9].data(), re.GetMatch()[9].size()); //poreEnd
+ 
+         poreRead = re.GetMatch()[3];
+         PostProcess( read );
+@@ -932,7 +934,7 @@ public:
+ 
+         const string Unclassified = string("unclassified");
+         if ( getPoreBarcode.Matches(re.GetLastInput()) &&
+-             getPoreBarcode.GetMatch()[0].as_string() != Unclassified )
++             getPoreBarcode.GetMatch()[0] != Unclassified )
+         {
+             read.SetSpotGroup( getPoreBarcode.GetMatch()[0] );
+         }
+@@ -988,10 +990,10 @@ public:
+         // prefix, dateAndHash454, region454, xy454, readNum, endSep
+         // 0       1               2          3      4        5
+         m_tmp_spot.clear();
+-        re.GetMatch()[0].AppendToString(&m_tmp_spot); //prefix
+-        re.GetMatch()[1].AppendToString(&m_tmp_spot); //dateAndHash454
+-        re.GetMatch()[2].AppendToString(&m_tmp_spot); //region454
+-        re.GetMatch()[3].AppendToString(&m_tmp_spot); //xy454
++        m_tmp_spot.append(re.GetMatch()[0].data(), re.GetMatch()[0].size()); //prefix
++        m_tmp_spot.append(re.GetMatch()[1].data(), re.GetMatch()[1].size()); //dateAndHash454
++        m_tmp_spot.append(re.GetMatch()[2].data(), re.GetMatch()[2].size()); //region454
++        m_tmp_spot.append(re.GetMatch()[3].data(), re.GetMatch()[3].size()); //xy454
+         read.MoveSpot(std::move(m_tmp_spot));
+         auto& readNo = re.GetMatch()[4];
+         if (!readNo.empty()) {
+@@ -1026,11 +1028,11 @@ public:
+         // 0      1     2    3     4       5       6          7        8 
+         m_tmp_spot.clear();
+ 
+-        re.GetMatch()[0].AppendToString(&m_tmp_spot); //runId
+-        re.GetMatch()[1].AppendToString(&m_tmp_spot); //sep1
+-        re.GetMatch()[2].AppendToString(&m_tmp_spot); //row
+-        re.GetMatch()[3].AppendToString(&m_tmp_spot); //sep2
+-        re.GetMatch()[4].AppendToString(&m_tmp_spot); //column
++        m_tmp_spot.append(re.GetMatch()[0].data(), re.GetMatch()[0].size()); //runId
++        m_tmp_spot.append(re.GetMatch()[1].data(), re.GetMatch()[1].size()); //sep1
++        m_tmp_spot.append(re.GetMatch()[2].data(), re.GetMatch()[2].size()); //row
++        m_tmp_spot.append(re.GetMatch()[3].data(), re.GetMatch()[3].size()); //sep2
++        m_tmp_spot.append(re.GetMatch()[4].data(), re.GetMatch()[4].size()); //column
+         read.MoveSpot(std::move(m_tmp_spot));
+         auto& suffix = re.GetMatch()[5];
+ 
+@@ -1085,11 +1087,11 @@ public:
+ 
+         m_tmp_spot.clear();
+ 
+-        re.GetMatch()[0].AppendToString(&m_tmp_spot); //runId
+-        re.GetMatch()[1].AppendToString(&m_tmp_spot); //sep1
+-        re.GetMatch()[2].AppendToString(&m_tmp_spot); //row
+-        re.GetMatch()[3].AppendToString(&m_tmp_spot); //sep2
+-        re.GetMatch()[4].AppendToString(&m_tmp_spot); //column
++        m_tmp_spot.append(re.GetMatch()[0].data(), re.GetMatch()[0].size()); //runId
++        m_tmp_spot.append(re.GetMatch()[1].data(), re.GetMatch()[1].size()); //sep1
++        m_tmp_spot.append(re.GetMatch()[2].data(), re.GetMatch()[2].size()); //row
++        m_tmp_spot.append(re.GetMatch()[3].data(), re.GetMatch()[3].size()); //sep2
++        m_tmp_spot.append(re.GetMatch()[4].data(), re.GetMatch()[4].size()); //column
+         read.MoveSpot(std::move(m_tmp_spot));
+ 
+         read.SetSuffix(re.GetMatch()[5]);
+@@ -1129,7 +1131,7 @@ public:
+ 
+         m_tmp_spot.clear();
+ 
+-        re.GetMatch()[0].AppendToString(&m_tmp_spot); // name
++        m_tmp_spot.append(re.GetMatch()[0].data(), re.GetMatch()[0].size()); // name
+         read.MoveSpot(std::move(m_tmp_spot));
+     }
+ };
+@@ -1200,7 +1202,7 @@ public:
+ 
+         m_tmp_spot.clear();
+ 
+-        re.GetMatch()[0].AppendToString(&m_tmp_spot); // name
++        m_tmp_spot.append(re.GetMatch()[0].data(), re.GetMatch()[0].size()); // name
+         read.MoveSpot(std::move(m_tmp_spot));
+ 
+         auto& spot_group = re.GetMatch()[1];
+--- a/tools/loaders/sharq/fastq_read.hpp
++++ b/tools/loaders/sharq/fastq_read.hpp
+@@ -60,23 +60,23 @@ public:
+ 
+     void SetLineNumber(size_t line_number) { mLineNumber = line_number;}
+     void SetSpot(string spot) { mSpot = std::move(spot); }
+-    void SetSpot(const re2::StringPiece& spot) {  spot.CopyToString(&mSpot); }
++    void SetSpot(const re2::StringPiece& spot) {  mSpot.assign(spot.data(), spot.size()); }
+ 
+     void MoveSpot(string&& spot) { mSpot = std::move(spot); }
+ 
+     void SetReadNum(string readNum) { mReadNum = std::move(readNum); }
+-    void SetReadNum(const re2::StringPiece& readNum) { readNum.CopyToString(&mReadNum); }
++    void SetReadNum(const re2::StringPiece& readNum) { mReadNum.assign(readNum.data(), readNum.size()); }
+ 
+     void SetSuffix(string suffix) { mSuffix = std::move(suffix); }
+-    void SetSuffix(const re2::StringPiece& suffix) { suffix.CopyToString(&mSuffix); }
++    void SetSuffix(const re2::StringPiece& suffix) { mSuffix.assign(suffix.data(), suffix.size()); }
+ 
+     void SetSpotGroup(string spotGroup);
+     void SetSpotGroup(const re2::StringPiece& spotGroup);
+ 
+     void SetReadFilter(uint8_t readFilter) { mReadFilter = readFilter; }
+ 
+-    void SetChannel(const re2::StringPiece& channel) { channel.CopyToString(&mChannel); }
+-    void SetNanoporeReadNo(const re2::StringPiece& readNo) { readNo.CopyToString(&mNanoporeReadNo); }
++    void SetChannel(const re2::StringPiece& channel) { mChannel.assign(channel.data(), channel.size()); }
++    void SetNanoporeReadNo(const re2::StringPiece& readNo) { mNanoporeReadNo.assign(readNo.data(), readNo.size()); }
+ 
+     void SetSequence(string sequence) { mSequence = std::move(sequence); }
+     void SetQualScores(vector<uint8_t> qual_scores) { mQualScores = std::move(qual_scores); }
+@@ -220,7 +220,7 @@ void CFastqRead::SetSpotGroup(const re2:
+     if (spotGroup == "0")
+         mSpotGroup.clear();
+     else
+-        spotGroup.CopyToString(&mSpotGroup);
++        mSpotGroup.assign(spotGroup.data(), spotGroup.size());
+ }
+ 
+ 
+--- a/tools/loaders/sharq/fastq_defline_parser.hpp
++++ b/tools/loaders/sharq/fastq_defline_parser.hpp
+@@ -57,7 +57,7 @@ public:
+      * @return true if defline can be parsed
+      * @return false if defline cannot be parsed
+      */
+-    bool Match(const string_view& defline, bool strict = false);
++    bool Match(const re2::StringPiece& defline, bool strict = false);
+ 
+     /**
+      * @brief Check if defline matches last matched pattern
+@@ -66,7 +66,7 @@ public:
+      * @return true 
+      * @return false 
+      */
+-    bool MatchLast(const string_view& defline);
++    bool MatchLast(const re2::StringPiece& defline);
+ 
+     /**
+      * @brief Enable MatchAll pattern
+@@ -158,7 +158,7 @@ void CDefLineParser::Reset()
+     mIndexLastSuccessfulMatch = 0;
+ }
+ 
+-bool CDefLineParser::Match(const string_view& defline, bool strict)
++bool CDefLineParser::Match(const re2::StringPiece& defline, bool strict)
+ {
+     if (mDefLineMatchers[mIndexLastSuccessfulMatch]->Matches(defline)) {
+         return true;
+@@ -180,7 +180,7 @@ bool CDefLineParser::Match(const string_
+     return false;
+ }
+ 
+-bool CDefLineParser::MatchLast(const string_view& defline)
++bool CDefLineParser::MatchLast(const re2::StringPiece& defline)
+ {
+     return mDefLineMatchers[mIndexLastSuccessfulMatch]->Matches(defline);
+ }
+@@ -188,7 +188,7 @@ bool CDefLineParser::MatchLast(const str
+ 
+ void CDefLineParser::Parse(const string_view& defline, CFastqRead& read)
+ {
+-    if (Match(defline)) {
++    if (Match(re2::StringPiece(defline.data(), defline.size()))) {
+         mDefLineMatchers[mIndexLastSuccessfulMatch]->GetMatch(read);
+         return;
+     }
+--- a/tools/loaders/sharq/fastq_parser.hpp
++++ b/tools/loaders/sharq/fastq_parser.hpp
+@@ -838,7 +838,7 @@ bool fastq_reader::parse_read(CFastqRead
+             }
+             do {
+                 // attempt to detect a missing quality score
+-                if (m_line_view[0] == '@' && m_line_view.size() != sequence_size && m_defline_parser.MatchLast(m_line_view)) {
++                if (m_line_view[0] == '@' && m_line_view.size() != sequence_size && m_defline_parser.MatchLast(re2::StringPiece(m_line_view.data(), m_line_view.size()))) {
+                     m_buffered_defline = m_line;
+                     break;
+                 }
+--- a/tools/loaders/sharq/CMakeLists.txt
++++ b/tools/loaders/sharq/CMakeLists.txt
+@@ -110,7 +110,7 @@ set(RE2_TAG 2021-09-01)
+ #    -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
+ #    -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}
+ #)
+-set(RE2_STATIC_LIBRARIES -lre2 )
++set(RE2_STATIC_LIBRARIES -lre2 -labsl_string_view)
+ 
+ 
+ #file(COPY ${CMAKE_SOURCE_DIR}/tools/sharq/sharq.py  DESTINATION ${BINDIR})
+--- a/test/loaders/sharq/CMakeLists.txt
++++ b/test/loaders/sharq/CMakeLists.txt
+@@ -50,7 +50,7 @@ message(RE2_FOUND=${RE2_FOUND})
+         set(LOCAL_BUILD_DIR ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
+         set(LOCAL_INCDIR ${LOCAL_BUILD_DIR}/include)
+         set(LOCAL_LIBDIR ${LOCAL_BUILD_DIR}/lib)
+-        set(RE2_STATIC_LIBRARIES -lre2 )
++        set(RE2_STATIC_LIBRARIES -lre2 -labsl_string_view)
+ 
+         if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+             set(CXX_FILESYSTEM_LIBRARIES "stdc++fs")



View it on GitLab: https://salsa.debian.org/med-team/sra-sdk/-/commit/c83c83f2821ae8491cbe9d9231323725b75ee7fb

-- 
View it on GitLab: https://salsa.debian.org/med-team/sra-sdk/-/commit/c83c83f2821ae8491cbe9d9231323725b75ee7fb
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20240506/9110f34b/attachment-0001.htm>


More information about the debian-med-commit mailing list