Phyloseq to QIIME2

OK I got your RDS containing the phyloseq object and examined it.

The reason it is failing is that part of my R function (phyloseq2qiime2) does a check for sequences (ATCG only) before writing a representative/reference sequence fasta file based on those sequences it finds either in the row names or column names (depending on if taxa_are_rows=TRUE or FALSE for your phyloseq object).

In your case, your phyloseq object contained both sequences and MD5 hashes in the colnames. This is probably because you ran dada2 in QIIME2 for some of your samples, where the default parameter is --p-hashed-feature-ids. You can add the argument --p-no-hashed-feature-ids to output the ASV sequences instead of hashes.

Unfortunately, I don't have a fix for getting you a FASTA file right now using my script. The other files should be created correctly. If you need a FASTA file, can export a representative set of sequences from qiime2 and run uniquesToFasta from dada2 in R you could combine the two on the command line using cat and then filter for unique sequences using one of the various command line tools out there for FASTA file manipulation.

Hope this helps!
Christian