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
a0ff6216
Commit
a0ff6216
authored
Apr 23, 2019
by
Leon-Charles Tranchevent
Browse files
Added option to get the pheno data as factors or not.
parent
434ffc66
Changes
2
Hide whitespace changes
Inline
Side-by-side
DESCRIPTION
View file @
a0ff6216
...
...
@@ -6,7 +6,7 @@ Author: Leon-Charles Tranchevent
Maintainer: Leon-Charles Tranchevent <leon-charles.tranchevent@uni.lu>
Description: This package contains functions to analyse microarray data.
It is more a set of useful functions than a real package.
License:
The Unlicense (se
e LICENSE
)
License:
fil
e LICENSE
Encoding: UTF-8
LazyData: true
Imports:
...
...
R/load_clinical_data.R
View file @
a0ff6216
...
...
@@ -8,11 +8,13 @@
#'
#' @param data_dir A string representing the folder that contains the clinical data.
#' @param clinical_file_name A string containing the file name. By default, this is 'ClinicalData.tsv'
#' @param use_factors A boolean stating whether the columns should be read as factors (default FALSE).
#' @param verbose A boolean representing whether the function should display log information. This
#' is TRUE by default.
#' @return An annotated data-frame that contains the clinical data.
load_clinical_data
<-
function
(
data_dir
,
clinical_file_name
=
"ClinicalData.tsv"
,
use_factors
=
TRUE
,
verbose
=
TRUE
)
{
# We define the I/Os.
...
...
@@ -22,9 +24,16 @@ load_clinical_data <- function(data_dir,
}
# We load the clinical data.
pheno_data
<-
Biobase
::
AnnotatedDataFrame
(
utils
::
read.delim
(
file
=
clinical_data_file
,
row.names
=
1
,
colClasses
=
"factor"
))
pheno_data
<-
NULL
if
(
use_factors
)
{
pheno_data
<-
Biobase
::
AnnotatedDataFrame
(
utils
::
read.delim
(
file
=
clinical_data_file
,
row.names
=
1
,
colClasses
=
"factor"
))
}
else
{
# We do not use factors.
pheno_data
<-
Biobase
::
AnnotatedDataFrame
(
utils
::
read.delim
(
file
=
clinical_data_file
,
row.names
=
1
))
}
# We clean up and log information.
rm
(
clinical_data_file
)
...
...
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