[med-svn] [Git][med-team/parsnp][upstream] New upstream version 2.0.1+dfsg

Étienne Mollier (@emollier) gitlab at salsa.debian.org
Thu Jan 18 19:11:33 GMT 2024



Étienne Mollier pushed to branch upstream at Debian Med / parsnp


Commits:
8e9efa97 by Étienne Mollier at 2024-01-18T20:04:11+01:00
New upstream version 2.0.1+dfsg
- - - - -


1 changed file:

- parsnp


Changes:

=====================================
parsnp
=====================================
@@ -22,14 +22,14 @@ from multiprocessing import Pool
 from Bio import SeqIO
 from glob import glob
 from pathlib import Path
-from random import shuffle
 
 
 import extend as ext
 from tqdm import tqdm
 
-__version__ = "2.0.0"
+__version__ = "2.0.1"
 reroot_tree = True #use --midpoint-reroot
+random_seeded = random.Random(42)
 
 try:
     import dendropy
@@ -203,7 +203,9 @@ def parallelPhiWrapper(params):
 
 def run_logged_command(command, outputDir, label, **kwargs):
     with open(f"{outputDir}/log/{label}.out", 'w') as stdout_f, open(f"{outputDir}/log/{label}.err", 'w') as stderr_f:
-        return run_command(command="time " + command, stdout=stdout_f, stderr=stderr_f, **kwargs)
+        if shutil.which("time") is not None:
+            command = "time " + command
+        return run_command(command=command, stdout=stdout_f, stderr=stderr_f, **kwargs)
 
 def run_command(command, ignorerc=0, stdout=subprocess.PIPE, stderr=subprocess.PIPE):
     global SIGINT
@@ -1220,7 +1222,7 @@ SETTINGS:
     reflen = 0
 
     if ref == "!":
-        ref = random.choice(input_files)
+        ref = random_seeded.choice(input_files)
 
     # Check if reference genome is aligned
     reflen = check_ref_genome_aligned(ref)
@@ -1318,7 +1320,7 @@ SETTINGS:
                         ref = auto_ref
                         lowest_mumi = mumi_dict[idx]
             mumi_f = ""
-            if mumi_only and not curated:
+            if mumi_only:
                 mumi_f = open(os.path.join(outputDir, "config", "recruited_genomes.lst"),'w')
 
 
@@ -1348,6 +1350,9 @@ SETTINGS:
                             mumi_f.write(os.path.abspath(fnafiles[idx])+",%f"%(mumi_dict[idx])+"\n")
                         finalfiles.append(fnafiles[idx])
                         allfiles.append(fnafiles[idx])
+            if mumi_only:
+                mumi_f.close()
+                exit(0)
 
         else:
             try:
@@ -1412,10 +1417,6 @@ SETTINGS:
             if f not in allfiles:
                 allfiles.append(f)
 
-    if mumi_only:
-        mumi_f.close()
-        sys.exit(1)
-
     # More stuff to autopick the reference if needed:
     orig_auto_ref = auto_ref
     if os.path.exists(auto_ref) and autopick_ref:
@@ -1442,6 +1443,7 @@ SETTINGS:
         ffo.close()
         ref = auto_ref
 
+    finalfiles = sorted(finalfiles)
     totseqs = len(finalfiles)
 
     #initiate parallelPhiPack tasks
@@ -1612,7 +1614,7 @@ SETTINGS:
 
         full_query_list_path = f"{outputDir}/config/input-list.txt"
         with open(full_query_list_path, 'w') as input_list_handle:
-            shuffle(finalfiles)
+            random_seeded.shuffle(finalfiles)
             for qf in finalfiles:
                 input_list_handle.write(qf + "\n")
 
@@ -1649,7 +1651,7 @@ SETTINGS:
                     logger.error(f"Partition {cl} failed...")
                     good_chunks.remove(cl)
             
-        chunk_labels = list(good_chunks)
+        chunk_labels = sorted(list(good_chunks))
 
         logger.info("Computing intersection of all partition LCBs...")
         chunk_to_intvervaldict = partition.get_chunked_intervals(partition_output_dir, chunk_labels)



View it on GitLab: https://salsa.debian.org/med-team/parsnp/-/commit/8e9efa97920401db57e633f1a75a466065cc13a6

-- 
View it on GitLab: https://salsa.debian.org/med-team/parsnp/-/commit/8e9efa97920401db57e633f1a75a466065cc13a6
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/20240118/dba15c9f/attachment-0001.htm>


More information about the debian-med-commit mailing list