Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Malte Herold
LF_omics_analysis
Commits
a4971b88
Commit
a4971b88
authored
Dec 04, 2018
by
Malte Herold
Browse files
asd
parent
01cc3a7e
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Annotation_Tables/nitrogen.clean.list
0 → 100644
View file @
a4971b88
PROKKA_00042
PROKKA_01867
PROKKA_00534
PROKKA_01618
PROKKA_00311
PROKKA_00704
PROKKA_01184
PROKKA_01185
PROKKA_01200
PROKKA_01203
PROKKA_02313
PROKKA_02317
PROKKA_01202
PROKKA_01201
PROKKA_02431
PROKKA_01169
PROKKA_01163
PROKKA_01165
PROKKA_01162
PROKKA_01164
PROKKA_01166
PROKKA_00421
PROKKA_01174
PROKKA_01179
PROKKA_00420
PROKKA_01178
PROKKA_01167
PROKKA_01177
PROKKA_01168
PROKKA_01182
PROKKA_01183
Annotation_Tables/ox.clean.list
0 → 100644
View file @
a4971b88
PROKKA_00588
PROKKA_02121
PROKKA_02379
PROKKA_02380
PROKKA_00334
PROKKA_00463
PROKKA_00141
PROKKA_00956
PROKKA_00464
PROKKA_02122
PROKKA_02123
PROKKA_00361
PROKKA_01356
PROKKA_00965
PROKKA_00966
PROKKA_00293
PROKKA_00852
PROKKA_00318
PROKKA_02417
PROKKA_00473
PROKKA_00823
Combined/data/Prot_RNA_comparisons_fig4_all.pdf
deleted
100644 → 0
View file @
01cc3a7e
File deleted
Combined/data/Prot_RNA_comparisons_fig4_onlysignif.pdf
View file @
a4971b88
No preview for this file type
Combined/src/plot_comparisons_figure4.R
View file @
a4971b88
...
...
@@ -126,23 +126,41 @@ x2=tab[!(tab$Signif),]
#
# p=p+theme_bw() +theme(axis.text.x = element_text(angle = 90, hjust = 1)) + theme(panel.grid.minor = element_blank())
x1
=
x1
%>%
mutate
(
general_cats
=
gsub
(
"via "
,
"via\n"
,
general_cats
))
%>%
mutate
(
general_cats
=
gsub
(
"NADH "
,
"NADH\n"
,
general_cats
))
%>%
mutate
(
general_cats
=
gsub
(
"stress "
,
"NADH\n"
,
general_cats
))
x1
$
general_cats
=
gsub
(
"z_Other"
,
"Other/None"
,
x1
$
general_cats
)
x1
$
general_cats
=
forcats
::
fct_relevel
(
x1
$
general_cats
,
"Other/None"
,
after
=
Inf
)
p
<-
ggplot
()
+
#p <- ggplot(m_split,aes(x=cog_name,y=value)) +
#p <- ggplot(xxx,aes(x=Class_from_Pwy_association,y=value)) +
geom_point
(
data
=
x1
,
stat
=
"identity"
,
aes
(
x
=
general_cats
,
y
=
log2FC
,
fill
=
type
),
position
=
position_jitterdodge
(),
alpha
=
0.6
,
size
=
2.
0
,
shape
=
21
)
+
geom_point
(
data
=
x2
,
stat
=
"identity"
,
aes
(
x
=
general_cats
,
y
=
log2FC
,
fill
=
type
),
position
=
position_jitterdodge
(),
alpha
=
0.4
,
size
=
1.5
,
shape
=
23
)
+
geom_point
(
data
=
x1
,
stat
=
"identity"
,
aes
(
x
=
general_cats
,
y
=
log2FC
,
fill
=
type
),
position
=
position_jitterdodge
(),
alpha
=
0.6
,
size
=
2.
7
,
shape
=
21
)
+
#
geom_point(data=x2,stat="identity",aes(x=general_cats,y=log2FC,fill=type),position= position_jitterdodge(), alpha = 0.4,size=1.5,shape=23)+
#geom_point(aes(shape=Signif),position = position_jitterdodge(), alpha = 0.7) +
geom_hline
(
yintercept
=
0
,
alpha
=
0.4
)
+
geom_hline
(
yintercept
=
2
,
alpha
=
0.15
)
+
geom_hline
(
yintercept
=
-2
,
alpha
=
0.15
)
+
theme_bw
()
+
#geom_line(aes(group = Geneid))+
ylab
(
"log2FC"
)
+
xlab
(
"Generalised functional category"
)
xlab
(
"Generalised functional category"
)
+
scale_fill_manual
(
values
=
x
[
1
:
2
])
+
guides
(
fill
=
guide_legend
(
override.aes
=
list
(
size
=
3
,
alpha
=
1
)))
+
theme
(
axis.text.y
=
element_text
(
size
=
13
))
+
theme
(
axis.text.x
=
element_text
(
size
=
13
,
angle
=
90
,
hjust
=
1
))
+
theme
(
legend.text
=
element_text
(
size
=
13
),
legend.title
=
element_text
(
size
=
13
),
axis.title
=
element_text
(
size
=
14
))
+
theme
(
axis.text.x
=
)
+
theme
(
panel.grid.minor
=
element_blank
())
#scale_fill_manual(values=c("red","green"))+
#scale_shape_manual(name = 'Significance', guide = 'legend',values=c(21,23),labels = c("True","False"))
p
=
p
+
theme_bw
()
+
theme
(
axis.text.x
=
element_text
(
angle
=
90
,
hjust
=
1
))
+
theme
(
panel.grid.minor
=
element_blank
())
outname.p
=
paste
(
REPODIR
,
"Combined/data/Prot_RNA_comparisons_fig4_all.pdf"
,
sep
=
"/"
)
outname.p
=
paste
(
REPODIR
,
"Combined/data/Prot_RNA_comparisons_fig4_onlysignif.pdf"
,
sep
=
"/"
)
pdf
(
file
=
outname.p
,
width
=
12
,
height
=
8
)
p
...
...
Combined/src/plot_single_genes.R
0 → 100644
View file @
a4971b88
library
(
tidyverse
)
library
(
reshape2
)
library
(
plyr
)
REPODIR
=
"/home/mh/Uni_Lux/REPOS/LF_omics_analysis"
incompl
=
paste
(
REPODIR
,
"Combined/data/combined_full_table.tsv"
,
sep
=
"/"
)
compl
=
read.csv
(
incompl
,
sep
=
"\t"
)
tpm_all_c
=
compl
[
c
(
1
,
2
,
3
,
4
)]
tpm_all_m
=
compl
[
c
(
1
,
8
,
9
)]
lfq_scaled_c
=
compl
[
c
(
1
,
13
,
14
,
15
,
16
,
17
)]
lfq_scaled_m
=
compl
[
c
(
1
,
21
,
22
,
23
)]
lfq_raw_c
=
compl
[
c
(
1
,
27
,
28
,
29
,
30
,
31
)]
lfq_raw_m
=
compl
[
c
(
1
,
35
,
36
,
37
)]
anno
=
compl
[
c
(
1
,
seq
(
42
,
66
))]
plot_single_gene
<-
function
(
anno
,
genelist
,
tab_c
,
tab_m
,
mod_names
=
T
){
m_c
=
melt
(
tab_c
)
m_c
$
variable
=
"continuous"
m_m
=
melt
(
tab_m
)
m_m
$
variable
=
"mineral"
mer
=
rbind
(
m_c
,
m_m
)
#select genes from list
ff
=
mer
[
mer
$
Protein.IDs
%in%
genelist
,]
ff
=
join
(
ff
,
anno
)
if
(
mod_names
==
T
){
ff
$
PROKKA_productname
=
gsub
(
"alpha|beta|delta|gamma|subunit|,"
,
""
,
ff
$
PROKKA_productname
)
ff
$
PROKKA_productname
=
gsub
(
"putative|large"
,
""
,
ff
$
PROKKA_productname
)
ff
$
PROKKA_productname
=
gsub
(
":"
,
" "
,
ff
$
PROKKA_productname
)
ff
$
PROKKA_productname
=
gsub
(
"^\\s|\\s$"
,
""
,
ff
$
PROKKA_productname
)
ff
$
PROKKA_productname
=
tolower
(
ff
$
PROKKA_productname
)
}
#TODO add list of gene names
#p<-ggplot(ff,aes(y=value,x=PROKKA_productname))+
p
<-
ggplot
(
ff
,
aes
(
y
=
value
,
x
=
PROKKA_productname
))
+
geom_boxplot
(
aes
(
fill
=
variable
))
+
geom_jitter
(
aes
(
color
=
variable
,
fill
=
variable
,
group
=
variable
),
alpha
=
0.3
,
position
=
position_dodge
(
width
=
0.75
))
+
theme_bw
()
+
theme
(
axis.text.x
=
element_text
(
angle
=
45
,
hjust
=
1
))
return
(
p
)
}
pp
=
plot_single_gene
(
anno
,
c
(
"PROKKA_00005"
,
"PROKKA_00006"
),
tpm_all_c
,
tpm_all_m
)
#pp+facet_wrap(~ variable)
list_of_choice
=
mot
outf.dist.tpm
=
"/home/mh/Dropbox/phd_project/Lepto_Paper/submission_final/rtca_tpm.pdf"
outf.dist.lfq
=
"/home/mh/Dropbox/phd_project/Lepto_Paper/submission_final/rtca_lfq.pdf"
pdf
(
file
=
outf.dist.tpm
,
width
=
12
,
height
=
8
)
plot_single_gene
(
anno
,
list_of_choice
,
tpm_all_c
,
tpm_all_m
,
T
)
dev.off
()
pdf
(
file
=
outf.dist.lfq
,
width
=
12
,
height
=
8
)
plot_single_gene
(
anno
,
list_of_choice
,
lfq_raw_c
,
lfq_raw_m
,
T
)
dev.off
()
pp
=
plot_single_gene
(
anno
,
list_of_choice
,
tpm_all_c
,
tpm_all_m
)
plot_single_gene
(
anno
,
list_of_choice
,
lfq_scaled_c
,
lfq_scaled_m
)
plot_single_gene
(
anno
,
list_of_choice
,
lfq_raw_c
,
lfq_raw_m
)
###protstats
p
=
join
(
lfq_raw_c
,
lfq_raw_m
)
ff
=
lfq_raw_c
[
complete.cases
(
lfq_raw_m
),]
ff
=
lfq_raw_c
[
-1
]
ff
=
lfq_raw_m
[
-1
]
ff
=
lfq_scaled_c
[
-1
]
ff
=
lfq_scaled_m
[
-1
]
ff
[
!
is.na
(
ff
)]
<
-1
ff
[
is.na
(
ff
)]
<
-0
table
(
colSums
(
ff
))
###sort by TPM, LFQ_mean
tpm_arr_c
<-
compl
%>%
arrange
(
desc
(
tpm_continuous.means
))
tpm_arr_m
<-
compl
%>%
arrange
(
desc
(
tpm_mineral.means
))
lfq_arr_c
<-
compl
%>%
arrange
(
desc
(
lfq_cont_raw.means
))
lfq_arr_m
<-
compl
%>%
arrange
(
desc
(
lfq_min_raw.means
))
##plot dists
plot_dist
<-
function
(
tab_c
,
tab_m
){
m_c
=
melt
(
tab_c
)
m_c
$
variable
=
"continuous"
m_m
=
melt
(
tab_m
)
m_m
$
variable
=
"mineral"
mer
=
rbind
(
m_c
,
m_m
)
print
(
dim
(
m_c
))
print
(
dim
(
m_m
))
print
(
dim
(
mer
))
p
<-
ggplot
(
mer
,
aes
(
x
=
log2
(
value
),
fill
=
variable
))
+
geom_density
(
alpha
=
0.5
)
+
theme_bw
()
return
(
p
)
}
plot_dist
(
tpm_all_c
,
tpm_all_m
)
plot_dist
(
lfq_scaled_c
,
lfq_scaled_m
)
pp
=
plot_dist
(
lfq_raw_c
,
lfq_raw_m
)
outf.dist.tpm
=
"/home/mh/Dropbox/phd_project/Lepto_Paper/submission_final/dist_tpm.pdf"
outf.dist.lfq
=
"/home/mh/Dropbox/phd_project/Lepto_Paper/submission_final/dist_lfq.pdf"
pdf
(
file
=
outf.dist.tpm
,
width
=
12
,
height
=
8
)
p
dev.off
()
pdf
(
file
=
outf.dist.lfq
,
width
=
12
,
height
=
8
)
pp
dev.off
()
###prepare input for circos
out.tpm.c
=
"/home/mh/Uni_Lux/software/circos/circos-0.69/lepto/data/tpm_cont.tsv"
out.tpm.m
=
"/home/mh/Uni_Lux/software/circos/circos-0.69/lepto/data/tpm_min.tsv"
out.lfq.c
=
"/home/mh/Uni_Lux/software/circos/circos-0.69/lepto/data/lfq_cont.tsv"
out.lfq.m
=
"/home/mh/Uni_Lux/software/circos/circos-0.69/lepto/data/lfq_min.tsv"
#get coordinates
coords
=
read.csv
(
"/home/mh/Uni_Lux/software/circos/circos-0.69/lepto/data/coords.genes.txt"
,
sep
=
"\t"
,
header
=
F
)
coords
=
cbind
(
Protein.IDs
=
compl
$
Protein.IDs
,
coords
)
write.table
(
file
=
out.tpm.c
,
cbind
(
coords
[
-1
],
compl
$
tpm_continuous.means
),
sep
=
"\t"
,
col.names
=
F
,
row.names
=
F
,
quote
=
F
)
write.table
(
file
=
out.tpm.m
,
data.frame
(
coords
[
-1
],
compl
$
tpm_mineral.means
),
sep
=
"\t"
,
col.names
=
F
,
row.names
=
F
,
quote
=
F
)
#for proteins instead of compl use really unfiltered
infile.lf.cont.scaled
=
paste
(
REPODIR
,
"Proteomics/data/LFQs_continuous_scaled_unfilt.tsv"
,
sep
=
"/"
)
infile.lf.min.scaled
=
paste
(
REPODIR
,
"Proteomics/data/LFQs_mineral_scaled_unfilt.tsv"
,
sep
=
"/"
)
#optionally filter
lf.c
=
read.csv
(
infile.lf.cont.scaled
,
sep
=
"\t"
)
lf.m
=
read.csv
(
infile.lf.min.scaled
,
sep
=
"\t"
)
lf.cf
=
lf.c
[
apply
(
lf.c
[,
c
(
2
,
3
,
4
,
5
,
6
)],
1
,
function
(
x
)
length
(
which
(
is.na
(
x
)))
=<
3
),]
lf.mf
=
lf.m
[
apply
(
lf.m
[,
c
(
2
,
3
,
4
)],
1
,
function
(
x
)
length
(
which
(
is.na
(
x
)))
<
2
),]
lf.mf
=
lf.m
lf.cf
=
lf.c
lf.mf
=
lf.mf
[
!
is.na
(
lf.mf
$
means
),]
lf.cf
=
lf.cf
[
!
is.na
(
lf.cf
$
means
),]
lf.m
=
lf.mf
lf.c
=
lf.cf
lf.mm
=
join
(
coords
,
lf.m
)
lf.cc
=
join
(
coords
,
lf.c
)
write.table
(
file
=
out.lfq.c
,
data.frame
(
lf.cc
[
c
(
2
,
3
,
4
)],
lf.cc
$
means
),
sep
=
"\t"
,
col.names
=
F
,
row.names
=
F
,
quote
=
F
)
write.table
(
file
=
out.lfq.m
,
data.frame
(
lf.mm
[
c
(
2
,
3
,
4
)],
lf.mm
$
means
),
sep
=
"\t"
,
col.names
=
F
,
row.names
=
F
,
quote
=
F
)
#write out
#write.table()
###GENELISTS
#for cytochromes bd
cyt
=
c
(
"PROKKA_00439"
,
"PROKKA_00440"
,
"PROKKA_00822"
)
#cytochrome c
cyt
=
c
(
"PROKKA_00766"
,
"PROKKA_02381"
,
"PROKKA_02382"
,
"PROKKA_01388"
,
"PROKKA_00732"
,
"PROKKA_00740"
,
"PROKKA_00940"
,
"PROKKA_00730"
,
"PROKKA_00731"
,
"PROKKA_00741"
,
"PROKKA_02378"
,
"PROKKA_00732"
)
#cytochrome c c551 c552
cyt
=
c
(
"PROKKA_01388"
,
)
#rubisco
rub
=
"PROKKA_02524"
#reductive TCA
rtca
=
c
(
"PROKKA_02486"
,
"PROKKA_00876"
,
"PROKKA_01556"
,
"PROKKA_00585"
,
"PROKKA_00579"
,
"PROKKA_00587"
,
"PROKKA_00586"
,
"PROKKA_02458"
,
"PROKKA_02457"
,
"PROKKA_02451"
,
"PROKKA_02456"
,
"PROKKA_00965"
,
"PROKKA_00966"
,
"PROKKA_00581"
,
"PROKKA_00582"
,
"PROKKA_00578"
,
"PROKKA_02453"
,
"PROKKA_02452"
,
"PROKKA_02455"
,
"PROKKA_02450"
,
"PROKKA_02143"
)
#copper resistance + copper/silver resistance
cop
=
c
(
"PROKKA_02050"
,
"PROKKA_00313"
,
"PROKKA_00752"
,
"PROKKA_00684"
,
"PROKKA_00919"
,
"PROKKA_00166"
,
"PROKKA_02435"
,
"PROKKA_00920"
,
"PROKKA_01521"
,
"PROKKA_02071"
,
"PROKKA_00918"
,
"PROKKA_02048"
)
#"heavy metal resistance"
heav
=
c
(
"PROKKA_00076"
,
"PROKKA_00755"
,
"PROKKA_01059"
,
"PROKKA_02594"
)
sulf
=
c
(
"PROKKA_00960"
,
"PROKKA_00427"
,
"PROKKA_00958"
,
"PROKKA_01477"
,
"PROKKA_00429"
)
mot
=
c
(
"PROKKA_00196"
,
"PROKKA_00198"
,
"PROKKA_00199"
,
"PROKKA_00200"
,
"PROKKA_00201"
,
"PROKKA_00202"
,
"PROKKA_00203"
,
"PROKKA_00204"
,
"PROKKA_00205"
,
"PROKKA_00206"
,
"PROKKA_00207"
,
"PROKKA_00209"
,
"PROKKA_00210"
,
"PROKKA_00211"
,
"PROKKA_00212"
,
"PROKKA_00213"
,
"PROKKA_00214"
,
"PROKKA_00215"
,
"PROKKA_00216"
,
"PROKKA_00217"
,
"PROKKA_00218"
,
"PROKKA_00219"
,
"PROKKA_00220"
,
"PROKKA_00221"
,
"PROKKA_00222"
,
"PROKKA_02334"
,
"PROKKA_02335"
,
"PROKKA_02336"
,
"PROKKA_02337"
,
"PROKKA_02339"
,
"PROKKA_02340"
,
"PROKKA_02341"
,
"PROKKA_02342"
,
"PROKKA_02343"
,
"PROKKA_02344"
,
"PROKKA_02345"
,
"PROKKA_02346"
,
"PROKKA_02347"
,
"PROKKA_02348"
,
"PROKKA_02349"
)
ctax
=
c
(
"PROKKA_00183"
,
"PROKKA_00227"
,
"PROKKA_01445"
,
"PROKKA_01455"
,
"PROKKA_01548"
,
"PROKKA_01731"
,
"PROKKA_02147"
,
"PROKKA_00223"
,
"PROKKA_00224"
,
"PROKKA_00225"
,
"PROKKA_00226"
,
"PROKKA_00228"
,
"PROKKA_00229"
,
"PROKKA_00230"
,
"PROKKA_00710"
,
"PROKKA_00799"
,
"PROKKA_02318"
)
Combined/src/plot_tpm_lfqs_new.R
View file @
a4971b88
...
...
@@ -68,7 +68,7 @@ fff$general_cats=fff$Manually_assigned_category
fff
[
grep
(
"Nitra|Nitro|Ammonia"
,
fff
$
Manually_assigned_category
,
ignore.case
=
T
),]
$
general_cats
=
"Nitrogen metabolism"
#cytochromes not specified as left out of plot for now
groupcats_cytochromes
=
"Cytochrome"
fff
[
grep
(
groupcats_cytochromes
,
fff
$
Manually_assigned_categor
,
ignore.case
=
T
),]
$
general_cats
=
"Cytochromes"
fff
[
grep
(
groupcats_cytochromes
,
fff
$
Manually_assigned_categor
y
,
ignore.case
=
T
),]
$
general_cats
=
"Cytochromes"
groupcats_polysaccharides
=
paste
(
"Cellulose production"
,
"Extracellular polysaccharide production and export"
,
"Lipopolysaccharide synthesis"
,
...
...
Proteomics/data/LFQs_continuous_scaled_unfilt.tsv
View file @
a4971b88
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Proteomics/data/LFQs_mineral_scaled_unfilt.tsv
View file @
a4971b88
This diff is collapsed.
Click to expand it.
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