Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
BDS
GeneDER
ArrayUtils
Commits
4299aa24
Commit
4299aa24
authored
Apr 10, 2020
by
Leon-Charles Tranchevent
Browse files
Minor modifications (based on coding style).
parent
cd16e491
Changes
2
Hide whitespace changes
Inline
Side-by-side
R/create_design.R
View file @
4299aa24
...
...
@@ -218,7 +218,8 @@ create_design <- function(pheno_data, limma_parameters,
clinical_cofactor
<-
factor
(
pheno_data
[[
cofactor_name
]])
# nolint
batches
<-
factor
(
pheno_data
[[
"Batch"
]])
genders
<-
factor
(
pheno_data
[[
"Gender"
]])
design
<-
stats
::
model.matrix
(
~
0
+
clinical
+
batches
+
genders
+
clinical_cofactor
)
design
<-
stats
::
model.matrix
(
~
0
+
clinical
+
batches
+
genders
+
clinical_cofactor
)
colnames
(
design
)
<-
c
(
levels
(
clinical
),
levels
(
batches
)[
2
:
length
(
levels
(
batches
))],
levels
(
genders
)[
2
:
length
(
levels
(
genders
))],
...
...
@@ -254,7 +255,8 @@ create_design <- function(pheno_data, limma_parameters,
clinical_cofactor
<-
factor
(
pheno_data
[[
cofactor_name
]])
# nolint
ages
<-
as.numeric
(
pheno_data
[[
"Age"
]])
genders
<-
factor
(
pheno_data
[[
"Gender"
]])
design
<-
stats
::
model.matrix
(
~
0
+
clinical
+
ages
+
genders
+
clinical_cofactor
)
design
<-
stats
::
model.matrix
(
~
0
+
clinical
+
ages
+
genders
+
clinical_cofactor
)
colnames
(
design
)
<-
c
(
levels
(
clinical
),
"Age"
,
levels
(
genders
)[
2
:
length
(
levels
(
genders
))],
cofactor_name
)
...
...
@@ -303,7 +305,8 @@ create_design <- function(pheno_data, limma_parameters,
# We log information.
rm
(
clinical_cofactor
,
ages
,
batches
,
genders
)
if
(
verbose
==
TRUE
)
{
message
(
paste0
(
"["
,
Sys.time
(),
"] Design matrix created (pairs, ages, batches, genders)."
))
message
(
paste0
(
"["
,
Sys.time
(),
"] Design matrix created (pairs, ages, batches, genders)."
))
}
}
}
...
...
R/run_limma.R
View file @
4299aa24
...
...
@@ -51,11 +51,8 @@ run_limma <- function(pheno_data, eset, limma_parameters,
verbose
=
FALSE
)
{
# We extract the limma analysis parameters
clinical_factor
<-
limma_parameters
[[
1
]]
coefficients
<-
limma_parameters
[[
2
]]
has_block
<-
!
is.null
(
cofactor_name
)
clinical
<-
factor
(
pheno_data
[[
clinical_factor
]])
rm
(
clinical_factor
)
# We refine the prefix / suffic for the file names.
if
(
file_prefix
!=
""
)
{
...
...
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