zellerlab / siamcat

R package for Statistical Inference of Associations between Microbial Communities And host phenoType
https://siamcat.embl.de/
52 stars 16 forks source link

test on a new data from otutable #30

Open Mushahid2521 opened 2 years ago

Mushahid2521 commented 2 years ago

Is there a way to predict the new sample otutable? I don't have any metadata for those samples.

TIA

jakob-wirbel commented 2 years ago

Hi @Mushahid2521

Yes, this is possible! :) If you have another dataset without label information, you can still create a SIAMCAT object without a label. It will throw a warning, but it will work. Then, you can follow the Holdout testing vignette to predict on new samples with a trained model.

Cheers, Jakob

Mushahid2521 commented 2 years ago

Thanks a lot. It worked.

Mushahid2521 commented 2 years ago

Sorry. I am experiencing a new issue. My holdout feature table doesn't contain all the OTUs that are present in the training feature table. I get the following error message while performing normalize.features according to Holdout testing vignette.

Error in normalize.features(sc.obj.test, norm.param = norm_params(sc.obj),  : 
  all(norm.param$retained.feat %in% row.names(feat)) is not TRUE