Skip to content

Commit

Permalink
Clean dynamically created files for test_features_with_templates and …
Browse files Browse the repository at this point in the history
…move to tmp
  • Loading branch information
DimaMolod committed Nov 13, 2023
1 parent 404fd65 commit 35c6240
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 293 deletions.
2 changes: 0 additions & 2 deletions test/test_data/true_multimer/description.csv

This file was deleted.

4 changes: 4 additions & 0 deletions test/test_data/true_multimer/fastas/3L4Q.fa
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
>3L4Q_A
SDEALKMTMASVPASRYLTDMTLEEMSRDWSMLIPKQKVAGPLCIRMDQAIMDKNIILKANFSVIFDRLETLILLRAFTEEGAIVGEISPLPSLPGHTAEDVKNAVGVLIGGLEWNDNTVRVSETLQRFAWRSSNENGRPPLTPKQKREMAGTIRSEV
>3L4Q_C
YQQDQIVKEDSVEAVGAQLKVYHQQYQDKSREYDQLYEEYTRTSQELQMKRTAIEAFNETIKIFEEQGQTQEKSSKEYLERFRREGNEKEMQRILLNSERLKSRIAEIHESRTKLEQELRAQASDNREIDKRMNSLKPDLMQLRKIRDQYLVWLTQKGARQKKINEWLGI
7 changes: 7 additions & 0 deletions test/test_data/true_multimer/fastas/RANdom_name1_.7-1_0.fasta
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
>RANdom_name1_.7-1_0_B
ISASDLALLTRQLATLVAAALPLEEALDAVAKQSEKPKLSALMAAVRAKVVEGHSLAEAM
GNFPGSFERLYCAMVAAGEASGHLDAVLNRLADYTEQRQQMRSRIQQ
>RANdom_name1_.7-1_0_C
ISASDLALLTRQLATLVAAALPLEEALDAVAKQSEKPKLSALMAAVRAKVVEGHSLAEAM
GNFPGSFERLYCAMVAAGEASGHLDAVLNRLADYTEQRQQMRSRIQQ

11 changes: 0 additions & 11 deletions test/test_data/true_multimer/features/3L4Q_A/pdb_hits.sto

This file was deleted.

This file was deleted.

Binary file modified test/test_data/true_multimer/features/3L4Q_C.pkl
Binary file not shown.
11 changes: 0 additions & 11 deletions test/test_data/true_multimer/features/3L4Q_C/pdb_hits.sto

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file modified test/test_data/true_multimer/features/RANdom_name1_.7-1_0_B.pkl
Binary file not shown.
Binary file not shown.
19 changes: 9 additions & 10 deletions test/test_features_with_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,25 @@
import pickle
import numpy as np
from alphapulldown.remove_clashes_low_plddt import extract_seqs
import tempfile
import shutil


class TestCreateIndividualFeaturesWithTemplates(absltest.TestCase):

def setUp(self):
super().setUp()
self.TEST_DATA_DIR = Path(__file__).parent / "test_data" / "true_multimer"
# Create necessary directories if they don't exist
self.temp_dir = tempfile.TemporaryDirectory() # Create a temporary directory
self.TEST_DATA_DIR = Path(self.temp_dir.name) # Use the temporary directory as the test data directory
# Copy test data files to the temporary directory
original_test_data_dir = Path(__file__).parent / "test_data" / "true_multimer"
shutil.copytree(original_test_data_dir, self.TEST_DATA_DIR, dirs_exist_ok=True)
# Create necessary directories
(self.TEST_DATA_DIR / 'features').mkdir(parents=True, exist_ok=True)
(self.TEST_DATA_DIR / 'templates').mkdir(parents=True, exist_ok=True)

def tearDown(self):
# Clean up any files or directories created during testing
sto_files = list((self.TEST_DATA_DIR / 'features').glob('*/pdb_hits.sto'))
for sto_file in sto_files:
if sto_file.exists():
sto_file.unlink()
desc_file = self.TEST_DATA_DIR / 'description.csv'
if desc_file.exists():
desc_file.unlink()
self.temp_dir.cleanup() # Clean up the temporary directory

def run_features_generation(self, file_name, chain_id, file_extension):
# Ensure directories exist
Expand Down

0 comments on commit 35c6240

Please sign in to comment.