Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
3
32drugs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vallo Varik
32drugs
Merge requests
!1
Task1
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Task1
losa-master-patch-27750
into
master
Overview
0
Commits
1
Pipelines
0
Changes
1
Open
Carlota Losa Mediavilla
requested to merge
losa-master-patch-27750
into
master
2 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
R script for first task.
0
0
Merge request reports
Compare
master
version 16
a809e2b9
1 year ago
version 15
a809e2b9
1 year ago
version 14
a809e2b9
1 year ago
version 13
a809e2b9
2 years ago
version 12
a809e2b9
2 years ago
version 11
a809e2b9
2 years ago
version 10
a809e2b9
2 years ago
version 9
a809e2b9
2 years ago
version 8
a809e2b9
2 years ago
version 7
a809e2b9
2 years ago
version 6
a809e2b9
2 years ago
version 5
a809e2b9
2 years ago
version 4
a809e2b9
2 years ago
version 3
a809e2b9
2 years ago
version 2
a809e2b9
2 years ago
version 1
a809e2b9
2 years ago
master (HEAD)
and
latest version
latest version
a809e2b9
1 commit,
1 year ago
version 16
a809e2b9
1 commit,
1 year ago
version 15
a809e2b9
1 commit,
1 year ago
version 14
a809e2b9
1 commit,
1 year ago
version 13
a809e2b9
1 commit,
2 years ago
version 12
a809e2b9
1 commit,
2 years ago
version 11
a809e2b9
1 commit,
2 years ago
version 10
a809e2b9
1 commit,
2 years ago
version 9
a809e2b9
1 commit,
2 years ago
version 8
a809e2b9
1 commit,
2 years ago
version 7
a809e2b9
1 commit,
2 years ago
version 6
a809e2b9
1 commit,
2 years ago
version 5
a809e2b9
1 commit,
2 years ago
version 4
a809e2b9
1 commit,
2 years ago
version 3
a809e2b9
1 commit,
2 years ago
version 2
a809e2b9
1 commit,
2 years ago
version 1
a809e2b9
1 commit,
2 years ago
1 file
+
72
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Task1.R
0 → 100644
+
72
−
0
Options
library
(
ggplot2
)
library
(
dplyr
)
library
(
tidyverse
)
# EXPLORE
## task1_1
data
<-
read.csv
(
"/Users/carlota/Desktop/EMBL/Vallo_R/01_dat.csv"
,
header
=
TRUE
)
data
%>%
select
(
Well
,
Time_h
,
RawOD
,
uM
)
%>%
ggplot
(
aes
(
y
=
RawOD
,
x
=
Time_h
))
+
geom_line
()
+
labs
(
x
=
"Time (h)"
,
y
=
"Raw OD"
,
title
=
"Growth curves of S.flexneri M90T with Azithromycin"
)
+
facet_wrap
(
~
uM
,
labeller
=
label_both
)
ggsave
(
filename
=
"/Users/carlota/Desktop/EMBL/Vallo_R/plot1_1.pdf"
)
## task1_2
data2
<-
read.csv
(
"/Users/carlota/Desktop/EMBL/Vallo_R/02_dat.csv"
,
header
=
TRUE
)
data2
%>%
select
(
Date
,
Well
,
Time_h
,
RawOD
,
uM
)
%>%
mutate
(
Date
=
as.factor
(
Date
))
%>%
ggplot
(
aes
(
y
=
RawOD
,
x
=
Time_h
,
color
=
Date
))
+
geom_line
()
+
labs
(
x
=
"Time (h)"
,
y
=
"RawOD"
)
+
scale_y_continuous
(
trans
=
"log2"
)
+
# transforms to logarithmic scale
facet_wrap
(
~
uM
,
labeller
=
label_both
)
ggsave
(
filename
=
"/Users/carlota/Desktop/EMBL/Vallo_R/plot1_2.pdf"
)
## task1_3
data3
<-
read.csv
(
"/Users/carlota/Desktop/EMBL/Vallo_R/03_dat.csv"
,
header
=
TRUE
)
data3
%>%
select
(
Date
,
Plt
,
Well
,
Time_h
,
RawOD
,
uM
)
%>%
mutate
(
Date
=
as.factor
(
Date
))
%>%
ggplot
(
aes
(
y
=
RawOD
,
x
=
Time_h
,
color
=
Date
,
group
=
Plt
))
+
# groups according to Plt
geom_line
()
+
labs
(
x
=
"Time (h)"
,
y
=
"RawOD"
)
+
scale_y_continuous
(
trans
=
"log2"
)
+
facet_wrap
(
~
uM
,
labeller
=
label_both
)
ggsave
(
filename
=
"/Users/carlota/Desktop/EMBL/Vallo_R/plot1_3.pdf"
)
# TRANSFORM
## task1_4
data3
<-
read.csv
(
"/Users/carlota/Desktop/EMBL/Vallo_R/03_dat.csv"
,
header
=
TRUE
)
%>%
group_by
(
Date
,
Time_h
,
Plt
)
%>%
#now assign new variables
mutate
(
background
=
RawOD
[
uM
==
-1
],
OD
=
RawOD
-
background
)
#filter(Time_h == 1.08)
#data3$OD <- data3$RawOD - filter(data3, uM == -1)$RawOD
data3
%>%
select
(
Date
,
Plt
,
Well
,
Time_h
,
OD
,
RawOD
,
uM
)
%>%
mutate
(
Date
=
as.factor
(
Date
))
%>%
# is it RawOD or OD?
filter
(
!
str_detect
(
uM
,
"-1"
))
%>%
ggplot
(
aes
(
y
=
OD
,
x
=
Time_h
,
color
=
Date
,
group
=
Plt
))
+
# groups according to Plt
geom_line
()
+
labs
(
x
=
"Time (h)"
,
y
=
"RawOD"
)
+
scale_y_continuous
(
trans
=
"log2"
)
+
facet_wrap
(
~
uM
,
labeller
=
label_both
)
ggsave
(
filename
=
"/Users/carlota/Desktop/EMBL/Vallo_R/plot1_4.pdf"
)
data3
<-
filter
(
data3
,
uM
==
-1
)
%>%
rename
(
bg
=
RawOD
)
%>%
select
(
Date
,
Plt
,
Time_h
,
bg
)
%>%
right_join
(
data3
)
# it matches back based on date, plt and time_h
Loading