Skip to content

Commit 2b531e8

Browse files
committed
Simplify filename matching during final stages of inference data processing
1 parent dbac0f9 commit 2b531e8

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

project/utils/deepinteract_utils.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -733,15 +733,12 @@ def convert_input_pdb_files_to_pair(left_pdb_filepath: str, right_pdb_filepath:
733733
pair_filepath = pair_filepaths[0]
734734
else:
735735
# Manually construct the already-postprocessed input pair's filepath since no pairs needed postprocessing
736-
pruned_pairs_dir = os.path.join(input_dataset_dir, 'interim', 'pairs')
737736
output_dir = os.path.join(input_dataset_dir, 'final', 'raw')
738737
produced_filenames = db.get_structures_filenames(output_dir, extension='.dill')
739738
produced_keys = [db.get_pdb_name(x) for x in produced_filenames
740-
if db.get_pdb_code(x) in db.get_pdb_code(left_pdb_filepath)]
741-
pdb_filename = [os.path.join(pruned_pairs_dir, db.get_pdb_code(key)[1:3], key)
742-
for key in produced_keys][0]
743-
sub_dir = output_dir + '/' + db.get_pdb_code(pdb_filename)[1:3]
744-
pair_filepath = sub_dir + '/' + db.get_pdb_name(pdb_filename)
739+
if db.get_pdb_code(x).upper() in db.get_pdb_code(left_pdb_filepath).upper()]
740+
pair_filepath = [os.path.join(output_dir, db.get_pdb_code(key)[1:3], key)
741+
for key in produced_keys][0]
745742
# Impute any missing feature values in the postprocessed input pairs
746743
impute_missing_feature_values(output_dir=os.path.join(input_dataset_dir, 'final', 'raw'))
747744
# Load preprocessed pair

0 commit comments

Comments
 (0)