Skip to content

Fix/lowdepth sample fix#8

Merged
nickp60 merged 3 commits into
mainfrom
fix/lowdepth-sample-fix
Sep 17, 2025
Merged

Fix/lowdepth sample fix#8
nickp60 merged 3 commits into
mainfrom
fix/lowdepth-sample-fix

Conversation

@nickp60

@nickp60 nickp60 commented Sep 16, 2025

Copy link
Copy Markdown
Contributor

This addresses how we consider the (usually poor quality) samples that have no metaphlan hits in the context of creating phyloseq objects. vdbR now will error and tell the user which samples they should remove from their metadata. Making this a hard error rather than a warning should clarify to users which samples they need to be aware of.

@nickp60 nickp60 requested review from Anqi-Dai and miraep8 September 16, 2025 18:04

@miraep8 miraep8 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me - thanks for adding the test cases as well!

Comment thread R/utilities.R

get_metaphlan_analyses <- function(con, analysis_ids, schema="public") {
raw_results <- get_subset_pg_df("mgx_metaphlan", "ia_id", analysis_ids, schema=schema) %>%
get_metaphlan_analyses <- function(con, analysis_ids, schema="public", include_failures=FALSE) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I think this include_failures flag is a good way to give people the data for all the samples they sequenced if they really want it! 👍

Comment thread R/utilities.R
if (include_failures){
if (sum(raw_results[raw_results$clade_name == "unclassified", "estimated_number_of_reads_from_the_clade"]) > 0){
print(raw_results[raw_results$clade_name== "unclassified", "ia_id"])
stop("some of the above analyses have metaphlan failures where estimated_number of reads from the clade is not zero as expected; please alert of the vdbR delevopers that the metaphlan output has changed")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Hopefully a good catch

@nickp60 nickp60 merged commit f6f70d1 into main Sep 17, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants