Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
QuaDS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ImHorPhen
QuaDS
Commits
df4b3314
Commit
df4b3314
authored
9 months ago
by
BOUANICH ANDREA
Browse files
Options
Downloads
Patches
Plain Diff
launch only visualisation
parent
a07e9820
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/visualisation.py
+55
-0
55 additions, 0 deletions
scripts/visualisation.py
with
55 additions
and
0 deletions
scripts/visualisation.py
0 → 100644
+
55
−
0
View file @
df4b3314
import
yaml
with
open
(
"
config_file.yml
"
,
"
r
"
)
as
yamlfile
:
config
=
yaml
.
load
(
yamlfile
,
Loader
=
yaml
.
FullLoader
)
import
pandas
as
pd
import
plotly.express
as
px
import
os
# System library to manipulate the file system
from
utils
import
write_excel
import
shutil
from
quads
import
*
data_path
=
config
[
"
directory_management
"
][
"
data_path
"
]
result_path
=
config
[
"
directory_management
"
][
"
result_path
"
]
#name the files
if
config
[
"
file_management
"
][
"
table
"
]
==
"
excel
"
:
df
=
pd
.
read_excel
(
data_path
+
config
[
"
file_management
"
][
"
original_data_file
"
],
index_col
=
0
)
elif
config
[
"
file_management
"
][
"
table
"
]
==
"
csv
"
:
df
=
pd
.
read_csv
(
data_path
+
config
[
"
file_management
"
][
"
original_data_file
"
],
index_col
=
0
)
file_name_qualitative
=
result_path
+
\
config
[
"
file_management
"
][
"
qualitative_enrichment
"
]
cluster
=
config
[
"
variable_management
"
][
"
cluster_variable
"
]
#make the visualisations
col
=
{
'
overrepresented
'
:
config
[
"
figure_management
"
][
"
over_represented
"
],
\
'
underrepresented
'
:
config
[
"
figure_management
"
][
"
under_represented
"
],
\
'
Not significant
'
:
config
[
"
figure_management
"
][
"
not_significant
"
]}
if
config
[
"
file_management
"
][
"
table
"
]
==
"
excel
"
:
df
=
pd
.
read_excel
(
file_name_qualitative
,
index_col
=
0
)
elif
config
[
"
file_management
"
][
"
table
"
]
==
"
csv
"
:
df
=
pd
.
read_csv
(
file_name_qualitative
,
index_col
=
0
)
sunburst
=
px
.
sunburst
(
df
,
path
=
[
cluster
,
'
variables
'
,
'
modalities
'
],
\
values
=
config
[
"
figure_management
"
][
"
statistic
"
],
\
color
=
'
signification
'
,
\
color_discrete_map
=
col
)
sunburst
.
add_annotation
(
x
=
0
,
y
=
1.1
,
\
font
=
dict
(
color
=
'
black
'
,
size
=
14
),
\
showarrow
=
False
)
sunburst
.
add_annotation
(
x
=
0.2
,
y
=
1
,
text
=
'
Overrepresented
'
,
\
font
=
dict
(
color
=
config
[
"
figure_management
"
][
"
over_represented
"
],
size
=
14
),
\
showarrow
=
False
)
sunburst
.
add_annotation
(
x
=
0.2
,
y
=
0.95
,
text
=
'
Underrepresented
'
,
\
font
=
dict
(
color
=
config
[
"
figure_management
"
][
"
under_represented
"
],
size
=
14
),
\
showarrow
=
False
)
sunburst
.
add_annotation
(
x
=
0.2
,
y
=
0.9
,
text
=
'
Not significant
'
,
\
font
=
dict
(
color
=
config
[
"
figure_management
"
][
"
not_significant
"
],
size
=
14
),
\
showarrow
=
False
)
sunburst
.
show
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment