Commit 326b437e authored by Leon-Charles Tranchevent's avatar Leon-Charles Tranchevent
Browse files

Minor changes to the file laoding system.

parent 334980ee
Package: ArrayUtils Package: ArrayUtils
Type: Package Type: Package
Title: Utils For Array Processing Title: Utils For Array Processing
Version: 0.3.2 Version: 0.3.3
Author: Leon-Charles Tranchevent Author: Leon-Charles Tranchevent
Maintainer: Leon-Charles Tranchevent <leon-charles.tranchevent@uni.lu> Maintainer: Leon-Charles Tranchevent <leon-charles.tranchevent@uni.lu>
Description: This package contains functions to analyse microarray data. Description: This package contains functions to analyse microarray data.
...@@ -14,12 +14,14 @@ Imports: ...@@ -14,12 +14,14 @@ Imports:
utils, utils,
stats, stats,
affy, affy,
oligo,
gcrma, gcrma,
arrayQualityMetrics, arrayQualityMetrics,
SCAN.UPC, SCAN.UPC,
sva, sva,
massiR, massiR,
limma, limma,
edgeR,
stringr, stringr,
AnnotationDbi, AnnotationDbi,
statmod, statmod,
...@@ -32,4 +34,4 @@ Imports: ...@@ -32,4 +34,4 @@ Imports:
methods, methods,
illuminaHumanv3.db, illuminaHumanv3.db,
topconfects topconfects
RoxygenNote: 7.1.0 RoxygenNote: 7.1.1
...@@ -8,3 +8,4 @@ importFrom("stats", "model.matrix") ...@@ -8,3 +8,4 @@ importFrom("stats", "model.matrix")
importFrom("utils", "read.delim") importFrom("utils", "read.delim")
importFrom("stats", "var") importFrom("stats", "var")
importFrom("stats", "filter") importFrom("stats", "filter")
importFrom("methods", "as")
...@@ -17,14 +17,14 @@ get_gene_annots_from_file <- function(folder, filename, entities) { ...@@ -17,14 +17,14 @@ get_gene_annots_from_file <- function(folder, filename, entities) {
file_path <- paste0(folder, filename) file_path <- paste0(folder, filename)
# We read the file into a data-frame. # We read the file into a data-frame.
gene_annots <- read.delim(file_path, row.names = NULL, stringsAsFactors = FALSE) gene_annots <- read.delim(file_path, header = FALSE, row.names = NULL, stringsAsFactors = FALSE)
rm(file_path) rm(file_path)
# We do a bit of cleaning. # We do a bit of cleaning.
gene_annots[is.na(gene_annots)] <- "" names(gene_annots) <- c("PROBEID", "SYMBOL")
rownames(gene_annots) <- gene_annots$PROBEID entities_asdf <- data.frame("PROBEID" = entities)
gene_annots <- gene_annots[entities, ] gene_annots_clean <- merge(entities_asdf, gene_annots, by = "PROBEID", all.x = TRUE)
rownames(gene_annots) <- seq(1, length(rownames(gene_annots))) rm(entities_asdf, gene_annots)
return(gene_annots) return(gene_annots_clean)
} }
...@@ -37,6 +37,14 @@ load_clinical_data <- function(data_dir, ...@@ -37,6 +37,14 @@ load_clinical_data <- function(data_dir,
row.names = 1)) row.names = 1))
} }
# Special case: when gender is set ot F for all rows, the system reads it as a boolean.
raw_df <- as.data.frame(Biobase::pData(pheno_data))
if (typeof(raw_df$Gender) == "logical") {
raw_df$Gender[raw_df$Gender == FALSE] <- "F"
}
pheno_data <- as(raw_df, "AnnotatedDataFrame")
rm(raw_df)
# We clean up and log information. # We clean up and log information.
rm(clinical_data_file) rm(clinical_data_file)
if (verbose == TRUE) { if (verbose == TRUE) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment