mikemc / speedyseq

Speedy versions of phyloseq functions
https://mikemc.github.io/speedyseq/
Other
45 stars 6 forks source link

Errors in calling phyloseq object after using filter_sample_data(), filter_tax_table() #79

Closed pickyseok closed 2 months ago

pickyseok commented 4 months ago

hello,

I am a big fan of speedyseq and have been used this package. In recent days, I found that speedyseq function cause error in calling phyloseq object. The last time i checked, the code works and didn't call error in October, 2023. I don't know reason why this happens but one of my colleages had the same problem. The function qza_to_phyloseq doesn't matter but when i call object after speedyseq function, it shows error. The assignment works but show error messages.

The error message shows followings:

ps<- qiime2R::qza_to_phyloseq(
  features = "data/table.qza",
  metadata = "data/metadata.tsv") %>% 
  speedyseq::filter_sample_data(!my_metadata %in% exclude_list)

phyloseq-class experiment-level object
Error in eval(call("force", as.symbol(paste0("..", x)))) : 
  argument "..2" is missing, with no default
mikemc commented 4 months ago

Hi @pickyseok , does filter_sample_data work for you if you try it on an included phyloseq object like GlobalPatterns?

Another thought: a cryptic error might occur if your filter expression is returning 0 samples. Can you check if a call with TRUE as the filter expression gives you an error?

(This is making me realize I should catch the case where no samples pass the filter so I can return a more helpful error message)

mikemc commented 4 months ago

Another thought: a cryptic error might occur if your filter expression is returning 0 samples. Can you check if a call with TRUE as the filter expression gives you an error?

This seems unlikely to be the issue, since when no samples pass the filter, I get a different error message:

> GlobalPatterns %>% filter_sample_data(FALSE)
Error in validObject(.Object) :
  invalid class “sample_data” object: Sample Data must have non-zero dimensions.
adrientaudiere commented 4 months ago

Hi @pickyseok, Did you try force an update of speedyseq?

pickyseok commented 3 months ago

Hi @mikemc @adrientaudiere Thank you for the comments and sorry for the late reply. The filter_sample_data worked for me when i used data(GlobalPatterns). And i didn't try to force an update of speedyseq. Fortunately, after downgrade of the R version (4.3.2 -> 4.3.1), the error message disappeared. Even now, I can't figure out what caused the error, but it's fixed anyway.. 👍 😂

mikemc commented 2 months ago

Ok, I'm closing this for now! @pickyseok feel free to reopen if you start having the issue again.