You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dolphyn is awesome! I found the github page via the publication!
I just wanted to ask what Python Version do you use for running Dolphyn?
I'm running python 3.12 and I get an error because random package (I think past python 3.11?) do not take in sets when selecting random samples. (similar to something described here benedekrozemberczki/littleballoffur#27)
I was running through the jupyter tutorial to learn how to use Dolphyn, but when I get to: ge = D.findEpitopes(testrun = 2, protein_seq_file = protein_seq_file, epitile_size=15, epitope_probability_cutoff = 0.5)
I get errors about sets not supported in random.sample()
I fiddled a bit with the function:
def balance_DS(X, y, random_state=42):
wildtypeIDs = set([item[0] for item in X.index.str.split("_")])
random.seed(random_state)
size_smaller_group = y.value_counts().min()
pos_IDs = set(y[y==1].index)
# pos_IDs = list(set(y[y==1].index)) # I just made sets into lists
neg_IDs = set(y[y==0].index)
# neg_IDs = list(set(y[y==0].index)) # here
neg_IDs= random.sample(neg_IDs, size_smaller_group)
pos_IDs= random.sample(pos_IDs, size_smaller_group)
balancedIDs = set(pos_IDs + neg_IDs)
# balancedIDs = list(set(pos_IDs + neg_IDs)) # and here
y_bal = y.loc[balancedIDs,]
X_bal = X.loc[balancedIDs,]
return(X_bal, y_bal)
This seemed to fix my errors. Do you also see this?
Cheers and thanks!
The text was updated successfully, but these errors were encountered:
Hi!
Dolphyn is awesome! I found the github page via the publication!
I just wanted to ask what Python Version do you use for running Dolphyn?
I'm running python 3.12 and I get an error because random package (I think past python 3.11?) do not take in sets when selecting random samples. (similar to something described here benedekrozemberczki/littleballoffur#27)
I was running through the jupyter tutorial to learn how to use Dolphyn, but when I get to:
ge = D.findEpitopes(testrun = 2, protein_seq_file = protein_seq_file, epitile_size=15, epitope_probability_cutoff = 0.5)
I get errors about sets not supported in
random.sample()
I fiddled a bit with the function:
This seemed to fix my errors. Do you also see this?
Cheers and thanks!
The text was updated successfully, but these errors were encountered: