Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
JASS_suite_pipeline
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Statistical-Genetics
JASS_suite_pipeline
Commits
5b7e2930
Commit
5b7e2930
authored
1 year ago
by
Hubble
Browse files
Options
Downloads
Patches
Plain Diff
“heatmap_hhb_version_2”
parent
30ca219e
No related branches found
No related tags found
1 merge request
!5
Heatmap
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/make_heatmap.R
+54
-20
54 additions, 20 deletions
bin/make_heatmap.R
modules/LDSC.nf
+1
-4
1 addition, 4 deletions
modules/LDSC.nf
with
55 additions
and
24 deletions
bin/make_heatmap.R
+
54
−
20
View file @
5b7e2930
...
@@ -5,37 +5,71 @@ library("stringr")
...
@@ -5,37 +5,71 @@ library("stringr")
Args
<-
commandArgs
()
Args
<-
commandArgs
()
c
sv_data
=
fread
(
Args
[
6
]
)
c
orrelation_file
=
Args
[
6
]
head
(
csv_data
)
p_file
=
Args
[
7
]
m_data
<-
melt
(
csv_data
,
id.vars
=
c
(
"V1"
)
)
trait_name
=
fread
(
correlation_file
)
head
(
m_data
)
trait_name
<-
as.list
(
names
(
trait_name
))
trait_name
<-
trait_name
[
-1
]
pG
=
ggplot
(
m_data
,
aes
(
x
=
V1
,
y
=
variable
,
fill
=
value
))
+
geom_tile
(
color
=
"darkgrey"
)
+
scale_fill_stepsn
(
colors
=
c
(
low
=
"#075AFF"
,
trait_name
<-
data.table
(
ID
=
trait_name
)
trait_name
$
ID
<-
sapply
(
trait_name
$
ID
,
toString
)
setkey
(
trait_name
,
"ID"
)
Rho
=
fread
(
correlation_file
)
setkey
(
Rho
,
"V1"
)
Pval
=
fread
(
p_file
)
setkey
(
Pval
,
"V1"
)
Rho
=
Rho
[
trait_name
$
ID
,
c
(
"V1"
,
trait_name
$
ID
),
with
=
FALSE
]
Pval
=
Pval
[
trait_name
$
ID
,
c
(
"V1"
,
trait_name
$
ID
),
with
=
FALSE
]
cor_long
=
melt
(
as.data.table
(
Rho
),
id.vars
=
c
(
'V1'
))
order_trait
<-
trait_name
$
ID
pval_long
=
melt
(
as.data.table
(
Pval
),
id.vars
=
c
(
'V1'
))
pval_long
[,
value
:=
value
*
((
dim
(
Rho
)[
1
]
-1
)
^
2
/
2
)
]
pval_long
[,
pval_annote
:=
c
(
"***"
,
"**"
,
"*"
,
"."
,
""
)[
.bincode
(
pval_long
$
value
,
c
(
-1
,
0.001
,
0.01
,
0.05
,
0.1
,
1
))]]
pval_long
[
is.na
(
pval_long
$
pval_annote
),
pval_annote
:=
""
]
pval_long
[,
cor_val
:=
signif
(
round
(
cor_long
$
value
,
2
),
2
)]
pval_long
[,
full_annot
:=
str_trim
(
paste0
(
cor_val
,
"\n"
,
pval_annote
))]
pval_long
$
full_annot
[
pval_long
$
full_annot
==
"1"
]
<-
""
cor_long
[,
variable
:=
ordered
(
cor_long
$
variable
,
levels
=
order_trait
)]
cor_long
[,
V1
:=
ordered
(
cor_long
$
V1
,
levels
=
order_trait
)]
pval_long
[,
variable
:=
ordered
(
pval_long
$
variable
,
levels
=
order_trait
)]
pval_long
[,
V1
:=
ordered
(
pval_long
$
V1
,
levels
=
order_trait
)]
pG
=
ggplot
(
cor_long
,
aes
(
x
=
V1
,
y
=
variable
,
fill
=
value
))
+
geom_tile
(
color
=
"darkgrey"
)
+
scale_fill_stepsn
(
colors
=
c
(
low
=
"#075AFF"
,
mid
=
"#FFFFCC"
,
high
=
"#FF0000"
),
n.breaks
=
21
,
limits
=
c
(
-1
,
1
),
show.limits
=
T
)
mid
=
"#FFFFCC"
,
high
=
"#FF0000"
),
n.breaks
=
21
,
limits
=
c
(
-1
,
1
),
show.limits
=
T
)
pG
=
pG
+
coord_fixed
()
+
xlab
(
""
)
+
ylab
(
""
)
+
theme_minimal
()
+
theme
(
axis.text
=
element_text
(
size
=
11
),
axis.text.x
=
element_text
(
angle
=
90
,
vjust
=
0.5
,
hjust
=
1
))
pG
=
pG
+
coord_fixed
()
+
xlab
(
""
)
+
ylab
(
""
)
+
theme_minimal
()
+
theme
(
axis.text
=
element_text
(
size
=
11
),
axis.text.x
=
element_text
(
angle
=
90
,
vjust
=
0.5
,
hjust
=
1
))
pG
=
pG
+
theme
(
legend.key.size
=
unit
(
1
,
'cm'
),
#change legend key size
pG
=
pG
+
theme
(
legend.key.size
=
unit
(
1
,
'cm'
),
#change legend key size
legend.key.height
=
unit
(
2
,
'cm'
),
#change legend key height
legend.key.height
=
unit
(
2
,
'cm'
),
#change legend key height
legend.key.width
=
unit
(
1
,
'cm'
),
#change legend key width
legend.key.width
=
unit
(
1
,
'cm'
),
#change legend key width
legend.title
=
element_text
(
size
=
14
),
#change legend title font size
legend.title
=
element_text
(
size
=
14
),
#change legend title font size
legend.text
=
element_text
(
size
=
10
))
legend.text
=
element_text
(
size
=
10
))
pG
=
pG
+
geom_text
(
data
=
m_data
,
aes
(
x
=
V1
,
y
=
variable
,
label
=
value
),
size
=
3.5
)
pG
=
pG
+
geom_text
(
data
=
pval_long
,
aes
(
x
=
V1
,
y
=
variable
,
label
=
full_annot
),
size
=
3.5
)
png
(
paste
(
"HeatMap_"
,
strsplit
(
Args
[
6
],
split
=
"."
,
fixed
=
T
)[[
1
]][
1
],
".png"
,
sep
=
""
),
width
=
20
,
height
=
20
,
png
(
paste
(
"HeatMap_"
,
strsplit
(
Args
[
6
],
split
=
"."
,
fixed
=
T
)[[
1
]][
1
],
".png"
,
sep
=
""
),
width
=
20
,
height
=
20
,
units
=
"in"
,
units
=
"in"
,
res
=
300
,
res
=
300
,
pointsize
=
4
)
pointsize
=
4
)
print
(
pG
)
print
(
pG
)
dev.off
()
dev.off
()
This diff is collapsed.
Click to expand it.
modules/LDSC.nf
+
1
−
4
View file @
5b7e2930
...
@@ -116,10 +116,7 @@ process Make_HeatMap {
...
@@ -116,10 +116,7 @@ process Make_HeatMap {
params
.
compute_LDSC_matrix
params
.
compute_LDSC_matrix
"""
"""
for matrix_csv in ${matrix_csv_files}
Rscript ${make_heatmap_script} Correlation_matrix_genetic.csv Pval_cor_matrix_genetic.csv
do
Rscript ${make_heatmap_script} \$matrix_csv
done
"""
"""
...
...
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