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

Function test_validate_results

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

Source from the content-addressed store, hash-verified

1192
1193 #[test]
1194 fn test_validate_results() -> anyhow::Result<()> {
1195 let adata = create_test_anndata()?;
1196
1197 rank_gene_groups(
1198 &adata,
1199 "group",
1200 Some("B"),
1201 Some(&["A"]),
1202 Some("test_result"),
1203 Some(TestMethod::TTest(TTestType::Welch)),
1204 Some(6),
1205 CorrectionMethod::BejaminiHochberg,
1206 Some(true),
1207 Some(1.0),
1208 )?;
1209
1210 let uns = adata.uns();
1211 let names_array = uns.get_data("rank_genes_groups_test_result_logfoldchanges");
1212
1213 assert!(names_array.is_ok());
1214 let gene_names_data = names_array?.get_data()?;
1215 match gene_names_data {
1216 Data::ArrayData(array_data) => match array_data {
1217 ArrayData::DataFrame(df) => {
1218 assert_eq!(df.height(), 6)
1219 }
1220 other => {
1221 panic!("Expected DataFrame for logfoldchanges, found {:?}", other)
1222 }
1223 },
1224 Data::Scalar(_) => {
1225 panic!("Expected DataFrame for logfoldchanges, found scalar")
1226 }
1227 Data::Mapping(_) => {
1228 panic!("Expected DataFrame for logfoldchanges, found mapping")
1229 }
1230 };
1231
1232 Ok(())
1233 }
1234
1235 #[test]
1236 fn test_mann_whitney_method() -> anyhow::Result<()> {

Callers

nothing calls this directly

Calls 2

create_test_anndataFunction · 0.85
rank_gene_groupsFunction · 0.85

Tested by

no test coverage detected