tss_export(exp,
samples = "all",
file_type = "table",
out_dir = testing_out,
diff_tss = FALSE,
sep = "\t")
"Error in fwrite(x, export_file, sep = sep, col.names = TRUE, row.names = FALSE, : is.list(x) is not TRUE
8.
stop(simpleError(msg, call = if (p <- sys.parent(1L)) sys.call(p)))
7.
stopifnot(is.list(x), identical(quote, "auto") || isTRUEorFALSE(quote), is.character(sep) && length(sep) == 1L && nchar(sep) == 1L, is.character(sep2) && length(sep2) == 3L && nchar(sep2[2L]) == 1L, is.character(dec) && length(dec) == 1L && nchar(dec) == ...
6.
fwrite(x, export_file, sep = sep, col.names = TRUE, row.names = FALSE, quote = FALSE)
5.
.f(.x[[i]], .y[[i]], ...)
4.
map2(.x, .y, .f, ...)
3.
walk2(.x, vec_index(.x), .f, ...)
2.
iwalk(export_samples, function(x, y) { export_file <- file.path(ifelse(is.na(out_dir), getwd(), out_dir), str_c(y, "_TSSs.tsv")) fwrite(x, export_file, sep = sep, col.names = TRUE, row.names = FALSE, ...
1.
tss_export(exp, samples = "all", file_type = "table", out_dir = testing_out, diff_tss = FALSE, sep = "\t")
"
sample_names <- names(exp@counts$TSSs$raw)
export_samples <- exp@counts$TSSs$raw[sample_names]
## add column with sample name, remove unecessary columns
small_frames = imap(export_samples, function(sample_df, sample_name){
sample_df %>%
mutate(sample_name = sample_name) %>%
select(sample_name, FHASH, score)
})
## Combine all observations, convert to matrix for DESeq2
count_matrix = bind_rows(small_frames) %>%
pivot_wider(names_from = sample_name, values_from = score) %>%
column_to_rownames(., var = "FHASH") %>%
as.matrix()
#convert NA to zero
count_matrix[is.na(count_matrix)] <- 0
Hi,
I'm trying to export the counts to a table to works around #193 but
fails with
the following (code taken from data_export.R) works, though