Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NIRS_Workflow
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
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
CEFE
PACE
NIRS_Workflow
Commits
6894c76a
Commit
6894c76a
authored
11 months ago
by
DIANE
Browse files
Options
Downloads
Patches
Plain Diff
score plot(group samples based on metadata or on clustering results
parent
8915f27a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pages/1-samples_selection.py
+27
-12
27 additions, 12 deletions
pages/1-samples_selection.py
with
27 additions
and
12 deletions
pages/1-samples_selection.py
+
27
−
12
View file @
6894c76a
...
@@ -121,26 +121,41 @@ if not t.empty:
...
@@ -121,26 +121,41 @@ if not t.empty:
with
scores
:
with
scores
:
st
.
write
(
'
Scores plot
'
)
st
.
write
(
'
Scores plot
'
)
# scores plot with clustering
# scores plot with clustering
if
list
(
labels
):
if
list
(
labels
)
and
meta_data
.
empty
:
fig
=
px
.
scatter_3d
(
t
,
x
=
axis1
,
y
=
axis2
,
z
=
axis3
,
color
=
labels
)
fig
=
px
.
scatter_3d
(
t
,
x
=
axis1
,
y
=
axis2
,
z
=
axis3
,
color
=
labels
)
else
:
# scores plot with metadata
# scores plot with metadata
if
not
meta_data
.
empty
:
elif
len
(
list
(
labels
))
==
0
and
not
meta_data
.
empty
:
filter
=
meta_data
.
columns
[
1
:]
filter
=
meta_data
.
columns
[
1
:]
col
=
st
.
selectbox
(
'
filter
'
,
options
=
filter
)
col
=
st
.
selectbox
(
'
Group by:
'
,
options
=
filter
)
if
col
==
0
:
if
col
==
0
:
fig
=
px
.
scatter_3d
(
t
,
x
=
axis1
,
y
=
axis2
,
z
=
axis3
)
fig
=
px
.
scatter_3d
(
t
,
x
=
axis1
,
y
=
axis2
,
z
=
axis3
)
else
:
else
:
fig
=
px
.
scatter_3d
(
t
,
x
=
axis1
,
y
=
axis2
,
z
=
axis3
,
color
=
list
(
map
(
str
.
lower
,
meta_data
[
col
]))
)
fig
=
px
.
scatter_3d
(
t
,
x
=
axis1
,
y
=
axis2
,
z
=
axis3
,
color
=
list
(
map
(
str
.
lower
,
meta_data
[
col
]))
)
# color with scores and metadata
elif
len
(
list
(
labels
))
>
0
and
not
meta_data
.
empty
:
if
clus_method
in
cluster_methods
[
1
:]:
filter
=
[
'
None
'
,
clus_method
]
filter
.
extend
(
meta_data
.
columns
[
1
:])
else
:
filter
=
meta_data
.
columns
[
1
:].
insert
(
0
,
'
None
'
)
col
=
st
.
selectbox
(
'
Group by:
'
,
options
=
filter
)
if
col
==
"
None
"
:
fig
=
px
.
scatter_3d
(
t
,
x
=
axis1
,
y
=
axis2
,
z
=
axis3
)
elif
col
==
clus_method
:
fig
=
px
.
scatter_3d
(
t
,
x
=
axis1
,
y
=
axis2
,
z
=
axis3
,
color
=
labels
)
else
:
else
:
# scores plot with neither metadata nor clustering
fig
=
px
.
scatter_3d
(
t
,
x
=
axis1
,
y
=
axis2
,
z
=
axis3
,
color
=
list
(
map
(
str
.
lower
,
meta_data
[
col
])))
fig
=
px
.
scatter_3d
(
t
,
x
=
axis1
,
y
=
axis2
,
z
=
axis3
)
else
:
fig
=
px
.
scatter_3d
(
t
,
x
=
axis1
,
y
=
axis2
,
z
=
axis3
)
fig
.
update_traces
(
marker
=
dict
(
size
=
4
))
fig
.
update_traces
(
marker
=
dict
(
size
=
4
))
st
.
plotly_chart
(
fig
)
st
.
plotly_chart
(
fig
)
if
not
spectra
.
empty
:
if
not
spectra
.
empty
:
if
dim_red_method
==
dim_red_methods
[
1
]:
if
dim_red_method
==
dim_red_methods
[
1
]:
with
loadings
:
with
loadings
:
...
...
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