File: raw_regex_pattern.patch

package info (click to toggle)
spades 4.0.0%2Breally3.15.5%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 97,372 kB
  • sloc: cpp: 850,755; ansic: 156,813; python: 23,134; perl: 4,547; sh: 2,349; makefile: 1,273; java: 890; pascal: 875; xml: 19
file content (108 lines) | stat: -rw-r--r-- 4,151 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
Description: passing regex patterns as raw strings to avoid SyntaxWarnings with
 Python 3
Author: Pierre Gruet <pgt@debian.org>
Bug-Debian: https://bugs.debian.org/1087093
Forwarded: no
Last-Update: 2024-12-14

--- a/assembler/ext/src/googletest/googletest/test/googletest-output-test.py
+++ b/assembler/ext/src/googletest/googletest/test/googletest-output-test.py
@@ -144,7 +144,7 @@
 
   if IS_WINDOWS:
     # Removes the color information that is not present on Windows.
-    test_output = re.sub('\x1b\\[(0;3\d)?m', '', test_output)
+    test_output = re.sub(r'\x1b\\[(0;3\d)?m', '', test_output)
     # Changes failure message headers into the Windows format.
     test_output = re.sub(r': Failure\n', r': error: ', test_output)
     # Changes file(line_number) to file:line_number.
--- a/assembler/src/projects/mts/scripts/common.py
+++ b/assembler/src/projects/mts/scripts/common.py
@@ -77,7 +77,7 @@
     return sample + "-" + res
 
 id_re = re.compile("\\d+")
-split_format = re.compile("^([\w.-]+)_\(\d+_\d+\)$")
+split_format = re.compile(r"^([\w.-]+)_\(\d+_\d+\)$")
 
 def extract_id(name):
     bin_id = None
@@ -107,7 +107,7 @@
 
 def contig_length(name):
     # Length of contig split
-    split = re.search("\((\d+)_(\d+)\)", name)
+    split = re.search(r"\((\d+)_(\d+)\)", name)
     if split:
         return int(split.group(2)) - int(split.group(1))
     #Default format
--- a/assembler/src/projects/mts/scripts/converters.py
+++ b/assembler/src/projects/mts/scripts/converters.py
@@ -34,7 +34,7 @@
                 self.header(params[1:])
             self.format(params[0], params[1:])
 
-extract_num = re.compile("\d+")
+extract_num = re.compile(r"\d+")
 
 class BinningParser:
     def __init__(self, sep=",", filter=None):
--- a/assembler/src/projects/mts/scripts/filter_nucmer.py
+++ b/assembler/src/projects/mts/scripts/filter_nucmer.py
@@ -25,9 +25,9 @@
     sys.exit(2)
 
 with open(nucmer_output_fn, "r") as nucmer_output:
-    contig_data = re.compile("CONTIG: ([\w.-]+) \((\d+)bp\)")
-    align_data = re.compile("Best alignment score: ([\d.]+)")
-    split_format = re.compile("^([\w.-]+_)_(\d+_\d+)_$") #Replace brackets back
+    contig_data = re.compile(r"CONTIG: ([\w.-]+) \((\d+)bp\)")
+    align_data = re.compile(r"Best alignment score: ([\d.]+)")
+    split_format = re.compile(r"^([\w.-]+_)_(\d+_\d+)_$") #Replace brackets back
     while True:
         line = nucmer_output.readline()
         if not line or line.startswith("Analyzing coverage"):
--- a/assembler/src/projects/mts/scripts/run_tsne.py
+++ b/assembler/src/projects/mts/scripts/run_tsne.py
@@ -76,7 +76,7 @@
     return points, names
 
 import re
-extract_num = re.compile("\d+")
+extract_num = re.compile(r"\d+")
 
 def run_tsne(features_file, colors_file, output_prefix
              , filter_sample=[]
--- a/assembler/src/projects/mts/test.py
+++ b/assembler/src/projects/mts/test.py
@@ -116,7 +116,7 @@
     class mut:
         res = 0
 
-    re_num = re.compile("-?\d+(?:\.\d+)?")
+    re_num = re.compile(r"-?\d+(?:\.\d+)?")
     def read_cell(str):
         maybe_num = re_num.search(str)
         if not maybe_num:
--- a/assembler/src/spades_pipeline/support.py
+++ b/assembler/src/spades_pipeline/support.py
@@ -528,7 +528,7 @@
         return text
 
     def natural_keys(text):
-        return [atoi(c) for c in re.split("(\d+)", text)]
+        return [atoi(c) for c in re.split(r"(\d+)", text)]
 
     latest_dir = None
     for dir_to_test in sorted(glob.glob(pattern), key=natural_keys, reverse=True):
--- a/assembler/src/tools/correctionEvaluator/bowtieOutputTranslator.py
+++ b/assembler/src/tools/correctionEvaluator/bowtieOutputTranslator.py
@@ -17,7 +17,7 @@
 
 class BowtieOutputTranslator:
     def __init__(self, bowtieOutputFile, alignedReadsFile):
-        self.numberRegularExpression = re.compile("\d+")
+        self.numberRegularExpression = re.compile(r"\d+")
         self.bowtieOutputFile = safeOpenFile(bowtieOutputFile, "r", "Error: no bowtie output file for translation found. Terminated.")
         self.alignedReadsFile = safeOpenFile(alignedReadsFile, "w", "Error: file can not be created. Terminated.")