Thank you both for your suggestions!
Done what you suggested and made the history public ( Galaxy )
First I checked that the format of the outputs matches that which I get when I use the command line. The variant file is correct (at least for the tabular output, I assume the VCF just parses this to VCF format and is right too), however samtools depths outputs a depth file with three columns in galaxy (refname, position, depth) whereas Freyja variants outputs the depth file with four columns (refname, position, refnucleotide, depth). This could easily be the source of the problem.
I checked all your other suggestions as well: The issue is reproducible across runs on the same data as well as on different datasets I tried, for tabular and vcf output, and using the barcodes shipped with the package.
If the source of the problem is the depth file, I would suggest adding the freyja variants command as detailed here (freyja variants — Freyja documentation). I use this at the command line to create the depth and ivar variants files.
Note that there are other issues that I have found in how galaxy implements freyja and ivar that could possibly be fixed with this. I can make a separate thread for a feature request if you want, but ivar variants actually wants to take an mpileup as its input instead of a bam. The current ivar variants galaxy implementation cannot accept an mpileup.
When you run freyja variants it actually outputs the command it uses which is: samtools mpileup -aa -A -d 600000 -Q 20 -q 0 -B -f ref.fa sorted_trimmed.bam | tee (cut -f1-4 >prefix_depths.tsv) | ivar variants -p prefix -q 20 -t 0.0 -r ref.fa
That command would create both the depths and the variant file needed for freyja.
(Also I should note that I did create a bug report for this last week, but I never heard anything back so I went ahead and started this thread… sorry! If this ends up solving the issue you can ignore/close the bug report)
Thank you both again for your help! Let me know what you want me to do next, or if you want any further info.
-Chris