diff --git a/src/process_datasets/downstream/config.vsh.yaml b/src/process_datasets/downstream/config.vsh.yaml index e2102751..5459d30d 100644 --- a/src/process_datasets/downstream/config.vsh.yaml +++ b/src/process_datasets/downstream/config.vsh.yaml @@ -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 diff --git a/src/process_datasets/scFeatures/script.R b/src/process_datasets/scFeatures/script.R index 7b25e6e5..caf94733 100644 --- a/src/process_datasets/scFeatures/script.R +++ b/src/process_datasets/scFeatures/script.R @@ -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,