Skip to content

Commit

Permalink
Fix: Bug in mldm when sample.md is a single column
Browse files Browse the repository at this point in the history
We explicitly convert the table into a dataframe to prevent it from
being assigned as a vector
  • Loading branch information
dileep-kishore committed Dec 3, 2021
1 parent de8e9f7 commit 24a8341
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion micone/pipelines/templates/network_inference/direct/mldm.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ read_otu_data <- function(tablefile) {
read_sample_data <- function(tablefile) {
table <- read.table(tablefile, header=TRUE, check.names=FALSE, comment.char="", sep="\\t")
table.rownames <- table[, 1]
table <- table[, 2:ncol(table)]
table <- as.data.frame(table[, 2:ncol(table)])
dmy <- dummyVars(" ~ .", data=table)
table.frame <- data.frame(predict(dmy, newdata=table))
table.matrix <- data.matrix(table.frame)
Expand Down

0 comments on commit 24a8341

Please sign in to comment.