File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020from zipfile import ZipFile
2121import os
2222import sys
23+ import pathlib
24+
25+ this_dir = str (pathlib .Path (__file__ ).parent .absolute ())
2326
2427MAX_ATOM = 200
2528MAX_BOND = 400
2629
2730# ESPF encoding
28- vocab_path = './DeepPurpose/ ESPF/drug_codes_chembl_freq_1500.txt'
31+ vocab_path = f" { this_dir } / ESPF/drug_codes_chembl_freq_1500.txt"
2932bpe_codes_drug = codecs .open (vocab_path )
3033dbpe = BPE (bpe_codes_drug , merges = - 1 , separator = '' )
31- sub_csv = pd .read_csv ('./DeepPurpose/ ESPF/subword_units_map_chembl_freq_1500.csv' )
34+ sub_csv = pd .read_csv (f" { this_dir } / ESPF/subword_units_map_chembl_freq_1500.csv" )
3235
3336idx2word_d = sub_csv ['index' ].values
3437words2idx_d = dict (zip (idx2word_d , range (0 , len (idx2word_d ))))
3538
36- vocab_path = './DeepPurpose/ ESPF/protein_codes_uniprot_2000.txt'
39+ vocab_path = f" { this_dir } / ESPF/protein_codes_uniprot_2000.txt"
3740bpe_codes_protein = codecs .open (vocab_path )
3841pbpe = BPE (bpe_codes_protein , merges = - 1 , separator = '' )
3942#sub_csv = pd.read_csv(dataFolder + '/subword_units_map_protein.csv')
40- sub_csv = pd .read_csv ('./DeepPurpose/ ESPF/subword_units_map_uniprot_2000.csv' )
43+ sub_csv = pd .read_csv (f" { this_dir } / ESPF/subword_units_map_uniprot_2000.csv" )
4144
4245idx2word_p = sub_csv ['index' ].values
4346words2idx_p = dict (zip (idx2word_p , range (0 , len (idx2word_p ))))
You can’t perform that action at this time.
0 commit comments