Skip to content

Commit

Permalink
Merge pull request #134 from jyaacoub/v103
Browse files Browse the repository at this point in the history
Merging two branches for #103
  • Loading branch information
jyaacoub authored Aug 7, 2024
2 parents c163778 + 1aa39ef commit bb06794
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions playground.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
skip_download=True
)


#%%
import pandas as pd

Expand Down Expand Up @@ -66,10 +65,6 @@ def get_test_oncokbs(train_df=pd.read_csv('/cluster/home/t122995uhn/projects/dat

get_test_oncokbs(train_df=train_df)





#%%
##############################################################################
########################## BUILD/SPLIT DATASETS ##############################
Expand All @@ -94,6 +89,7 @@ def get_test_oncokbs(train_df=pd.read_csv('/cluster/home/t122995uhn/projects/dat
ligand_features=[cfg.LIG_FEAT_OPT.original, cfg.LIG_FEAT_OPT.gvp],
ligand_edges=cfg.LIG_EDGE_OPT.binary, overwrite=False,
k_folds=5,

test_prots_csv=f'{split}/test.csv',
val_prots_csv=[f'{split}/val{i}.csv' for i in range(5)])

Expand Down
2 changes: 1 addition & 1 deletion src/train_test/splitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def resplit(dataset:str|BaseDataset, split_files:dict|str=None, use_train_set=Fa
del split_files['test']

# Building the folds
for k, v in split_files.items():
for k, v in tqdm(split_files.items(), desc="Building folds from split files"):
prots = set(pd.read_csv(v)['prot_id'])
val_idxs = [i for i in range(len(dataset.df)) if dataset.df.iloc[i]['prot_id'] in prots]
assert len(val_idxs) > 100, f"Error in splitting, not enough entries in {k} split - {v}"
Expand Down
2 changes: 1 addition & 1 deletion src/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class LIG_FEAT_OPT(StringEnum):
from pathlib import Path

# Model save paths
issue_number = 131
issue_number = 103
DATA_BASENAME = f'data/{f"v{issue_number}" if issue_number else ""}'
RESULTS_PATH = os.path.abspath(f'results/v{issue_number}/')
MEDIA_SAVE_DIR = f'{RESULTS_PATH}/model_media/'
Expand Down

0 comments on commit bb06794

Please sign in to comment.