Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
shiny-timecourse-inspector
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pertz-lab
shiny-timecourse-inspector
Commits
af7403e9
Unverified
Commit
af7403e9
authored
Oct 12, 2019
by
Maciej Dobrzynski
Committed by
GitHub
Oct 12, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6 from majpark21/master
Changed default palette to colorblind friendly
parents
7891ea8c
ff69113e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
5 deletions
+33
-5
modules/distPlot.R
modules/distPlot.R
+11
-2
modules/tabClValid.R
modules/tabClValid.R
+12
-2
modules/trajRibbonPlot.R
modules/trajRibbonPlot.R
+10
-1
No files found.
modules/distPlot.R
View file @
af7403e9
...
...
@@ -274,9 +274,17 @@ modDistPlot = function(input, output, session,
else
NA
)
# If more than max.col groups, cycle through the palette ("Color Blind" can return 10 colors at maximum)
loc.pal
=
"Color Blind"
max.col
=
attr
(
ggthemes
::
tableau_color_pal
(
loc.pal
),
"max_n"
)
loc.col
=
ggthemes
::
tableau_color_pal
(
loc.pal
)(
n
=
max.col
)
ngroups
=
uniqueN
(
loc.dt
[,
get
(
in.cols
$
group
)])
-
1
loc.col
=
rep
(
loc.col
,
(
ngroups
%/%
max.col
)
+
1
)
loc.col
=
loc.col
[
1
:
(
ngroups
+1
)]
p.out
=
p.out
+
scale_fill_discrete
(
name
=
in.labels
$
legend
)
+
xlab
(
in.labels
$
x
)
+
ylab
(
in.labels
$
y
)
+
LOCggplotTheme
(
in.font.base
=
PLOTFONTBASE
,
...
...
@@ -286,7 +294,8 @@ modDistPlot = function(input, output, session,
in.font.legend
=
PLOTFONTLEGEND
)
+
theme
(
legend.position
=
input
$
selPlotBoxLegendPos
,
axis.text.x
=
LOCrotatedAxisElementText
(
as.numeric
(
input
$
rBAxisLabelsRotate
),
size
=
PLOTFONTAXISTEXT
))
size
=
PLOTFONTAXISTEXT
))
+
scale_fill_manual
(
name
=
in.labels
$
legend
,
values
=
loc.col
)
return
(
p.out
)
...
...
modules/tabClValid.R
View file @
af7403e9
...
...
@@ -318,6 +318,9 @@ clustValid <- function(input, output, session, in.dataWide) {
if
(
sum
(
is.na
(
loc.dm
))
>
0
)
return
(
NULL
)
loc.pal
=
ifelse
(
returnNclust
()
<=
10
,
"Color Blind"
,
"Tableau 20"
)
loc.col
=
ggthemes
::
tableau_color_pal
(
loc.pal
)(
n
=
returnNclust
())
loc.p
=
factoextra
::
fviz_cluster
(
loc.part
,
data
=
loc.dm
,
geom
=
"point"
,
...
...
@@ -328,7 +331,9 @@ clustValid <- function(input, output, session, in.dataWide) {
in.font.axis.text
=
PLOTFONTAXISTEXT
,
in.font.axis.title
=
PLOTFONTAXISTITLE
,
in.font.strip
=
PLOTFONTFACETSTRIP
,
in.font.legend
=
PLOTFONTLEGEND
)
in.font.legend
=
PLOTFONTLEGEND
)
+
scale_fill_manual
(
values
=
loc.col
)
+
scale_colour_manual
(
values
=
loc.col
)
# Retrieve association of cluster and colours and use it for dendrogram for color matching between dend, silhouette and PCA plot
...
...
@@ -396,6 +401,9 @@ clustValid <- function(input, output, session, in.dataWide) {
need
(
!
is.null
(
loc.part
),
"Nothing to plot. Load data first!"
)
)
loc.pal
=
ifelse
(
returnNclust
()
<=
10
,
"Color Blind"
,
"Tableau 20"
)
loc.col
=
ggthemes
::
tableau_color_pal
(
loc.pal
)(
n
=
returnNclust
())
loc.p
=
factoextra
::
fviz_silhouette
(
loc.part
,
print.summary
=
FALSE
,
main
=
"Silhouette"
)
+
...
...
@@ -405,7 +413,9 @@ clustValid <- function(input, output, session, in.dataWide) {
in.font.axis.title
=
PLOTFONTAXISTITLE
,
in.font.strip
=
PLOTFONTFACETSTRIP
,
in.font.legend
=
PLOTFONTLEGEND
)
+
theme
(
axis.text.x
=
element_blank
())
theme
(
axis.text.x
=
element_blank
())
+
scale_fill_manual
(
values
=
loc.col
)
+
scale_colour_manual
(
values
=
loc.col
)
return
(
loc.p
)
}
...
...
modules/trajRibbonPlot.R
View file @
af7403e9
...
...
@@ -350,6 +350,14 @@ modTrajRibbonPlot = function(input, output, session,
loc.ylim.arg
=
c
(
input
$
inSetYboundsLow
,
input
$
inSetYboundsHigh
)
}
# If more than max.col groups, cycle through the palette ("Color Blind" can return 10 colors at maximum)
loc.pal
=
"Color Blind"
max.col
=
attr
(
ggthemes
::
tableau_color_pal
(
loc.pal
),
"max_n"
)
loc.col
=
ggthemes
::
tableau_color_pal
(
loc.pal
)(
n
=
max.col
)
ngroups
=
uniqueN
(
loc.dt.aggr
[,
..in.facet
])
-
1
loc.col
=
rep
(
loc.col
,
(
ngroups
%/%
max.col
)
+
1
)
loc.col
=
loc.col
[
1
:
(
ngroups
+1
)]
p.out
=
LOCplotTrajRibbon
(
dt.arg
=
loc.dt.aggr
,
x.arg
=
COLRT
,
y.arg
=
'Mean'
,
...
...
@@ -368,7 +376,8 @@ modTrajRibbonPlot = function(input, output, session,
in.font.axis.title
=
PLOTFONTAXISTITLE
,
in.font.strip
=
PLOTFONTFACETSTRIP
,
in.font.legend
=
PLOTFONTLEGEND
)
+
theme
(
legend.position
=
input
$
rBlegendPos
)
theme
(
legend.position
=
input
$
rBlegendPos
)
+
scale_colour_manual
(
values
=
loc.col
)
return
(
p.out
)
}
...
...
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