Fast-HInt-ppi 0.2.0__tar.gz → 0.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/Fast_HInt/Fast_HInt.py +3 -2
  2. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/Fast_HInt/Scoring_HInt.py +0 -3
  3. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/Fast_HInt/Utils_HInt.py +65 -31
  4. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/Fast_HInt_ppi.egg-info/PKG-INFO +1 -1
  5. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/PKG-INFO +1 -1
  6. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/setup.py +1 -1
  7. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/Fast_HInt/File_proteins.py +0 -0
  8. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/Fast_HInt/__init__.py +0 -0
  9. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/Fast_HInt/get_good_inter_pae.py +0 -0
  10. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/Fast_HInt/script_pi_score/__init__.py +0 -0
  11. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/Fast_HInt/script_pi_score/calculate_mpdockq.py +0 -0
  12. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/Fast_HInt/script_pi_score/clean_pdb.py +0 -0
  13. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/Fast_HInt/script_pi_score/interface_assess.py +0 -0
  14. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/Fast_HInt/script_pi_score/pi_score_utils.py +0 -0
  15. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/Fast_HInt/script_pi_score/pisa_utils.py +0 -0
  16. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/Fast_HInt/script_pi_score/run_piscore_wc.py +0 -0
  17. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/Fast_HInt/script_pi_score/sc_utils.py +0 -0
  18. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/Fast_HInt/script_pi_score/svm_model/__init__.py +0 -0
  19. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/Fast_HInt/script_pi_score/svm_model/finalized_model_A.sav +0 -0
  20. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/Fast_HInt/script_pi_score/svm_model/finalized_model_B.sav +0 -0
  21. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/Fast_HInt/script_pi_score/svm_model/finalized_model_wc.sav +0 -0
  22. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/Fast_HInt/script_pi_score/svm_model/scaler_model_A.sav +0 -0
  23. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/Fast_HInt/script_pi_score/svm_model/scaler_model_B.sav +0 -0
  24. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/Fast_HInt/script_pi_score/svm_model/scaler_model_wc.sav +0 -0
  25. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/Fast_HInt_ppi.egg-info/SOURCES.txt +0 -0
  26. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/Fast_HInt_ppi.egg-info/dependency_links.txt +0 -0
  27. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/Fast_HInt_ppi.egg-info/entry_points.txt +0 -0
  28. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/Fast_HInt_ppi.egg-info/requires.txt +0 -0
  29. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/Fast_HInt_ppi.egg-info/top_level.txt +0 -0
  30. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/MANIFEST.in +0 -0
  31. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/README.md +0 -0
  32. {fast_hint_ppi-0.2.0 → fast_hint_ppi-0.2.2}/setup.cfg +0 -0
@@ -187,7 +187,7 @@ def main() :
187
187
  create_feature(HInt_object, Informations_dict, GPU, CPU, first_need_msa, first_need_pkl)
188
188
 
189
189
  HInt_object.Make_save_dict()
190
- prio_list_MSA = prioritize_by_vram_fit(job_with_vram_length, GPU)
190
+ prio_list_MSA = prioritize_by_vram_fit(job_with_vram_length, First_batch, GPU)
191
191
  batch_MSA = []
192
192
  if prio_list_MSA != [] :
193
193
  prio_list_MSA.pop(0) #remove first batch
@@ -198,7 +198,8 @@ def main() :
198
198
  new_prio_list.append(prot)
199
199
  if prot in need_pkl :
200
200
  new_prio_list.append(prot)
201
- batch_MSA.append(new_prio_list)
201
+ if new_prio_list != [] :
202
+ batch_MSA.append(new_prio_list)
202
203
 
203
204
  if len(first_need_msa) > 0 :
204
205
  logger.info("Generating MSA depth figures")
@@ -24,8 +24,6 @@ import shutil
24
24
  from pathlib import Path
25
25
  from multiprocessing import Pool
26
26
  from tqdm import tqdm
27
- from datetime import datetime
28
- from scipy.special import softmax
29
27
  from Bio import PDB
30
28
 
31
29
  # Configure global logger
@@ -94,7 +92,6 @@ def Score_interaction (file, Informations_dict, CPU, Interaction, job="", multi_
94
92
  bait_name = bait_name.replace(prot,f"{prot}_{start}-{end}")
95
93
  possible_prey = file.get_possible_prey()
96
94
  if job != "" :
97
- print("why")
98
95
  bait = job.replace(job.split(";")[-1],"").strip(";")
99
96
  bait_name = bait.replace(";","_and_")
100
97
  possible_prey = [job.split(";")[-1].strip("\n")]
@@ -90,7 +90,7 @@ def Define_informations() :
90
90
  logger.info("Set pickle feature path by default on ./feature")
91
91
  Informations_dict[informations_key] = "./feature"
92
92
  elif informations_key == "Path_MMseqs2_Data" :
93
- logger.info("/!\ local MMseqs2 GPU will not be used")
93
+ logger.info("Warning : local MMseqs2 GPU will not be used")
94
94
  elif informations_key == "Signal_peptide" :
95
95
  Informations_dict[informations_key] = "None"
96
96
  elif informations_key == "Homo-oligomer" :
@@ -454,21 +454,19 @@ def create_feature (file, Informations_dict, GPU, CPU, need_msa, need_pkl) :
454
454
  max_workers_mafft = CPU # how many jobs in parallel
455
455
 
456
456
  #Look for MSA in AlphaFold database
457
- logger.info(f"Search MSA in AlphaFold database")
457
+ logger.info(f"Searching for MSAs in the AlphaFold database")
458
458
 
459
459
  retry_queue = AFDB_msa_search(Path_Pickle_Feature,prot_SP,prot_no_SP,generated_msa)
460
460
 
461
461
  while retry_queue != [] : #retry if error during MSA search in AFdb
462
462
  retry_queue = AFDB_msa_search(Path_Pickle_Feature,prot_SP,prot_no_SP,retry_queue)
463
463
 
464
- logger.info("MSA search in AlphaFold database complete")
464
+ logger.info("MSA search in the AlphaFold database completed")
465
465
  file.create_fasta_file(False, need_msa, need_pkl)
466
466
 
467
467
  #Create MSA files with ColabFold mmseq2 classic pipeline for proteins without MSA, and pickle files for proteins generated with MMseqs2 GPU
468
- if AF_version == "2" : # Cause AF3 if too fast for hmmer MSA generation, so we use mmseqs2 classic pipeline for AF3
469
- mmseqs2 = "True"
470
- else :
471
- mmseqs2 = "False"
468
+ # Cause AF3 if too fast for hmmer MSA generation, so we use mmseqs2 classic pipeline for AF3
469
+
472
470
  if len(need_msa) > 0 :
473
471
  max_workers_feature = CPU
474
472
  futures_list = []
@@ -477,17 +475,17 @@ def create_feature (file, Informations_dict, GPU, CPU, need_msa, need_pkl) :
477
475
  msa_name = f"./log_file/{protein}_msa.fasta"
478
476
  cmd = ["create_individual_features.py",
479
477
  f"--fasta_paths={msa_name}",
480
- f"--data_dir=/data/alphadata_v2",
478
+ f"--data_dir={Path_AlphaFold_Data}",
481
479
  "--save_msa_files=True",
482
480
  f"--output_dir={Path_Pickle_Feature}",
483
481
  "--max_template_date=2024-05-02",
484
482
  "--skip_existing=True",
485
- f"--use_mmseqs2={mmseqs2}",
483
+ f"--use_mmseqs2=True",
486
484
  "--use_precomputed_msas=True"]
487
485
  futures_list.append(executor.submit(create_ind_feature, protein, msa_name, prot_no_SP, cmd))
488
486
  end = time.time()
489
487
  elapsed = end - start
490
- logger.info("Create MSA take "+ str(elapsed/60)+" minutes")
488
+ logger.info("MSA creation took "+ str(elapsed/60)+" minutes")
491
489
 
492
490
  #Create pkl files for proteins without pkl file (from MSA found in AFdb or error during MSA generation with ColabFold mmseqs2)
493
491
  if len(need_pkl) > 0 :
@@ -972,46 +970,82 @@ def Generate_first_batch(job_with_vram_length, GPU, multi_job_per_gpu) :
972
970
 
973
971
  return gpu_jobs, gpu_vram_used
974
972
 
975
- def prioritize_by_vram_fit(jobs, GPU, max_per_batch=3):
976
-
977
- import pynvml
973
+ def prioritize_by_vram_fit(jobs, first_batch, GPU, max_per_batch=3) :
978
974
 
979
975
  pynvml.nvmlInit()
980
976
  handle = pynvml.nvmlDeviceGetHandleByIndex(int(GPU[0]))
981
977
  max_vram = pynvml.nvmlDeviceGetMemoryInfo(handle).total / 1024**3
982
978
  pynvml.nvmlShutdown()
983
979
 
984
- jobs = sorted(jobs, key=lambda x: x[1], reverse=True)
980
+ jobs = [(job.strip().split(";")[1], vram) for job, vram in jobs]
981
+
982
+ jobs_dict = dict(jobs)
983
+
984
+ current_batch = [
985
+ (job, jobs_dict[job])
986
+ for job in first_batch[0]
987
+ if job in jobs_dict
988
+ ]
989
+
990
+ current_jobs = [job for job, _ in current_batch]
991
+
992
+ remaining = [(job, vram) for job, vram in jobs if job not in current_jobs]
985
993
 
986
- remaining = jobs.copy()
987
994
  all_batches = []
995
+ pending = []
996
+ alternate = 1
997
+
998
+ while remaining :
999
+ current_batch.sort(key=lambda x: x[1]) #small finish first
988
1000
 
989
- while remaining:
1001
+ finished_job, finished_vram = current_batch.pop(0)
990
1002
 
1003
+ total_vram = sum(vram for _, vram in current_batch)
991
1004
  batch = []
992
- used_vram = 0.0
993
1005
 
994
- # on tente plusieurs passes pour remplir correctement
995
- changed = True
1006
+ remaining.sort(
1007
+ key=lambda x: x[1],
1008
+ reverse=True
1009
+ )
996
1010
 
997
- while changed and len(batch) < max_per_batch:
998
- changed = False
1011
+ while len(batch) < max_per_batch :
1012
+ added = False
1013
+ for job, vram in remaining :
1014
+ if total_vram + vram <= max_vram or (vram <= finished_vram and alternate % 2 == 0) :
1015
+ alternate += 1
1016
+ batch.append(job)
1017
+ total_vram += vram
1018
+ added = True
1019
+ break
1020
+
999
1021
 
1000
- for i in range(len(remaining)):
1022
+ if not added :
1023
+ break
1001
1024
 
1002
- job, vram = remaining[i]
1025
+ if not batch :
1026
+ continue
1003
1027
 
1004
- if len(batch) < max_per_batch and used_vram + vram <= max_vram:
1005
- batch.append(job.split(";")[-1].strip("\n"))
1006
- used_vram += vram
1007
- remaining.pop(i)
1008
- changed = True
1009
- break
1028
+ remaining = [
1029
+ (job, vram)
1030
+ for job, vram in remaining
1031
+ if job not in batch
1032
+ ]
1010
1033
 
1011
- all_batches.append(batch)
1034
+ for job in batch :
1035
+ current_batch.append((job, jobs_dict[job]))
1012
1036
 
1013
- return all_batches
1037
+ for job in batch :
1038
+ if job not in pending :
1039
+ pending.append(job)
1040
+
1041
+ while len(pending) >= max_per_batch :
1042
+ all_batches.append(pending[:max_per_batch])
1043
+ pending = pending[max_per_batch:]
1014
1044
 
1045
+ if pending :
1046
+ all_batches.append(pending)
1047
+
1048
+ return all_batches
1015
1049
  def Generate_3D_model(HInt_object, CPU, multi_scoring, Informations_dict, interaction_type, job_with_vram_length, GPU, multi_job_per_gpu, seq_bait={}, compounds_dict={}) :
1016
1050
  """
1017
1051
  Generate 3D models using multiple GPUs and multiprocessing.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Fast_HInt-ppi
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: A tool to find homologous interactions and speed up AlphaFold-based structural modeling.
5
5
  Home-page: https://github.com/Qrouger/HInt
6
6
  Author: Quentin Rouger
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Fast_HInt-ppi
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: A tool to find homologous interactions and speed up AlphaFold-based structural modeling.
5
5
  Home-page: https://github.com/Qrouger/HInt
6
6
  Author: Quentin Rouger
@@ -4,7 +4,7 @@ from setuptools import setup
4
4
 
5
5
  setup(
6
6
  name='Fast_HInt-ppi',
7
- version='0.2.0',
7
+ version='0.2.2',
8
8
  description=(
9
9
  'A tool to find homologous interactions and speed up AlphaFold-based structural modeling.'
10
10
  ),
File without changes
File without changes
File without changes