the error you got is quite straightforward: some arguments (formula, tol, max_iter, conserve) that you've used in the ancombc2 function are not recognised by it.
The reason comes from the (sometimes confusing) fact, that ancombc (the function referenced in your tutorial) and ancombc2 (the function you're using) are two separate functions.
So there are two ways to proceed:
Try using the ancombc function (just remove the "2", from your ancombc2 function).
Investigate the ANCOM-BC2 tutorial and use the examples and arguments provided there.
group = "type", struc_zero = FALSE, neg_lb = FALSE,
alpha = 0.05, n_cl = 2, verbose = TRUE,
global = FALSE, pairwise = TRUE,
dunnet = FALSE, trend = FALSE,
iter_control = list(tol = 1e-5, max_iter = 20,
verbose = FALSE),
em_control = list(tol = 1e-5, max_iter = 100),
lme_control = NULL,
mdfdr_control = list(fwer_ctrl_method = "holm", B = 100),
trend_control = NULL)
Error: Sample size per group should be >= 2
Small sample size detected for the following group(s):
I searched the error message. From what I have understood is there is some issue with the group size. but my group(type 1 and type 2) have 64 and 30 samples respectively.
Run summary(tse@colData$type) to make sure that the output shows the group counts like you described.
lib_cut = 1000 can discard samples if sample library sizes are small. You can try setting it to a smaller number (although your samples should really have at least that amount of reads, but try it anyway)
Instinctively, I would also try setting pairwise to FALSE, just to see if the ANCOMBC2 runs.
If none of this works (or even if 2. or 3. works), I would inspect the tse object's tse@colData, rowData(tse) with dim, glimpse functions, just to see if the data has imported correctly from phyloseq.
Hello JustinK, I really appreciate your time and help. I firstly tried your solution number three, it worked.
I then checked my coldata$type and yes you are right there is no other variable( type-2 samples were not exported), Although my physeq object has both types of sample. I searched about it and found nothing to my understanding. For now I am using another column which has two variable and it worked, got the output. Will see if I can actually get further outputs using the tutorial till end.