path <- "/home/kokyriakidis/Downloads/BCBIO/mirqc_bcbio/final/2020-02-23_mirqc_bcbio"
sbcb <- loadSmallRnaRun(path, "condition")
Error in x[[...]] <- m : replacement has length zero
3.
`[[<-.factor`(`*tmp*`, "sample", value = NULL)
2.
`[[<-`(`*tmp*`, "sample", value = NULL)
1.
loadSmallRnaRun(file.path(path, "final", "2020-02-23_mirqc_bcbio"), "condition")
I did some digging in the code. First, this change is necessary I think.
match <- str_match(project_dir, project_dir_pattern)
should change to:
match <- str_match(basename(project_dir), project_dir_pattern)
csv <- read.csv(csv_file, row.names = 1L, check.names = FALSE)
#This line breaks the code# csv <- csv[, apply(!is.na(csv), 2, all)]
if (is.null(colData)) {
col_data <- csv
}
else {
col_data <- as.data.frame(colData)
}
col_data[["sample"]] <- rownames(col_data)
Removing this line makes the function work fine. This is happening when there is only one column with info about the samples and after the removal of the other fields, the format is disrupted.