Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
T
TFG_MariaMarinTercero
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
TFG_MariaMarinTercero
Commits
e83f5437
Commit
e83f5437
authored
Feb 19, 2024
by
Maria Marin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update funciones_network_medicine.py
parent
f6f3a19e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
análisis/network medicine/funciones_network_medicine.py
análisis/network medicine/funciones_network_medicine.py
+3
-3
No files found.
análisis/network medicine/funciones_network_medicine.py
View file @
e83f5437
...
...
@@ -631,20 +631,20 @@ def rep_prox(df_combinado, nombre_enf):
farmacos_con_enf
=
df_combinado
[(
df_combinado
[
'Enfermedades'
]
==
nombre_enf
)
&
(
df_combinado
[
'Tratamiento'
]
==
'yes'
)]
farmacos_sin_enf
=
df_combinado
[(
df_combinado
[
'Enfermedades'
]
==
nombre_enf
)
&
(
df_combinado
[
'Tratamiento'
]
==
'unknown'
)]
combined_data
=
pd
.
concat
([
farmacos_con_enf
.
assign
(
Tratamiento
=
'Tratamiento'
),
farmacos_sin_enf
.
assign
(
Tratamiento
=
'Unk
w
own'
)])
combined_data
=
pd
.
concat
([
farmacos_con_enf
.
assign
(
Tratamiento
=
'Tratamiento'
),
farmacos_sin_enf
.
assign
(
Tratamiento
=
'Unk
n
own'
)])
# Combino los dos conjuntos de datos en un mismo subplot
fig
,
axes
=
plt
.
subplots
(
1
,
2
,
figsize
=
(
14
,
6
))
# Creo un subplot con 1 fila y 2 columnas
# Represento el boxplot con ambas distribuciones de la proximidad
sns
.
boxplot
(
x
=
'Tratamiento'
,
y
=
'dc'
,
data
=
combined_data
,
hue
=
'Tratamiento'
,
ax
=
axes
[
0
],
palette
=
{
'Tratamiento'
:
'#FF7A7A'
,
'Unk
w
own'
:
'#79C4FF'
},
dodge
=
False
,
medianprops
=
dict
(
linewidth
=
2
),
legend
=
False
)
sns
.
boxplot
(
x
=
'Tratamiento'
,
y
=
'dc'
,
data
=
combined_data
,
hue
=
'Tratamiento'
,
ax
=
axes
[
0
],
palette
=
{
'Tratamiento'
:
'#FF7A7A'
,
'Unk
n
own'
:
'#79C4FF'
},
dodge
=
False
,
medianprops
=
dict
(
linewidth
=
2
),
legend
=
False
)
axes
[
0
]
.
set_ylabel
(
'Cercanía ($
\
mathregular{d_c}$)'
,
fontsize
=
12
)
axes
[
0
]
.
set_xlabel
(
''
)
for
label
in
axes
[
0
]
.
get_xticklabels
():
label
.
set_fontsize
(
12
)
# Represento el boxplot con ambas distribuciones de la proximidad
sns
.
boxplot
(
x
=
'Tratamiento'
,
y
=
'dc_zscore'
,
data
=
combined_data
,
hue
=
'Tratamiento'
,
ax
=
axes
[
1
],
palette
=
{
'Tratamiento'
:
'#FF7A7A'
,
'Unk
w
own'
:
'#79C4FF'
},
dodge
=
False
,
medianprops
=
dict
(
linewidth
=
2
),
legend
=
False
)
sns
.
boxplot
(
x
=
'Tratamiento'
,
y
=
'dc_zscore'
,
data
=
combined_data
,
hue
=
'Tratamiento'
,
ax
=
axes
[
1
],
palette
=
{
'Tratamiento'
:
'#FF7A7A'
,
'Unk
n
own'
:
'#79C4FF'
},
dodge
=
False
,
medianprops
=
dict
(
linewidth
=
2
),
legend
=
False
)
axes
[
1
]
.
set_ylabel
(
'Proximidad [z-score ($
\
mathregular{d_c}$)]'
,
fontsize
=
12
)
axes
[
1
]
.
set_xlabel
(
''
)
for
label
in
axes
[
1
]
.
get_xticklabels
():
...
...
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