Skip to content

Commit f301dcf

Browse files
committed
Ensure PDB codes match for input pairs
1 parent 83464c5 commit f301dcf

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

project/utils/deepinteract_utils.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,8 @@ def launch_postprocessing_of_pruned_pairs(raw_pdb_dir='datasets/Input/raw',
693693
external_feats_dir='datasets/Input/interim/external_feats',
694694
output_dir='datasets/Input/final/raw',
695695
num_cpus=1,
696-
source_type='input'):
696+
source_type='input',
697+
pdb_code=''):
697698
"""Run postprocess_pruned_pairs() on all provided complexes."""
698699
logger = logging.getLogger(__name__)
699700
logger.info(f'Starting postprocessing for all unprocessed pairs in {pruned_pairs_dir}')
@@ -715,7 +716,8 @@ def launch_postprocessing_of_pruned_pairs(raw_pdb_dir='datasets/Input/raw',
715716
work_filenames = [os.path.join(pruned_pairs_dir, db.get_pdb_code(work_key)[1:3], work_key + rscb_pruned_pair_ext)
716717
for work_key in work_keys]
717718
input_work_filenames = [os.path.join(pruned_pairs_dir, db.get_pdb_code(work_key)[1:3],
718-
work_key + rscb_pruned_pair_ext) for work_key in input_work_keys]
719+
work_key + rscb_pruned_pair_ext) for work_key in input_work_keys
720+
if pdb_code in work_key]
719721
logger.info(f'Found {len(work_keys)} work pair(s) in {pruned_pairs_dir}')
720722

721723
# Remove any duplicate filenames
@@ -789,7 +791,8 @@ def convert_input_pdb_files_to_pair(left_pdb_filepath: str, right_pdb_filepath:
789791
raw_pdb_dir=os.path.join(input_dataset_dir, 'raw'),
790792
pruned_pairs_dir=os.path.join(input_dataset_dir, 'interim', 'pairs'),
791793
external_feats_dir=os.path.join(input_dataset_dir, 'interim', 'external_feats'),
792-
output_dir=os.path.join(input_dataset_dir, 'final', 'raw')
794+
output_dir=os.path.join(input_dataset_dir, 'final', 'raw'),
795+
pdb_code=pdb_code
793796
)
794797
if len(pair_filepaths) > 0:
795798
# Retrieve the filepath of the single input pair produced in this case

0 commit comments

Comments
 (0)