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
f1ee8c05
Commit
f1ee8c05
authored
Jun 14, 2019
by
Leon-Charles Tranchevent
Browse files
Cosmetic changes to satisfy lintR.
parent
79e9bae7
Changes
5
Hide whitespace changes
Inline
Side-by-side
R/preprocess_data.R
View file @
f1ee8c05
...
...
@@ -73,7 +73,8 @@ preprocess_data <- function(input_data_dir, output_data_file,
clean_samples
=
clean_samples
,
verbose
=
verbose
)
}
else
{
message
(
paste0
(
"["
,
Sys.time
(),
"] Platform "
,
platform
,
" not yet supported (no preprocessing done)."
))
message
(
paste0
(
"["
,
Sys.time
(),
"] Platform "
,
platform
,
" not yet supported (no preprocessing done)."
))
}
# We return the created ESET.
...
...
R/preprocess_data_affymetrix_rma.R
View file @
f1ee8c05
...
...
@@ -41,7 +41,8 @@ preprocess_data_affymetrix_rma <- function(input_data_dir, output_data_file,
# If necessary, we remove the samples that do not have clinical data.
if
(
clean_samples
)
{
# We load the clinical data as to get the samples to keep.
samples
<-
rownames
(
pData
(
ArrayUtils
::
load_clinical_data
(
input_data_dir
,
verbose
=
FALSE
)))
samples
<-
rownames
(
Biobase
::
pData
(
ArrayUtils
::
load_clinical_data
(
input_data_dir
,
verbose
=
FALSE
)))
# We only keep the samples with clinical data.
eset
<-
eset
[,
samples
]
}
...
...
R/preprocess_data_agilent_limma.R
View file @
f1ee8c05
...
...
@@ -39,7 +39,7 @@ preprocess_data_agilent_limma <- function(input_data_dir, output_data_file,
path
=
raw_data_input_dir
,
green.only
=
TRUE
,
verbose
=
TRUE
)
batch_data
=
log2
(
batch
$
E
)
batch_data
<-
log2
(
batch
$
E
)
remove
(
raw_data_input_dir
,
batch
)
# We run the LIMMA pre-processing method on the data.
...
...
@@ -55,7 +55,8 @@ preprocess_data_agilent_limma <- function(input_data_dir, output_data_file,
# If necessary, we remove the samples that do not have clinical data.
if
(
clean_samples
)
{
# We load the clinical data as to get the samples to keep.
samples
<-
rownames
(
pData
(
ArrayUtils
::
load_clinical_data
(
input_data_dir
,
verbose
=
FALSE
)))
samples
<-
rownames
(
Biobase
::
pData
(
ArrayUtils
::
load_clinical_data
(
input_data_dir
,
verbose
=
FALSE
)))
# We only keep the samples with clinical data.
batch_data_norm
<-
batch_data_norm
[,
samples
]
}
...
...
R/preprocess_data_illumina_beadarray.R
View file @
f1ee8c05
...
...
@@ -68,17 +68,17 @@ preprocess_data_illumina_beadarray <- function(input_data_dir, output_data_file,
# Additional cleaning (after normalization - also Illumina specific).
ids
<-
as.character
(
Biobase
::
featureNames
(
gse_data_norm
))
#qual <- unlist(mget(ids, illuminaHumanv3.db::illuminaHumanv3PROBEQUALITY, ifnotfound = NA))
qual
<-
unlist
(
mget
(
ids
,
get
(
"illuminaHumanv3PROBEQUALITY"
),
ifnotfound
=
NA
))
rem
<-
qual
==
"No match"
|
qual
==
"Bad"
|
is.na
(
qual
)
gse_data_filt
<-
Biobase
::
exprs
(
gse_data_norm
[
!
rem
,])
gse_data_filt
<-
Biobase
::
exprs
(
gse_data_norm
[
!
rem
,
])
rm
(
gse_data
,
gse_data_norm
)
}
# If necessary, we remove the samples that do not have clinical data.
if
(
clean_samples
)
{
# We load the clinical data as to get the samples to keep.
samples
<-
rownames
(
pData
(
ArrayUtils
::
load_clinical_data
(
input_data_dir
,
verbose
=
FALSE
)))
samples
<-
rownames
(
Biobase
::
pData
(
ArrayUtils
::
load_clinical_data
(
input_data_dir
,
verbose
=
FALSE
)))
# We only keep the samples with clinical data.
gse_data_filt
<-
gse_data_filt
[,
samples
]
}
...
...
R/run_quality_control_on_raw_agilent.R
View file @
f1ee8c05
...
...
@@ -36,8 +36,8 @@ run_quality_control_on_raw_agilent <- function(input_data_dir,
path
=
raw_data_input_dir
,
green.only
=
TRUE
,
verbose
=
TRUE
)
batch
$
targets
<-
pheno_data
batch_log_data
=
log2
(
batch
$
E
)
batch
$
targets
<-
pheno_data
batch_log_data
<-
log2
(
batch
$
E
)
# We clean up and log information.
rm
(
raw_file_list
,
raw_data_input_dir
,
pheno_data_raw
)
...
...
@@ -47,7 +47,7 @@ run_quality_control_on_raw_agilent <- function(input_data_dir,
# We do some kind of quality control (ourselves - no external packages).
dir.create
(
output_data_dir
)
# A-
heatmap
.
# A-
sample heatmap with dendograms
.
# Compute correlations.
cor_mat
<-
round
(
cor
(
batch_log_data
,
method
=
"pearson"
),
2
)
# Create the heatmap.
...
...
@@ -76,7 +76,7 @@ run_quality_control_on_raw_agilent <- function(input_data_dir,
dev.off
()
pca_gd_filename
<-
paste0
(
output_data_dir
,
"pca_gender.png"
)
png
(
pca_gd_filename
)
pca_plot_gd
<-
ggplot2
::
autoplot
(
pca
,
colour
=
gd_colors
,
size
=
5
)
pca_plot_gd
<-
ggplot2
::
autoplot
(
pca
,
colour
=
gd_colors
,
size
=
5
)
print
(
pca_plot_gd
)
dev.off
()
# We clean up.
...
...
@@ -113,7 +113,7 @@ run_quality_control_on_raw_agilent <- function(input_data_dir,
i
<-
(
rows
-
1
)
*
ncols
+
cols
# We now plot the arrays one by one.
for
(
j
in
seq_len
(
dim
(
batch_log_data
)[
2
]))
{
array_data
[
i
]
<-
batch_log_data
[
,
j
]
array_data
[
i
]
<-
batch_log_data
[,
j
]
array_filename
<-
paste0
(
output_data_dir
,
"array_"
,
j
,
".png"
)
png
(
array_filename
)
limma
::
imageplot
(
array_data
,
...
...
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