# Turn off fitlering in anpan\_repeated\_measures

**URL:** <https://forum.biobakery.org/t/turn-off-fitlering-in-anpan-repeated-measures/9024>\
**Category:** anpan\
**Created:** [August 3, 2026, 2:56pm UTC](https://forum.biobakery.org/t/turn-off-fitlering-in-anpan-repeated-measures/9024 "2026-08-03T14:56:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rob](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@rob](https://forum.biobakery.org/u/rob)\
**Post date:** [August 3, 2026, 2:56pm UTC](https://forum.biobakery.org/t/turn-off-fitlering-in-anpan-repeated-measures/9024/1 "2026-08-03T14:56:31Z")

</div>

I’m using anpan\_repeated\_measures on presence-absence data with multiple samples per individual. I’ve run the profiles through other filtering pipelines, so I’ve turned anpan filtering off with filtering\_method = “none”, but I see that in the function, kmeans filtering seems to be hardcoded here:

```auto
  purrr::walk(bug_files, read_filter_write, metadata = metadata, 
    genomes_dir = genomes_dir, covariates = covariates, 
    outcome = outcome, filtering_method = "kmeans", minmax_thresh = minmax_thresh, 
    sample_wise_filter_stats_dir = sample_wise_filter_stats_dir, 
    plot_ext = "pdf")

```

and again in `read_filter_write` :

```auto
  read_res = read_and_filter(bug_file = .x,
                             metadata = metadata,
                             genomes_file = genomes_file,
                             covariates = covariates,
                             outcome = outcome,
                             filtering_method = "kmeans",
                             minmax_thresh = minmax_thresh,
                             filter_stats_dir = sample_wise_filter_stats_dir,
                             plot_ext = "pdf")

```

would it be possible to turn this filtering off?

---

<div class="post-metadata">

**Author:** ![andrewGhazi](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/andrewghazi/32/2950_2.png) [@andrewGhazi](https://forum.biobakery.org/u/andrewGhazi)\
**Post date:** [August 3, 2026, 5:28pm UTC](https://forum.biobakery.org/t/turn-off-fitlering-in-anpan-repeated-measures/9024/2 "2026-08-03T17:28:32Z")

</div>

Good catch - I fixed it in the latest commit 👍

---

<div class="post-metadata">

**Author:** ![rob](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@rob](https://forum.biobakery.org/u/rob)\
**Post date:** [August 4, 2026, 11:17am UTC](https://forum.biobakery.org/t/turn-off-fitlering-in-anpan-repeated-measures/9024/3 "2026-08-04T11:17:02Z")

</div>

Thanks!

I found another bug, when running `anpan_batch` with the horseshoe model and `plot_result = T`, the line

`hit_df = all_bug_terms[q_global < q_threshold & abs(estimate) > ￼ beta_threshold]` doesn’t work with the horseshoe model, as `q_global` and `estimate` only exists for the fastglm model.

Also the value of `plot_result` doesn’t get passed on to `anpan_batch`

---

<div class="post-metadata">

**Author:** ![andrewGhazi](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/andrewghazi/32/2950_2.png) [@andrewGhazi](https://forum.biobakery.org/u/andrewGhazi)\
**Post date:** [August 6, 2026, 6:12pm UTC](https://forum.biobakery.org/t/turn-off-fitlering-in-anpan-repeated-measures/9024/4 "2026-08-06T18:12:26Z")

</div>

Hi there - I think the hit\_df bug with the horseshoe model you mentioned is [fixed as of this commit a couple months ago](https://github.com/biobakery/anpan/blob/29c37904d83a7d256212656fe61aa7e4703fe2ca/R/modelling.R#L731), are you sure you’re on the latest version?

But your note on plot\_result not getting passed looks correct, I’ll fix that momentarily.

---

<div class="post-metadata">

**Author:** ![rob](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@rob](https://forum.biobakery.org/u/rob)\
**Post date:** [August 6, 2026, 8:57pm UTC](https://forum.biobakery.org/t/turn-off-fitlering-in-anpan-repeated-measures/9024/5 "2026-08-06T20:57:20Z")

</div>

Oh, yes, sorry, I was still using an older version.
