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
24846b85
Commit
24846b85
authored
Jul 29, 2019
by
Leon-Charles Tranchevent
Browse files
Small correction in file / folder naming for batch correction.
parent
6d95399a
Changes
5
Hide whitespace changes
Inline
Side-by-side
R/correct_batch_effect.R
View file @
24846b85
...
@@ -49,6 +49,24 @@ correct_batch_effect <- function(eset,
...
@@ -49,6 +49,24 @@ correct_batch_effect <- function(eset,
}
}
}
}
# We remove the probes that have 0 variance accross the samples for each batch.
# Not doing so will prevent Combat from running.
exp_data
<-
Biobase
::
exprs
(
eset
)
clean_probe_list
<-
rownames
(
exp_data
)
for
(
b
in
unique
(
batch_data
$
Batch
))
{
# We take care of batch b.
samples_in_batch
<-
which
(
batch_data
$
Batch
==
b
)
exp_data_batch
<-
exp_data
[,
samples_in_batch
]
probe_vars
<-
apply
(
exp_data_batch
,
1
,
var
)
probe_var_0
<-
names
(
probe_vars
[
probe_vars
==
0
])
if
(
length
(
probe_var_0
)
>
0
)
{
clean_probe_list
<-
setdiff
(
clean_probe_list
,
probe_var_0
)
}
}
remove
(
b
,
samples_in_batch
,
exp_data_batch
,
probe_vars
,
probe_var_0
)
eset
<-
Biobase
::
ExpressionSet
(
exp_data
[
clean_probe_list
,
])
remove
(
exp_data
,
clean_probe_list
)
# ComBat corrects for the batch effect.
# ComBat corrects for the batch effect.
data_bc
<-
sva
::
ComBat
(
dat
=
Biobase
::
exprs
(
eset
),
data_bc
<-
sva
::
ComBat
(
dat
=
Biobase
::
exprs
(
eset
),
batch
=
batch_data
$
Batch
,
batch
=
batch_data
$
Batch
,
...
...
R/preprocess_data_affymetrix_gcrma.R
View file @
24846b85
...
@@ -90,7 +90,7 @@ preprocess_data_affymetrix_gcrma <- function(input_data_dir, output_data_files,
...
@@ -90,7 +90,7 @@ preprocess_data_affymetrix_gcrma <- function(input_data_dir, output_data_files,
# We return the created ESET(s).
# We return the created ESET(s).
if
(
batch_correction
==
"BOTH"
)
{
if
(
batch_correction
==
"BOTH"
)
{
return
(
list
(
eset
,
eset
_bc
))
return
(
list
(
eset
_bc
,
eset
))
}
else
{
}
else
{
return
(
eset
)
return
(
eset
)
}
}
...
...
R/preprocess_data_affymetrix_scan.R
View file @
24846b85
...
@@ -89,7 +89,7 @@ preprocess_data_affymetrix_scan <- function(input_data_dir, output_data_files,
...
@@ -89,7 +89,7 @@ preprocess_data_affymetrix_scan <- function(input_data_dir, output_data_files,
# We return the created ESET(s).
# We return the created ESET(s).
if
(
batch_correction
==
"BOTH"
)
{
if
(
batch_correction
==
"BOTH"
)
{
return
(
list
(
eset
,
eset
_bc
))
return
(
list
(
eset
_bc
,
eset
))
}
else
{
}
else
{
return
(
eset
)
return
(
eset
)
}
}
...
...
R/preprocess_data_agilent_limma.R
View file @
24846b85
...
@@ -115,7 +115,7 @@ preprocess_data_agilent_limma <- function(input_data_dir, output_data_files,
...
@@ -115,7 +115,7 @@ preprocess_data_agilent_limma <- function(input_data_dir, output_data_files,
# We return the created ESET(s).
# We return the created ESET(s).
if
(
batch_correction
==
"BOTH"
)
{
if
(
batch_correction
==
"BOTH"
)
{
return
(
list
(
eset
,
eset
_bc
))
return
(
list
(
eset
_bc
,
eset
))
}
else
{
}
else
{
return
(
eset
)
return
(
eset
)
}
}
...
...
R/preprocess_data_illumina_beadarray.R
View file @
24846b85
...
@@ -132,7 +132,7 @@ preprocess_data_illumina_beadarray <- function(input_data_dir, output_data_files
...
@@ -132,7 +132,7 @@ preprocess_data_illumina_beadarray <- function(input_data_dir, output_data_files
# We return the created ESET(s).
# We return the created ESET(s).
if
(
batch_correction
==
"BOTH"
)
{
if
(
batch_correction
==
"BOTH"
)
{
return
(
list
(
eset
,
eset
_bc
))
return
(
list
(
eset
_bc
,
eset
))
}
else
{
}
else
{
return
(
eset
)
return
(
eset
)
}
}
...
...
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