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

Function rank_gene_groups

src/memory/processing/diffexp/mod.rs:189–240  ·  view source on GitHub ↗
(
    adata: &IMAnnData,
    groupby: &str,
    reference: Option<&str>,
    groups: Option<&[&str]>,
    key_added: Option<&str>,
    method: Option<TestMethod>,
    n_genes: Option<usize>,
    corre

Source from the content-addressed store, hash-verified

187/// ```
188#[allow(clippy::too_many_arguments)]
189pub fn rank_gene_groups(
190 adata: &IMAnnData,
191 groupby: &str,
192 reference: Option<&str>,
193 groups: Option<&[&str]>,
194 key_added: Option<&str>,
195 method: Option<TestMethod>,
196 n_genes: Option<usize>,
197 correction_method: CorrectionMethod,
198 compute_logfoldchanges: Option<bool>,
199 pseudocount: Option<f64>,
200) -> anyhow::Result<()> {
201 let method = method.unwrap_or(TestMethod::TTest(TTestType::Welch));
202 let key = key_added.unwrap_or("").to_string();
203 let compute_lfc = compute_logfoldchanges.unwrap_or(true);
204 let pseudocount = pseudocount.unwrap_or(1.0);
205 let n_genes = n_genes.unwrap_or(adata.n_vars());
206
207 let computation = compute_rank_gene_groups(
208 adata,
209 groupby,
210 reference,
211 groups,
212 method,
213 n_genes,
214 correction_method,
215 compute_lfc,
216 pseudocount,
217 )?;
218
219 let RankGeneGroupsComputed {
220 groups: groups_to_test,
221 results,
222 reference,
223 } = computation;
224
225 store_results(
226 adata,
227 &key,
228 &groups_to_test,
229 results.scores,
230 results.pvals,
231 results.pvals_adj,
232 results.logfoldchanges,
233 results.gene_names,
234 method,
235 groupby,
236 reference,
237 )?;
238
239 Ok(())
240}
241
242#[allow(clippy::too_many_arguments)]
243pub fn rank_gene_groups_dataframe(

Callers 5

test_basic_rank_genesFunction · 0.85
test_validate_resultsFunction · 0.85
test_mann_whitney_methodFunction · 0.85
test_multiple_groupsFunction · 0.85
test_edge_casesFunction · 0.85

Calls 2

compute_rank_gene_groupsFunction · 0.85
store_resultsFunction · 0.85

Tested by 5

test_basic_rank_genesFunction · 0.68
test_validate_resultsFunction · 0.68
test_mann_whitney_methodFunction · 0.68
test_multiple_groupsFunction · 0.68
test_edge_casesFunction · 0.68