@@ -172,13 +172,22 @@ test_that("Prioritization scheme works", {
172
172
condition_colname = " aggregate" , condition_oi = condition_oi ,
173
173
features = feature_list )
174
174
175
- # Calculate condition specificity - only for datasets with two conditions!
176
- condition_markers <- FindMarkers(object = seurat_obj_test , ident.1 = condition_oi , ident.2 = condition_reference ,
175
+ # Test cell type names conversion for Seurat object
176
+ # Replace space with underscore
177
+ seurat_obj_test $ celltype2 <- gsub(" " , " _" , seurat_obj_test $ celltype )
178
+ new_celltypes <- suppressWarnings(get_exprs_avg(seurat_obj_test , " celltype2" ) %> % pull(cluster_id ) %> % unique())
179
+ expect_equal(new_celltypes , sort(unique(seurat_obj_test $ celltype2 )))
180
+
181
+ # Replace CD8 T with CD8_T-test & replace Mono with Mono-test
182
+ seurat_obj_test $ celltype2 <- gsub(" CD8 T" , " CD8_T-test" , seurat_obj_test $ celltype ) %> % gsub(" Mono" , " Mono-test" , . )
183
+ new_celltypes <- suppressWarnings(get_exprs_avg(seurat_obj_test , " celltype2" ) %> % pull(cluster_id ) %> % unique())
184
+ expect_equal(new_celltypes , sort(unique(seurat_obj_test $ celltype2 )))
185
+
186
+ # Calculate condition specificity - only for datasets with two conditions!
187
+ condition_markers <- FindMarkers(object = seurat_obj_test , ident.1 = condition_oi , ident.2 = condition_reference ,
177
188
group.by = " aggregate" , min.pct = 0 , logfc.threshold = 0 ,
178
189
features = feature_list ) %> % rownames_to_column(" gene" )
179
190
180
- # TODO: TESTS FOR PROCESS_TABLE_TO_IC
181
-
182
191
# Combine DE of senders and receivers -> used for prioritization
183
192
processed_DE_table <- process_table_to_ic(DE_table , table_type = " celltype_DE" , lr_network ,
184
193
senders_oi = sender_celltypes , receivers_oi = receiver )
0 commit comments