Skip to content

Commit

Permalink
meta.table dumping
Browse files Browse the repository at this point in the history
  • Loading branch information
Riley-Grindle committed Nov 21, 2024
1 parent e89319e commit a1a0f88
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
16 changes: 16 additions & 0 deletions bin/Plotting.R
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,22 @@ if(toupper(params.MakeLoupe) == "TRUE"){
message("Saving Seurat Object")
SaveSeuratRds(MergedSO, file = paste0("08",params.ProjectName, "_FinalSO.rds"))

# ╔════════════════════════╗
# ╠═ Save Meta Data Table ═╣
# ╚════════════════════════╝
meta_table <- MergedSO@meta.data
meta_table <- cbind(meta_table, as.data.table(MergedSO@reductions$pca@cell.embeddings))
if (params.IntegrationMethod != "NULL"){
meta_table <- cbind(meta_table, MergedSO@reductions[[paste0("tsne.",params.IntegrationMethod)]]@cell.embeddings)
meta_table <- cbind(meta_table, MergedSO@reductions[[paste0("umap.",params.IntegrationMethod)]]@cell.embeddings)
} else {
meta_table <- cbind(meta_table, MergedSO@reductions[["tsne.unintegrated"]]@cell.embeddings)
meta_table <- cbind(meta_table, MergedSO@reductions[["umap.unintegrated"]]@cell.embeddings)
}
write.csv(file = paste0("08_",params.ProjectName,"_MetaTable.tsv"), meta_table, col.names = T)



# ╔═════════════════╗
# ╠═ Save Log File ═╣
# ╚═════════════════╝
Expand Down
7 changes: 4 additions & 3 deletions modules/local/plotting/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ process DISPLAY_REDUCTION {

output:
tuple val(meta), path ("*_FinalSO.rds"), emit: rds
path("*Validation.log"), emit: log
path("*.cloupe"), optional: true
path("*Validation.log"), emit: log
path("*.cloupe"), optional: true
path("*.pdf")
path ("*FinalVersions.log"), emit: r_versions
path ("*FinalVersions.log"), emit: r_versions
path('versions.yml'), emit: versions
path("*Execution.log"), emit: exec
path("*_MetaTable.tsv"), emit: meta

when:
task.ext.when == null || task.ext.when
Expand Down

0 comments on commit a1a0f88

Please sign in to comment.