Skip to content

Commit

Permalink
Merge pull request #97 from nf-core/issue_69
Browse files Browse the repository at this point in the history
Remove timestamp suffix
  • Loading branch information
apeltzer authored Nov 14, 2024
2 parents 6f9578e + efda6e2 commit c62a5f1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### `Changed`

- [#82](https://github.com/nf-core/nanostring/pull/82) - Updated to nf-core template 3.0.2
- [#96](https://github.com/nf-core/nanostring/pull/96) - Remove timestamp suffix from nacho_norm.R and write_out_prepared_gex.R

### `Dependencies`

Expand Down
6 changes: 2 additions & 4 deletions bin/nacho_norm.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ get_counts <- function(
tidyr::pivot_wider(names_from = "RCC_FILE_NAME", values_from = "Count_Norm")
}

now=format(Sys.time(), "%Y%m%d%H%M")

#Write out normalized counts
norm_counts <- as.data.frame(get_counts(nacho_data))
write_tsv(norm_counts, file = paste0(now, "_normalized_counts.tsv"))
write_tsv(norm_counts, file = "normalized_counts.tsv")

#Write out non-hk normalized counts too
nacho_data_no_hk <- load_rcc(data_directory = input_rcc_path,
Expand All @@ -52,4 +50,4 @@ nacho_data_no_hk <- load_rcc(data_directory = input_rcc_path,
housekeeping_norm = FALSE)

norm_counts_without_hks <- as.data.frame(get_counts(nacho_data_no_hk))
write_tsv(norm_counts_without_hks, file = paste0(now, "_normalized_counts_wo_HKnorm.tsv"))
write_tsv(norm_counts_without_hks, file = "normalized_counts_wo_HKnorm.tsv")
5 changes: 2 additions & 3 deletions bin/write_out_prepared_gex.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,11 @@ hk_annotated <- getTransposedAnnotatedCounts(counts = counts, entity = "Housekee
endo_annotated <- getTransposedAnnotatedCounts(counts = counts, entity = "Endogenous", metadata = meta_detail)

#Write files as TSVs for multiqc input :-)
now=format(Sys.time(), "%Y%m%d%H%M")

input_name <- str_c(str_split_1(tools::file_path_sans_ext(input_counts), "_")[-1], collapse = "_")

write.table(hk_annotated, file = paste0(now, "_", input_name, "_Norm_GEX_HK.tsv"), sep="\t", quote = FALSE, col.names = TRUE, row.names=FALSE)
write.table(endo_annotated, file = paste0(now, "_", input_name, "_Norm_GEX_ENDO.tsv"), sep="\t", quote = FALSE, col.names = TRUE, row.names=FALSE)
write.table(hk_annotated, file = paste0(input_name, "_Norm_GEX_HK.tsv"), sep="\t", quote = FALSE, col.names = TRUE, row.names=FALSE)
write.table(endo_annotated, file = paste0(input_name, "_Norm_GEX_ENDO.tsv"), sep="\t", quote = FALSE, col.names = TRUE, row.names=FALSE)

prefix <- ""
if (grepl("wo_HKnorm",input_name)) {
Expand Down

0 comments on commit c62a5f1

Please sign in to comment.