Skip to content

Commit

Permalink
add export of filtered normalized counts #6
Browse files Browse the repository at this point in the history
  • Loading branch information
sreichl committed Apr 5, 2024
1 parent efddf06 commit 66a1933
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions workflow/rules/mixscape.smk
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ rule lda:
lda_object = os.path.join(result_path,'{sample}','FILTERED_object.rds'),
filtered_metadata = os.path.join(result_path,'{sample}','FILTERED_metadata.csv'),
lda_data = os.path.join(result_path,'{sample}','LDA_data.csv'),
filtered_assay_data = os.path.join(result_path,'{sample}','FILTERED_{}_data.csv'.format(config["assay"]),
filtered_prtb_data = os.path.join(result_path,'{sample}','FILTERED_PRTB_data.csv'),
lda_plot = report(os.path.join(result_path,'{sample}','plots','LDA_UMAP.png'),
caption="../report/lda_umap.rst",
Expand Down
4 changes: 4 additions & 0 deletions workflow/scripts/lda.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ lda_object_path <- snakemake@output[["lda_object"]]
lda_plot_path <- snakemake@output[["lda_plot"]]
lda_data_path <- snakemake@output[["lda_data"]]
filtered_prtb_data_path <- snakemake@output[["filtered_prtb_data"]]
filtered_assay_data_path <- snakemake@output[["filtered_assay_data"]]

# parameters
assay <- snakemake@config[["assay"]]
Expand Down Expand Up @@ -119,3 +120,6 @@ fwrite(as.data.frame(lda_data), file=file.path(lda_data_path), row.names=TRUE)

# save matrix of PRTB values
fwrite(as.data.frame(GetAssayData(object = sub, slot = "data", assay = "PRTB")), file=file.path(filtered_prtb_data_path), row.names=TRUE)

# save matrix of assay values
fwrite(as.data.frame(GetAssayData(object = sub, slot = "data", assay = assay)), file=file.path(filtered_assay_data_path), row.names=TRUE)

0 comments on commit 66a1933

Please sign in to comment.