Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
biopet.biopet
Commits
ef0a2f6e
Commit
ef0a2f6e
authored
Mar 21, 2017
by
Peter van 't Hof
Browse files
Remove legends on plot when there to many samples
parent
b5ea73df
Changes
3
Hide whitespace changes
Inline
Side-by-side
bammetrics/src/main/scala/nl/lumc/sasc/biopet/pipelines/bammetrics/BammetricsReport.scala
View file @
ef0a2f6e
...
@@ -208,6 +208,7 @@ object BammetricsReport extends ReportBuilder {
...
@@ -208,6 +208,7 @@ object BammetricsReport extends ReportBuilder {
xlabel
=
xlabel
,
xlabel
=
xlabel
,
ylabel
=
ylabel
,
ylabel
=
ylabel
,
title
=
title
,
title
=
title
,
hideLegend
=
results
.
size
>
40
,
removeZero
=
removeZero
).
runLocal
()
removeZero
=
removeZero
).
runLocal
()
}
}
...
...
biopet-utils/src/main/resources/nl/lumc/sasc/biopet/utils/rscript/plotXY.R
View file @
ef0a2f6e
...
@@ -11,6 +11,7 @@ parser$add_argument('--xlabel', dest='xlabel', type='character')
...
@@ -11,6 +11,7 @@ parser$add_argument('--xlabel', dest='xlabel', type='character')
parser
$
add_argument
(
'--ylabel'
,
dest
=
'ylabel'
,
type
=
'character'
,
required
=
TRUE
)
parser
$
add_argument
(
'--ylabel'
,
dest
=
'ylabel'
,
type
=
'character'
,
required
=
TRUE
)
parser
$
add_argument
(
'--llabel'
,
dest
=
'llabel'
,
type
=
'character'
)
parser
$
add_argument
(
'--llabel'
,
dest
=
'llabel'
,
type
=
'character'
)
parser
$
add_argument
(
'--title'
,
dest
=
'title'
,
type
=
'character'
)
parser
$
add_argument
(
'--title'
,
dest
=
'title'
,
type
=
'character'
)
parser
$
add_argument
(
'--hideLegend'
,
dest
=
'hideLegend'
,
type
=
'character'
,
default
=
"false"
)
parser
$
add_argument
(
'--removeZero'
,
dest
=
'removeZero'
,
type
=
'character'
,
default
=
"false"
)
parser
$
add_argument
(
'--removeZero'
,
dest
=
'removeZero'
,
type
=
'character'
,
default
=
"false"
)
arguments
<-
parser
$
parse_args
()
arguments
<-
parser
$
parse_args
()
...
@@ -21,6 +22,8 @@ DF <- read.table(arguments$input, header=TRUE)
...
@@ -21,6 +22,8 @@ DF <- read.table(arguments$input, header=TRUE)
if
(
is.null
(
arguments
$
xlabel
))
xlab
<-
colnames
(
DF
)[
1
]
else
xlab
<-
arguments
$
xlabel
if
(
is.null
(
arguments
$
xlabel
))
xlab
<-
colnames
(
DF
)[
1
]
else
xlab
<-
arguments
$
xlabel
if
(
is.null
(
arguments
$
hideLegend
)
||
arguments
$
hideLegend
==
"false"
)
legendPosition
<-
"right"
else
legendPosition
<-
"none"
colnames
(
DF
)[
1
]
<-
"Rank"
colnames
(
DF
)[
1
]
<-
"Rank"
DF1
<-
melt
(
DF
,
id.var
=
"Rank"
)
DF1
<-
melt
(
DF
,
id.var
=
"Rank"
)
...
@@ -35,6 +38,7 @@ ggplot(DF1, aes(x = Rank, y = value, group = variable, color = variable)) +
...
@@ -35,6 +38,7 @@ ggplot(DF1, aes(x = Rank, y = value, group = variable, color = variable)) +
theme
(
axis.text.x
=
element_text
(
angle
=
90
,
hjust
=
1
,
size
=
8
))
+
theme
(
axis.text.x
=
element_text
(
angle
=
90
,
hjust
=
1
,
size
=
8
))
+
ggtitle
(
arguments
$
title
)
+
ggtitle
(
arguments
$
title
)
+
theme_bw
()
+
theme_bw
()
+
theme
(
legend.position
=
legendPosition
)
+
geom_line
()
geom_line
()
dev.off
()
dev.off
()
biopet-utils/src/main/scala/nl/lumc/sasc/biopet/utils/rscript/LinePlot.scala
View file @
ef0a2f6e
...
@@ -36,6 +36,7 @@ class LinePlot(val parent: Configurable) extends Rscript {
...
@@ -36,6 +36,7 @@ class LinePlot(val parent: Configurable) extends Rscript {
var
ylabel
:
Option
[
String
]
=
config
(
"ylabel"
)
var
ylabel
:
Option
[
String
]
=
config
(
"ylabel"
)
var
llabel
:
Option
[
String
]
=
config
(
"llabel"
)
var
llabel
:
Option
[
String
]
=
config
(
"llabel"
)
var
title
:
Option
[
String
]
=
config
(
"title"
)
var
title
:
Option
[
String
]
=
config
(
"title"
)
var
hideLegend
:
Boolean
=
config
(
"hide_legend"
,
default
=
false
)
var
removeZero
:
Boolean
=
config
(
"removeZero"
,
default
=
false
)
var
removeZero
:
Boolean
=
config
(
"removeZero"
,
default
=
false
)
override
def
cmd
=
super
.
cmd
++
override
def
cmd
=
super
.
cmd
++
...
@@ -47,6 +48,7 @@ class LinePlot(val parent: Configurable) extends Rscript {
...
@@ -47,6 +48,7 @@ class LinePlot(val parent: Configurable) extends Rscript {
ylabel
.
map
(
Seq
(
"--ylabel"
,
_
)).
getOrElse
(
Seq
())
++
ylabel
.
map
(
Seq
(
"--ylabel"
,
_
)).
getOrElse
(
Seq
())
++
llabel
.
map
(
Seq
(
"--llabel"
,
_
)).
getOrElse
(
Seq
())
++
llabel
.
map
(
Seq
(
"--llabel"
,
_
)).
getOrElse
(
Seq
())
++
title
.
map
(
Seq
(
"--title"
,
_
)).
getOrElse
(
Seq
())
++
title
.
map
(
Seq
(
"--title"
,
_
)).
getOrElse
(
Seq
())
++
(
if
(
hideLegend
)
Seq
(
"--hideLegend"
,
"true"
)
else
Seq
())
++
(
if
(
removeZero
)
Seq
(
"--removeZero"
,
"true"
)
else
Seq
())
(
if
(
removeZero
)
Seq
(
"--removeZero"
,
"true"
)
else
Seq
())
}
}
...
@@ -57,6 +59,7 @@ object LinePlot {
...
@@ -57,6 +59,7 @@ object LinePlot {
xlabel
:
Option
[
String
]
=
None
,
xlabel
:
Option
[
String
]
=
None
,
ylabel
:
Option
[
String
]
=
None
,
ylabel
:
Option
[
String
]
=
None
,
width
:
Int
=
1200
,
width
:
Int
=
1200
,
hideLegend
:
Boolean
=
false
,
removeZero
:
Boolean
=
false
,
removeZero
:
Boolean
=
false
,
title
:
Option
[
String
]
=
None
)
:
LinePlot
=
{
title
:
Option
[
String
]
=
None
)
:
LinePlot
=
{
val
plot
=
new
LinePlot
(
root
)
val
plot
=
new
LinePlot
(
root
)
...
@@ -65,6 +68,7 @@ object LinePlot {
...
@@ -65,6 +68,7 @@ object LinePlot {
plot
.
xlabel
=
xlabel
plot
.
xlabel
=
xlabel
plot
.
ylabel
=
ylabel
plot
.
ylabel
=
ylabel
plot
.
width
=
Some
(
width
)
plot
.
width
=
Some
(
width
)
plot
.
hideLegend
=
hideLegend
plot
.
removeZero
=
removeZero
plot
.
removeZero
=
removeZero
plot
.
title
=
title
plot
.
title
=
title
plot
plot
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment