Closed SMOKO2022 closed 1 year ago
NROW(DFI_swabs_microbial) [1] 7
Hi!
I assume you loaded the data using loadSQM
, and then exported it to an RDS file, and loaded it back later with readRDS
. Is this correct?
Does the problem also happen when using loadSQM
directly instead of loading from a RDS file?
Hi, thank you for your help. My colleague performed the SqueezeMeta run on our server and sent the RDS file for me to analyse using R on my local machine. We are using different versions of R (3.5.? and 4.2.2). Could this cause an issue in the subsetTax function? My colleague is able to subsetTax without problems on his local machine using the same file.
Hi,
Sorry for the delayed answer, I'm on parental leave.
Once you load the RDS file, try running library(data.table)
before doing anything else.
Hi,
No worries and congrats. I'm still getting the same error:
library(pheatmap) library(ggplot2) library(ggrepel) library(plyr) library(scater) library(scales) library(SQMtools) library(pathview) library(gage) library(reshape2) library(dplyr) library(tidyr) library(purrr) library(broom) library(vegan) library(cowplot)
metadata=read.table(file="~/Desktop/DFI swabs/metadata_swabs.csv", stringsAsFactors = F) DFI_swabs_microbial=readRDS("~/Desktop/DFI swabs/DFI_swabs.RDS")
library(data.table)
bacteria=subsetTax(DFI_swabs_microbial, 'superkingdom', 'Bacteria', trusted_functions_only = T)
Error in aggregate.data.frame(as.data.frame(x), ...) : no rows to aggregate
I have had success using RData files (as obtained using the save
function from R). I had a similar issue as you describe when loading them again, but it went away after explicitly loading data.table
. It seems that this trick don't work for RDS files.
Can you ask your colleage to just share the raw files with you instead?
You would need
1) The SqueezeMeta_conf.pl
file
2) The results
and intermediate
directories
3) Ensure that the directory structure and names on your local computer are the same as what is on the server. For example if your output directory was called SqueezeMeta_XXX and the ‘results’, ‘intermediate’, and conf file were in that directory you must also have this same structure on your own computer for SMQtools to locate all of the required files.
In R, RDS file seems to load properly but when I subset data:
(DFI_swabs_microbial is my SQM object), I get the following error:
Error in aggregate.data.frame(as.data.frame(x), ...) : no rows to aggregate