[med-svn] [Git][med-team/discosnp][master] 3 commits: Fix Python3.12 syntax Closes: #1085542

Andreas Tille (@tille) gitlab at salsa.debian.org
Sat Dec 7 09:12:05 GMT 2024



Andreas Tille pushed to branch master at Debian Med / discosnp


Commits:
7663f593 by Andreas Tille at 2024-12-07T10:06:09+01:00
Fix Python3.12 syntax Closes: #1085542

- - - - -
40183e74 by Andreas Tille at 2024-12-07T10:06:44+01:00
Standards-Version: 4.7.0 (routine-update)

- - - - -
869c2e20 by Andreas Tille at 2024-12-07T10:08:21+01:00
routine-update: Ready to upload to unstable

- - - - -


4 changed files:

- debian/changelog
- debian/control
- + debian/patches/python3.12-syntax.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+discosnp (1:2.6.2-4) unstable; urgency=medium
+
+  * Fix Python3.12 syntax
+    Closes: #1085542
+  * Standards-Version: 4.7.0 (routine-update)
+
+ -- Andreas Tille <tille at debian.org>  Sat, 07 Dec 2024 10:07:19 +0100
+
 discosnp (1:2.6.2-3) unstable; urgency=medium
 
   * Add loong64 support


=====================================
debian/control
=====================================
@@ -12,7 +12,7 @@ Build-Depends: debhelper-compat (= 13),
                libboost-dev,
                libhdf5-dev,
                zlib1g-dev
-Standards-Version: 4.6.2
+Standards-Version: 4.7.0
 Vcs-Browser: https://salsa.debian.org/med-team/discosnp
 Vcs-Git: https://salsa.debian.org/med-team/discosnp.git
 Homepage: http://colibread.inria.fr/discosnp/


=====================================
debian/patches/python3.12-syntax.patch
=====================================
@@ -0,0 +1,94 @@
+Description: Fix Python3.12 string syntax
+Bug-Debian: https://bugs.debian.org/1085542
+Author: Andreas Tille <tille at debian.org>
+Last-Update: 2024-06-07
+
+--- a/discoSnpRAD/clustering_scripts/fasta_and_cluster_to_filtered_vcf.py
++++ b/discoSnpRAD/clustering_scripts/fasta_and_cluster_to_filtered_vcf.py
+@@ -143,7 +143,7 @@ def main():
+                 splitted_1 = line.split("|")
+ 
+                 #nb_samples:
+-                tig_type = len(re.findall("left_\w+_length",line))
++                tig_type = len(re.findall(r"left_\w+_length",line))
+                 nb_fixed_fields = 4 + 2*tig_type
+                 nb_samples = (len(splitted_1) - (nb_fixed_fields + 1))/3
+                 if nb_samples % 1 != 0:
+--- a/scripts/ClassVCF_creator.py
++++ b/scripts/ClassVCF_creator.py
+@@ -79,7 +79,7 @@ def ReverseComplement(seq: str) -> str:
+ 
+ def shift_from_cigar_code(cigarcode, pospol):
+         # print ("shift",cigarcode,pospol)
+-        parsingCigarCode=re.findall('(\d+|[A-Za-z])',cigarcode) #ParsingCigarCode=['2', 'S', '3', 'M', '1', 'I', '25', 'M']
++        parsingCigarCode=re.findall(r'(\d+|[A-Za-z])',cigarcode) #ParsingCigarCode=['2', 'S', '3', 'M', '1', 'I', '25', 'M']
+         # print (parsingCigarCode)
+         shift=0
+         pos=0
+@@ -563,7 +563,7 @@ class PATH():
+         def CigarcodeChecker(self):
+                 """Checks in the cigarcode of the samfile if there is a shift in the alignment between the path and the reference"""
+                 cigarcode = self.listSam[5]               
+-                parsingCigarCode=re.findall('(\d+|[A-Za-z])',cigarcode) #ParsingCigarCode=['2', 'S', '3', 'M', '1', 'I', '25', 'M']
++                parsingCigarCode=re.findall(r'(\d+|[A-Za-z])',cigarcode) #ParsingCigarCode=['2', 'S', '3', 'M', '1', 'I', '25', 'M']
+                 listPosRef=[]
+                 listShift=[]
+                 somme=0
+@@ -636,7 +636,7 @@ class PATH():
+                         return()  
+                 nucleoRef=None
+                 matchInt=None
+-                parsingPosMut=re.findall('(\d+|[A-Za-z]|\^)',posMut)
++                parsingPosMut=re.findall(r'(\d+|[A-Za-z]|\^)',posMut)
+                 while i<len(parsingPosMut):#Converts the number into integer 
+                         matchInt=re.match(r'\d+',parsingPosMut[i]) #Integer motif
+                         if matchInt:
+--- a/scripts/create_filtered_vcf.py
++++ b/scripts/create_filtered_vcf.py
+@@ -87,7 +87,7 @@ def main():
+                 if re.match(">cluster_",splitted_1[0]):
+                     with_cluster = True
+                 #nb_samples:
+-                tig_type = len(re.findall("left_\w+_length",line))
++                tig_type = len(re.findall(r"left_\w+_length",line))
+                 nb_fixed_fields = 4 + 2*tig_type
+                 nb_samples = (len(splitted_1) - (nb_fixed_fields + 1))/3
+                 if nb_samples % 1 != 0:
+--- a/scripts/vcf_formatting_functions.py
++++ b/scripts/vcf_formatting_functions.py
+@@ -91,7 +91,7 @@ def format_vcf(splitted_1, splitted_2, n
+     path_name = splitted_1[0].lstrip(">")
+     CHROM = path_name
+     id = path_name.split("_")[3]
+-    ty = re.findall("(\w+)_higher_path",path_name)[0]
++    ty = re.findall(r"(\w+)_higher_path",path_name)[0]
+     
+     if ty != "SNP":
+         ty = "INS"
+@@ -99,11 +99,11 @@ def format_vcf(splitted_1, splitted_2, n
+     INFO = f"Ty={ty};Rk={rank};"
+     position_offset = 0
+     if tig_type >0:
+-        unitig_len = re.findall("_unitig_length_(\d+)","|".join(splitted_1[4:6]))
++        unitig_len = re.findall(r"_unitig_length_(\d+)","|".join(splitted_1[4:6]))
+         position_offset = int(unitig_len[0])
+         INFO += f"UL={unitig_len[0]};UR={unitig_len[1]};";
+         if tig_type == 2:
+-            contig_len = re.findall("_contig_length_(\d+)","|".join(splitted_1[6:8]))
++            contig_len = re.findall(r"_contig_length_(\d+)","|".join(splitted_1[6:8]))
+             position_offset = int(contig_len[0]) # if contig POS = POS + left_contig_len
+             INFO += f"CL={contig_len[0]};CR={contig_len[1]};"
+         else:
+@@ -136,10 +136,10 @@ def format_vcf(splitted_1, splitted_2, n
+     i = 1
+     for pol in cigar:
+         if ty == "SNP":
+-            POS, REF, ALT = re.findall("P_\d+:(\d+)_(\w)/(\w)",pol)[0]
++            POS, REF, ALT = re.findall(r"P_\d+:(\d+)_(\w)/(\w)",pol)[0]
+             POS = int(POS) + position_offset  # POS is 1-based
+         else:  # INDEL
+-            POS, indel_size = re.findall("P_\d+:(\d+)_(\d+)",pol)[0]
++            POS, indel_size = re.findall(r"P_\d+:(\d+)_(\d+)",pol)[0]
+             POS = int(POS) + position_offset # 1-based
+             ALT = sequence[(POS-1):(POS+int(indel_size))]
+             REF = ALT[0]


=====================================
debian/patches/series
=====================================
@@ -6,3 +6,4 @@ spelling.patch
 adapt_test_scripts.patch
 2to3.patch
 shell_syntax.patch
+python3.12-syntax.patch



View it on GitLab: https://salsa.debian.org/med-team/discosnp/-/compare/21d3f942c48f43581b8b9abc1497b43c0d3091d7...869c2e20a1fbd1477e471c4c05305d6290f24ddc

-- 
View it on GitLab: https://salsa.debian.org/med-team/discosnp/-/compare/21d3f942c48f43581b8b9abc1497b43c0d3091d7...869c2e20a1fbd1477e471c4c05305d6290f24ddc
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/20241207/3cba3c92/attachment-0001.htm>


More information about the debian-med-commit mailing list