Toggle navigation
Toggle navigation
This project
Loading...
Sign in
larisa
/
gene-disease-embeddings
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
larisa
2018-04-16 19:43:05 -0500
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
adc12d97d39f386cd9553252ff030800a74acca7
adc12d97
1 parent
72371e02
Upload new file
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
scripts/graphics.R
scripts/graphics.R
0 → 100644
View file @
adc12d9
setwd
(
"/Users/larisams/Documents/LCG/Sem_4/Bioinformatics/CarlosMendez"
)
library
(
ggplot2
)
# Automated analysis
sent.dat
<-
as.data.frame
(
read.table
(
"annotated-sentence-results.txt"
,
header
=
TRUE
))
sent.dat
$
Proportion
<-
sent.dat
$
GeneDisease
/
sent.dat
$
Total
sent.dat
$
constant
<-
apply
(
sent.dat
,
1
,
function
(
x
){
if
(
x
[
3
]
==
25
){
return
(
"4"
)}
else
if
(
x
[
3
]
==
46
){
return
(
"3"
)}
else
if
(
x
[
3
]
==
17
){
return
(
"2"
)}
else
{
PConst
<-
return
(
"0"
)}
})
g
1
<-
ggplot
(
sent.dat
,
aes
(
x
=
Cluster
,
y
=
Proportion
,
fill
=
constant
))
+
geom_bar
(
aes
(
x
=
Cluster
,
y
=
Proportion
),
stat
=
"identity"
)
+
scale_fill_manual
(
"Constant Partitions"
,
values
=
c
(
"4"
=
"#005b7a"
,
"3"
=
"#DF0664"
,
"2"
=
"#66CCCC"
,
"0"
=
"#b2afaf"
))
+
facet_wrap
(
~
Partition
,
ncol
=
3
,
nrow
=
2
)
+
facet_grid
(
~
Partition
,
labeller
=
label_context
)
+
theme
(
legend.position
=
"none"
)
ggsave
(
"Figure3.png"
,
g
1
,
width
=
7.5
,
height
=
5
,
dpi
=
300
,
units
=
"in"
,
device
=
'png'
)
g
2
<-
ggplot
(
sent.dat
,
aes
(
x
=
Total
,
y
=
GeneDisease
,
fill
=
constant
))
+
geom_bar
(
aes
(
x
=
Total
,
y
=
GeneDisease
),
stat
=
"identity"
)
+
scale_fill_manual
(
"Constant Partitions"
,
values
=
c
(
"4"
=
"#005b7a"
,
"3"
=
"#DF0664"
,
"2"
=
"#66CCCC"
,
"0"
=
"#b2afaf"
))
+
facet_wrap
(
~
Partition
,
ncol
=
3
,
nrow
=
2
)
+
facet_grid
(
~
Partition
,
labeller
=
label_context
)
+
xlab
(
"Total sentences"
)
+
ylab
(
"Gene disease sentences"
)
+
theme
(
legend.position
=
"none"
)
ggsave
(
"Figure2.png"
,
g
2
,
width
=
7.5
,
height
=
5
,
dpi
=
300
,
units
=
"in"
,
device
=
'png'
)
# Manual analysis
words.dat
<-
as.data.frame
(
read.table
(
"word-counts.txt"
,
header
=
TRUE
))
words.dat
$
Fibrosis
<-
words.dat
$
Fibrosis
/
words.dat
$
Total
words.dat
$
TGF
<-
words.dat
$
TGF
/
words.dat
$
Total
words.dat
$
constant
<-
sent.dat
$
constant
[
c
(
-1
,
-2
)]
g
3
<-
ggplot
(
words.dat
,
aes
(
x
=
Cluster
,
y
=
Fibrosis
,
fill
=
constant
))
+
geom_bar
(
aes
(
x
=
Cluster
,
y
=
Fibrosis
),
stat
=
"identity"
)
+
scale_fill_manual
(
"Constant Partitions"
,
values
=
c
(
"4"
=
"#005b7a"
,
"3"
=
"#DF0664"
,
"2"
=
"#66CCCC"
,
"0"
=
"#b2afaf"
))
+
facet_wrap
(
~
Partition
,
ncol
=
3
,
nrow
=
2
)
+
facet_grid
(
~
Partition
,
labeller
=
label_context
)
+
theme
(
legend.position
=
"none"
)
ggsave
(
"Figure7.png"
,
g
3
,
width
=
7.5
,
height
=
5
,
dpi
=
300
,
units
=
"in"
,
device
=
'png'
)
g
4
<-
ggplot
(
words.dat
,
aes
(
x
=
Cluster
,
y
=
TGF
,
fill
=
constant
))
+
geom_bar
(
aes
(
x
=
Cluster
,
y
=
TGF
),
stat
=
"identity"
)
+
scale_fill_manual
(
"Constant Partitions"
,
values
=
c
(
"4"
=
"#005b7a"
,
"3"
=
"#DF0664"
,
"2"
=
"#66CCCC"
,
"0"
=
"#b2afaf"
))
+
facet_wrap
(
~
Partition
,
ncol
=
3
,
nrow
=
2
)
+
facet_grid
(
~
Partition
,
labeller
=
label_context
)
+
theme
(
legend.position
=
"none"
)
ggsave
(
"Figure8.png"
,
g
4
,
width
=
7.5
,
height
=
5
,
dpi
=
300
,
units
=
"in"
,
device
=
'png'
)
Please
register
or
login
to post a comment