Skip to content

Commit

Permalink
add scFeatures result in the real dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
littlecabiria committed Aug 14, 2024
1 parent ebfc830 commit a8d6718
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/process_datasets/downstream/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ argument_groups:
resources:
- type: r_script
path: script.R
- path: /src/helpers/utils.R

test_resources:
- path: /resources_test/datasets/MOBNEW
Expand Down
15 changes: 4 additions & 11 deletions src/process_datasets/scFeatures/script.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,28 +44,21 @@ cat("Transforming spatial into AnnData\n")

output_sp <- anndata::AnnData(
layers = list(
counts = Matrix::t(assay(input_sp, "counts")),
logcounts = Matrix::t(assay(input_sp, "logcounts"))
),
obs = data.frame(
row.names = colnames(input_sp),
col = colData(input_sp)$col,
row = colData(input_sp)$row,
sizeFactor = colData(input_sp)$sizeFactor,
spatial_cluster = colData(input_sp)$spatial.cluster
counts =input_sp$layers[['counts']],
logcounts = input_sp$layers[['logcounts']]
),
obs = input_sp$obs,
var = data.frame(
row.names = rownames(input_sp),
feature_id = rownames(input_sp),
feature_name = rownames(input_sp)
),
obsm = list(
celltype_proportions = celltype_proportions,
celltype_proportions = input_sp$obsm[['celltype_proportions']],
L_stats = scfeatures_result$L_stats,
celltype_interaction = scfeatures_result$celltype_interaction,
nn_correlation = scfeatures_result$nn_correlation,
morans_I = scfeatures_result$morans_I

),
uns = list(
dataset_id = par$dataset_id,
Expand Down

0 comments on commit a8d6718

Please sign in to comment.