MCPcopy Index your code
hub / github.com/SingleRust/SingleRust / test_multiple_groups

Function test_multiple_groups

src/memory/processing/diffexp/mod.rs:1279–1313  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1277
1278 #[test]
1279 fn test_multiple_groups() -> anyhow::Result<()> {
1280 let adata = create_test_anndata_three_groups()?;
1281
1282 rank_gene_groups(
1283 &adata,
1284 "group",
1285 None,
1286 Some(&["A", "B", "C"]),
1287 Some("multi_group"),
1288 Some(TestMethod::TTest(TTestType::Student)),
1289 Some(3),
1290 CorrectionMethod::BejaminiHochberg,
1291 Some(true),
1292 Some(1.0),
1293 )?;
1294
1295 let uns = adata.uns();
1296 let scores = uns.get_data("rank_genes_groups_multi_group_scores")?;
1297 let _gene_names = uns.get_data("rank_genes_groups_multi_group_names")?;
1298
1299 match scores.get_data()? {
1300 Data::ArrayData(ArrayData::DataFrame(df)) => {
1301 assert_eq!(df.width(), 3, "Should have results for 3 groups");
1302 assert_eq!(df.height(), 3, "Should have 3 genes per group");
1303
1304 let column_names = df.get_column_names();
1305 assert!(column_names.iter().any(|name| name.as_str() == "A"));
1306 assert!(column_names.iter().any(|name| name.as_str() == "B"));
1307 assert!(column_names.iter().any(|name| name.as_str() == "C"));
1308 }
1309 _ => panic!("Expected DataFrame for scores"),
1310 }
1311
1312 Ok(())
1313 }
1314
1315 #[test]
1316 fn test_edge_cases() -> anyhow::Result<()> {

Callers

nothing calls this directly

Calls 2

rank_gene_groupsFunction · 0.85

Tested by

no test coverage detected