Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
T
TFM_AdrianAyusoMuñoz
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Disnet
GNNs
TFM_AdrianAyusoMuñoz
Commits
852e50e1
Commit
852e50e1
authored
Jun 28, 2023
by
ADRIAN AYUSO MUNOZ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add comments and fix clarity.
parent
31568329
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
heterograph_construction.py
heterograph_construction.py
+3
-3
topN.py
topN.py
+1
-1
No files found.
heterograph_construction.py
View file @
852e50e1
...
...
@@ -213,9 +213,9 @@ class DISNETConstructor:
# Delete from the graph the edges of repo_db
dis_dru_the
=
pd
.
concat
([
dis_dru_the
,
dis_dru_the_repoDBAll
])
dis_dru_the
.
drop_duplicates
(
keep
=
False
,
inplace
=
True
)
dis_dru_the
.
drop_duplicates
(
keep
=
False
,
inplace
=
True
,
ignore_index
=
True
)
dis_dru_the
=
dis_dru_the
[:
50355
]
dis_dru_the
=
dis_dru_the
[:
50355
]
# Those of RepoDB added for the concatenation are deleted.
dis_dru_the_repoDBAll
=
(
torch
.
tensor
(
dis_dru_the_repoDBAll
[
'disNID'
]
.
astype
(
np
.
int32
)
.
to_numpy
(),
dtype
=
torch
.
int32
,
...
...
@@ -321,7 +321,7 @@ class DISNETConstructor:
# Add the edges to the graph.
for
edge_t
in
edges_dict
.
keys
():
for
edge
in
edges
[
edge_t
]:
for
edge
in
edges
[
edge_t
]:
# If a relation between a phenotype and a drug is in more than one type. The final type will be the last one.
try
:
G
.
add_edge
(
int
(
edge
[
0
]),
int
(
edge
[
1
]),
edge_feature
=
edge
[
2
],
edge_type
=
edge_t
)
except
IndexError
:
...
...
topN.py
View file @
852e50e1
...
...
@@ -26,7 +26,7 @@ def filterPreds(original, pred):
new
=
[]
for
i
,
elem
in
enumerate
(
pred
):
pred_labels
=
pred
[
e
dge
,
i
]
pred_labels
=
pred
[
e
lem
]
head
=
i
tail
=
torch
.
arange
(
0
,
len
(
pred_labels
))
# All tails.
indexH
=
((
headsO
==
head
)
.
nonzero
(
as_tuple
=
True
)[
0
])
# Index of those heads originally present in the graph.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment