File: support_libre2-11.patch

package info (click to toggle)
sra-sdk 3.2.1%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 296,128 kB
  • sloc: ansic: 532,876; cpp: 243,000; perl: 9,649; python: 8,978; sh: 7,888; java: 6,253; makefile: 1,148; yacc: 703; xml: 310; lex: 236
file content (563 lines) | stat: -rw-r--r-- 27,933 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
--- 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
@@ -9,6 +9,7 @@
 
 #include "fastq_read.hpp"
 #include "regexpr.hpp"
+#include <absl/strings/match.h>
 #include <insdc/sra.h>
 
 using namespace std;
@@ -59,7 +60,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 +108,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;}
 
@@ -182,16 +183,16 @@ public:
     {
         m_tmp_spot.clear();
         if (!re.GetMatch()[0].empty()) {
-            re.GetMatch()[0].CopyToString(&m_tmp_spot);
+            m_tmp_spot.assign(re.GetMatch()[0].data(), re.GetMatch()[0].size());
             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]);
@@ -251,12 +252,12 @@ public:
 
         auto& readNum = re.GetMatch()[10];
 
-        m_tmp_suffix.set(nullptr, 0);
+        m_tmp_suffix = re2::StringPiece();
         if (illuminaOldSuffix2.Matches(y)) {
             y = illuminaOldSuffix2.GetMatch()[0];
             auto& suffix = illuminaOldSuffix2.GetMatch()[1];
             if (suffix.size() >= 3) {
-                if (suffix.starts_with("/1") || suffix.starts_with("/2"))
+                if (absl::StartsWith(suffix, "/1") || absl::StartsWith(suffix, "/2"))
                     suffix.remove_prefix(2);
                 m_tmp_suffix = suffix;                    
             }         
@@ -274,16 +275,16 @@ 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
-                x.AppendToString(&new_suffix); //x 
-                re.GetMatch()[7].AppendToString(&new_suffix); // sep4
-                y.AppendToString(&new_suffix); //y
+                new_suffix.append(re.GetMatch()[5].data(), re.GetMatch()[5].size()); // sep3
+		new_suffix.append(x.data(), x.size()); //x
+                new_suffix.append(re.GetMatch()[7].data(), re.GetMatch()[7].size()); // sep4
+		new_suffix.append(y.data(), y.size()); //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
-                y.AppendToString(&new_suffix); //y
+                new_suffix.append(re.GetMatch()[7].data(), re.GetMatch()[7].size()); // sep4
+		new_suffix.append(y.data(), y.size()); //y
                 new_suffix.append(read.Suffix());
                 read.SetSuffix(new_suffix);
             }
@@ -293,52 +294,63 @@ public:
         if (numDiscards == 1) {
             assert(!prefix.empty());
             if (sub_re1.Matches(prefix)) {
-                sub_re1.GetMatch()[0].AppendToString(&m_tmp_spot);
-                sub_re1.GetMatch()[1].AppendToString(&m_tmp_spot);
-                sub_re1.GetMatch()[2].AppendToString(&m_tmp_spot);
+                m_tmp_spot.append(sub_re1.GetMatch()[0].data(),
+				  sub_re1.GetMatch()[0].size());
+                m_tmp_spot.append(sub_re1.GetMatch()[1].data(),
+				  sub_re1.GetMatch()[1].size());
+                m_tmp_spot.append(sub_re1.GetMatch()[2].data(),
+				  sub_re1.GetMatch()[2].size());
             } else {
-                prefix.AppendToString(&m_tmp_spot);
+                m_tmp_spot.append(prefix.data(), prefix.size());
             }
             s_add_sep(m_tmp_spot, re.GetMatch()[1]);
-            lane.AppendToString(&m_tmp_spot);
+            m_tmp_spot.append(lane.data(), lane.size());
             s_add_sep(m_tmp_spot, re.GetMatch()[3]);
-            tile.AppendToString(&m_tmp_spot);
+            m_tmp_spot.append(tile.data(), tile.size());
             s_add_sep(m_tmp_spot, re.GetMatch()[5]);
-            x.AppendToString(&m_tmp_spot);
+            m_tmp_spot.append(x.data(), x.size());
 
         } else if (numDiscards == 2) {
             assert(!prefix.empty());
             if (sub_re2.Matches(prefix)) {
-                sub_re2.GetMatch()[0].AppendToString(&m_tmp_spot);
-                sub_re2.GetMatch()[1].AppendToString(&m_tmp_spot);
-                sub_re2.GetMatch()[2].AppendToString(&m_tmp_spot);
-                sub_re2.GetMatch()[3].AppendToString(&m_tmp_spot);
-                sub_re2.GetMatch()[4].AppendToString(&m_tmp_spot);
+                m_tmp_spot.append(sub_re2.GetMatch()[0].data(),
+				  sub_re2.GetMatch()[0].size());
+                m_tmp_spot.append(sub_re2.GetMatch()[1].data(),
+				  sub_re2.GetMatch()[1].size());
+                m_tmp_spot.append(sub_re2.GetMatch()[2].data(),
+				  sub_re2.GetMatch()[2].size());
+                m_tmp_spot.append(sub_re2.GetMatch()[3].data(),
+				  sub_re2.GetMatch()[3].size());
+                m_tmp_spot.append(sub_re2.GetMatch()[4].data(),
+				  sub_re2.GetMatch()[4].size());
             } else if (sub_re3.Matches(prefix)) {
-                sub_re3.GetMatch()[0].AppendToString(&m_tmp_spot);
-                sub_re3.GetMatch()[1].AppendToString(&m_tmp_spot);
-                sub_re3.GetMatch()[2].AppendToString(&m_tmp_spot);
+                m_tmp_spot.append(sub_re3.GetMatch()[0].data(),
+				  sub_re3.GetMatch()[0].size());
+                m_tmp_spot.append(sub_re3.GetMatch()[1].data(),
+				  sub_re3.GetMatch()[1].size());
+                m_tmp_spot.append(sub_re3.GetMatch()[2].data(),
+				  sub_re3.GetMatch()[2].size());
             } else {
                 assert(false);
                 throw fastq_error(101, "Unexpected IlluminaOld Defline");
             }
             s_add_sep(m_tmp_spot, re.GetMatch()[1]);
-            lane.AppendToString(&m_tmp_spot);
+            m_tmp_spot.append(lane.data(), lane.size());
             s_add_sep(m_tmp_spot, re.GetMatch()[3]);
-            tile.AppendToString(&m_tmp_spot);
+            m_tmp_spot.append(tile.data(), tile.size());
 
         } else {
             if (!prefix.empty()) {
-                prefix.CopyToString(&m_tmp_spot);
+		m_tmp_spot.assign(prefix.data(), prefix.size());
                 s_add_sep(m_tmp_spot, re.GetMatch()[1]);
             }
-            lane.AppendToString(&m_tmp_spot); //lane
+            m_tmp_spot.append(lane.data(), lane.size()); //lane
             s_add_sep(m_tmp_spot, re.GetMatch()[3]); // sep2
-            tile.AppendToString(&m_tmp_spot); //tile
+            m_tmp_spot.append(tile.data(), tile.size()); //tile
             s_add_sep(m_tmp_spot, re.GetMatch()[5]); // sep3
-            x.AppendToString(&m_tmp_spot); //x
+            m_tmp_spot.append(x.data(), x.size()); //x
             s_add_sep(m_tmp_spot, re.GetMatch()[7]); //sep 4
-            y.AppendToString(&m_tmp_spot); //y
+            m_tmp_spot.append(y.data(), y.size()); //y
         }
         read.MoveSpot(std::move(m_tmp_spot));
 
@@ -437,7 +449,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,14 +576,14 @@ 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("/"))
+        if (!re.GetMatch()[6].empty() && absl::StartsWith(re.GetMatch()[6], "/"))
             re.GetMatch()[6].remove_prefix(1);
         read.SetReadNum(re.GetMatch()[6]);
 
@@ -602,11 +614,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 +687,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 +778,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 +803,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 +861,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 +905,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 +946,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 +1002,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 +1040,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];
 
@@ -1049,7 +1063,7 @@ public:
             read.SetReadNum( suffix == "L" ? readNum1 : readNum2 );
         } else {
             read.SetSuffix(suffix);
-            if (readNum.starts_with("/") || readNum.starts_with("\\")) 
+            if (absl::StartsWith(readNum, "/") || absl::StartsWith(readNum, "\\")) 
                 readNum.remove_prefix(1);
             else if (readNum == "L")
                 readNum = "1";
@@ -1085,11 +1099,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 +1143,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,11 +1214,11 @@ 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];
-        if (spot_group.starts_with("#")) {
+        if (absl::StartsWith(spot_group, "#")) {
             spot_group.remove_prefix(1);
             read.SetSpotGroup(spot_group);
             auto& read_num = re.GetMatch()[2];
--- 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
@@ -847,7 +847,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
@@ -92,7 +92,7 @@ if( SINGLE_CONFIG )
         #     -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)
         
         add_custom_target(
           sharq.py
--- 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")