Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging two branches for #103 #134

Merged
merged 3 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading