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
Type: Package
Title: Utils For Array Processing
Version: 0.3.2
Version: 0.3.3
Author: Leon-Charles Tranchevent
Maintainer: Leon-Charles Tranchevent <leon-charles.tranchevent@uni.lu>
Description: This package contains functions to analyse microarray data.
......@@ -14,12 +14,14 @@ Imports:
utils,
stats,
affy,
oligo,
gcrma,
arrayQualityMetrics,
SCAN.UPC,
sva,
massiR,
limma,
edgeR,
stringr,
AnnotationDbi,
statmod,
......@@ -32,4 +34,4 @@ Imports:
methods,
illuminaHumanv3.db,
topconfects
RoxygenNote: 7.1.0
RoxygenNote: 7.1.1
......@@ -8,3 +8,4 @@ importFrom("stats", "model.matrix")
importFrom("utils", "read.delim")
importFrom("stats", "var")
importFrom("stats", "filter")
importFrom("methods", "as")
......@@ -17,14 +17,14 @@ get_gene_annots_from_file <- function(folder, filename, entities) {
file_path <- paste0(folder, filename)
# 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)
# We do a bit of cleaning.
gene_annots[is.na(gene_annots)] <- ""
rownames(gene_annots) <- gene_annots$PROBEID
gene_annots <- gene_annots[entities, ]
rownames(gene_annots) <- seq(1, length(rownames(gene_annots)))
names(gene_annots) <- c("PROBEID", "SYMBOL")
entities_asdf <- data.frame("PROBEID" = entities)
gene_annots_clean <- merge(entities_asdf, gene_annots, by = "PROBEID", all.x = TRUE)
rm(entities_asdf, gene_annots)
return(gene_annots)
return(gene_annots_clean)
}
......@@ -37,6 +37,14 @@ load_clinical_data <- function(data_dir,
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.
rm(clinical_data_file)
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