grunwaldlab / metacoder

Parsing, Manipulation, and Visualization of Metabarcoding/Taxonomic data
http://grunwaldlab.github.io/metacoder_documentation
Other
135 stars 28 forks source link

rarefy_obs seems to be removing all my samples? #322

Closed anonymouslichen closed 3 years ago

anonymouslichen commented 3 years ago

Hi all,

Just learning metacoder, hoping to do some beta diversity analysis. All my upstream data cleaning was in qiime, so I started with an OTU table. I'm at the point where I'm trying to rarefy my samples, but when I perform the following code it seems like all my samples are being removed?

obj$data$otu_rarefied <- rarefy_obs(obj, "otu_counts", cols = c(3:31), other_cols = TRUE)

Rarefying to 7091 since that is the lowest sample total. The following columns will be replaced in the output: 241, 242, 243, 244, 245, 246 ... 265, 267, 268, 269, 270

^^241-270 are all my sample columns. I can confirm based on visualizations in qiime that the min seq number for one of my samples is 7091.

Hoping someone can help!

zachary-foster commented 3 years ago

What does obj$data$otu_rarefied look like? Are the columns missing? When it says "The following columns will be replaced in the output" it means that the columns with the unrarefied count in obj$data$otu_counts will be replaced with the rarefied counts since they would have the same names, so the samples might still be there.