-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
I've loaded the file into Python but I can't figure out how to interpret the results inside. I'm assuming the rows are compounds and columns are pathways but how can I get the labels of enzymes and pathways?
import pickle
with open("/Users/jolespin/Databases/Pathway2Vec/ec2pathway.pkl", "rb") as f:
ec2pathway = pickle.load(f)
# DeprecationWarning: Please use `lil_matrix` from the `scipy.sparse` namespace, the `scipy.sparse.lil` namespace is deprecated.
type(ec2pathway)
# scipy.sparse._lil.lil_matrix
ec2pathway.data
# array([list([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]),
# list([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]),
# list([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]),
# ..., list([]), list([1, 1, 1, 1, 1, 1, 1, 1]), list([1, 1])],
# dtype=object)
df = pd.DataFrame(ec2pathway.todense())
print(df.shape)
# (6378, 2526)
df[0][lambda x: x != 0]
# 3579 1
# 3667 1
# 3678 1
# 3681 1
# Name: 0, dtype: int32
Metadata
Metadata
Assignees
Labels
No labels