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
11260a4c
Commit
11260a4c
authored
Apr 20, 2017
by
Sander Bollen
Committed by
GitHub
Apr 20, 2017
Browse files
Merge pull request #83 from biopet/fix-heatmap-margins
Fix margins for heatmaps
parents
6f78cb16
75ca4f74
Changes
2
Hide whitespace changes
Inline
Side-by-side
biopet-core/src/main/resources/nl/lumc/sasc/biopet/tools/plotHeatmap.R
View file @
11260a4c
...
...
@@ -14,6 +14,7 @@ rownames(heat) <- heat[,1]
heat
<-
heat
[,
-1
]
heat
<-
as.matrix
(
heat
)
textMargin
<-
max
(
sapply
(
rownames
(
heat
),
nchar
))
+
4
colNumber
<-
50
col
<-
rev
(
colorRampPalette
(
brewer.pal
(
11
,
"Spectral"
))(
colNumber
))
for
(
i
in
(
colNumber
+1
)
:
(
colNumber
+
round
((
dist
(
range
(
heat
))
-
dist
(
range
(
heat
[
heat
<
1
])))
/
dist
(
range
(
heat
[
heat
<
1
]))
*
colNumber
)))
{
...
...
@@ -22,7 +23,7 @@ for (i in (colNumber+1):(colNumber+round((dist(range(heat)) - dist(range(heat[he
col
[
length
(
col
)]
<-
"#00FF00"
png
(
file
=
outputArg
,
width
=
1200
,
height
=
1200
)
heatmap.2
(
heat
,
trace
=
'none'
,
col
=
col
,
Colv
=
NA
,
Rowv
=
NA
,
dendrogram
=
"none"
,
margins
=
c
(
12
,
12
),
na.color
=
"#00FF00"
)
heatmap.2
(
heat
,
trace
=
'none'
,
col
=
col
,
Colv
=
NA
,
Rowv
=
NA
,
dendrogram
=
"none"
,
margins
=
c
(
textMargin
,
textMargin
),
na.color
=
"#00FF00"
)
dev.off
()
hc
<-
hclust
(
d
=
dist
(
heat
))
...
...
@@ -31,5 +32,5 @@ plot(as.dendrogram(hc), horiz=TRUE, asp=0.02)
dev.off
()
png
(
file
=
outputArgClustering
,
width
=
1200
,
height
=
1200
)
heatmap.2
(
heat
,
trace
=
'none'
,
col
=
col
,
Colv
=
"Rowv"
,
dendrogram
=
"row"
,
margins
=
c
(
12
,
12
),
na.color
=
"#00FF00"
)
heatmap.2
(
heat
,
trace
=
'none'
,
col
=
col
,
Colv
=
"Rowv"
,
dendrogram
=
"row"
,
margins
=
c
(
textMargin
,
textMargin
),
na.color
=
"#00FF00"
)
dev.off
()
biopet-tools/src/main/resources/nl/lumc/sasc/biopet/tools/vcfstats/plotHeatmap.R
View file @
11260a4c
...
...
@@ -14,6 +14,7 @@ rownames(heat) <- heat[,1]
heat
<-
heat
[,
-1
]
heat
<-
as.matrix
(
heat
)
textMargin
<-
max
(
sapply
(
rownames
(
heat
),
nchar
))
+
4
colNumber
<-
50
col
<-
rev
(
colorRampPalette
(
brewer.pal
(
11
,
"Spectral"
))(
colNumber
))
for
(
i
in
(
colNumber
+1
)
:
(
colNumber
+
round
((
dist
(
range
(
heat
))
-
dist
(
range
(
heat
[
heat
<
1
])))
/
dist
(
range
(
heat
[
heat
<
1
]))
*
colNumber
)))
{
...
...
@@ -22,7 +23,7 @@ for (i in (colNumber+1):(colNumber+round((dist(range(heat)) - dist(range(heat[he
col
[
length
(
col
)]
<-
"#00FF00"
png
(
file
=
outputArg
,
width
=
1200
,
height
=
1200
)
heatmap.2
(
heat
,
trace
=
'none'
,
col
=
col
,
Colv
=
NA
,
Rowv
=
NA
,
dendrogram
=
"none"
,
margins
=
c
(
12
,
12
),
na.color
=
"#00FF00"
)
heatmap.2
(
heat
,
trace
=
'none'
,
col
=
col
,
Colv
=
NA
,
Rowv
=
NA
,
dendrogram
=
"none"
,
margins
=
c
(
textMargin
,
textMargin
),
na.color
=
"#00FF00"
)
dev.off
()
hc
<-
hclust
(
d
=
dist
(
heat
))
...
...
@@ -31,5 +32,5 @@ plot(as.dendrogram(hc), horiz=TRUE, asp=0.02)
dev.off
()
png
(
file
=
outputArgClustering
,
width
=
1200
,
height
=
1200
)
heatmap.2
(
heat
,
trace
=
'none'
,
col
=
col
,
Colv
=
"Rowv"
,
dendrogram
=
"row"
,
margins
=
c
(
12
,
12
),
na.color
=
"#00FF00"
)
heatmap.2
(
heat
,
trace
=
'none'
,
col
=
col
,
Colv
=
"Rowv"
,
dendrogram
=
"row"
,
margins
=
c
(
textMargin
,
textMargin
),
na.color
=
"#00FF00"
)
dev.off
()
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