Skip to content

Commit d3337b1

Browse files
author
suiyue
committed
Add "_" after prefix
Add prefix for gene.tsv and txANDgenes.tsv
1 parent d8b9755 commit d3337b1

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

R/readWrite.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ writeBambuOutput <- function(se, path, prefix = "", outputExtendedAnno = TRUE,
2727
dir.create(outdir, recursive = TRUE)
2828

2929
transcript_grList <- rowRanges(se)
30+
prefix <- ifelse(prefix != "", paste0(prefix, "_"), "")
3031
transcript_gtffn <- paste(outdir, prefix, sep = "")
3132
gtf <- writeAnnotationsToGTF(annotation = transcript_grList,
3233
file = transcript_gtffn, outputExtendedAnno = outputExtendedAnno,
@@ -50,9 +51,9 @@ writeBambuOutput <- function(se, path, prefix = "", outputExtendedAnno = TRUE,
5051
#utils::write.table(paste0(colnames(se), "-1"), file = paste0(outdir, "barcodes.tsv"), quote = FALSE, row.names = FALSE, col.names = FALSE)
5152
#R.utils::gzip(paste0(outdir, "barcodes.tsv"))
5253
txANDGenes <- data.table(as.data.frame(rowData(se))[,c("TXNAME","GENEID")])
53-
utils::write.table(txANDGenes, file = paste0(outdir, "txANDgenes.tsv"),
54+
utils::write.table(txANDGenes, file = paste0(outdir, prefix, "txANDgenes.tsv"),
5455
sep = "\t", quote = FALSE, row.names = FALSE, col.names = FALSE)
55-
utils::write.table(names(seGene), file = paste0(outdir, "genes.tsv"),
56+
utils::write.table(names(seGene), file = paste0(outdir, prefix, "genes.tsv"),
5657
sep = "\t", quote = FALSE, row.names = FALSE, col.names = FALSE)
5758

5859
#R.utils::gzip(paste0(outdir, "txANDgenes.tsv"))

0 commit comments

Comments
 (0)