diff --git a/pisces/R/make_expression_matrix.R b/pisces/R/make_expression_matrix.R index 4f74ca4..6067823 100755 --- a/pisces/R/make_expression_matrix.R +++ b/pisces/R/make_expression_matrix.R @@ -239,11 +239,17 @@ Summarize <- function(txi, tx2gene, annotation, args, metadata, species) { message("Writing annotation data matrix...") write.table(as.data.frame(annotation), paste0(args[["--name"]], ".", species, ".annotation.txt"), quote = FALSE, sep = "\t", row.names = F, col.names = T) + + message("Making gene-level length matrix...") + as.data.frame(txi.gene$abundance) %>% tibble::rownames_to_column("gene_id") %>% + left_join(annotation) %>% as.data.frame %>% + write.table(format(., nsmall = 3, scientific = F, trim = T), paste0(args[["--name"]], + ".", species, ".length.txt"), quote = FALSE, sep = "\t", row.names = F, + col.names = T) - message("Making raw TPM matrix...") + message("Making gene-level TPM matrix...") raw_df <- as.data.frame(txi.gene$abundance) %>% tibble::rownames_to_column("gene_id") %>% left_join(annotation) %>% as.data.frame - if (!args[["--no-rescale"]]) { message(paste("Scaling TPM of", args[["--scale-tpm"]], "to 1e6...")) @@ -263,6 +269,7 @@ Summarize <- function(txi, tx2gene, annotation, args, metadata, species) { write.table(format(normed_df, nsmall = 3, scientific = F, trim = T), paste0(args[["--name"]], ".", species, ".log2fc.txt"), quote = FALSE, sep = "\t", row.names = F, col.names = T) + message(paste("Calculating TMM scaling factors using", args[["--scale-tpm"]],