"Bad magic number for central directory" when merging sequences

Hi,

I am merging sequence tables from different runs so I can have one ASV table to run q2-skclassify on. However, it's throwing me this error when I do merge-seqs

qiime feature-table merge-seqs --i-data ${DIR1}/rep-seqs-dada2.qza --i-data ${DIR2}/rep-seqs-dada2.qza --i-data ${DIR3}/rep-seqs-dada2.qza --i-data ${DIR4}/rep-seqs-dada2.qza --i-data ${DIR5}/rep-seqs-dada2.qza --o-merged-data ${OUTDIR}/merged-rep-seqs-dada2.qza

Error message:

File "{HOMEDIR}/anaconda3/envs/q2019.7_fresh/lib/python3.6/zipfile.py", line 1226, in _RealGetContents
raise BadZipFile("Bad magic number for central directory")
zipfile.BadZipFile: Bad magic number for central directory

There was a problem loading ${DIR4}/rep-seqs-dada2.qza as a QIIME 2 Result:

Bad magic number for central directory

When I merge the feature tables from the same directories I don't encounter any problem. I've also tried to run dada2 again on that particular batch in case the output was corrupt but I have the same problem on merging the sequences.

I link here the seq table for reference:

https://drive.google.com/file/d/15a81-UC8ZdBAEI6yDwTZEMDxKix5xRbf/view?usp=sharing

If I can be helped out it would mean a lot, thank you!!

Hey @ange,

Usually these issues happen because an action hasn't completed writing out the zip file. My guess is that there was still a running DADA2 process since it looks like you are merging a number of different runs. It's easy to lose track of one of them when that happens.

That said, it does sound like you've already tried to mitigate that by re-running the results of DIR4 so it may not be that. I just wanted to mention it as it's common.

P.S. I've also requested access to your google drive so I can take a closer look at the zip files.

Hi,

Thank you for getting back to me! The output of the repeat run was okay after all and the merge worked after that (I mixed it up with old output so I didn't realize it the first time); the seq table QZA from that batch was in fact the problem, so I'm marking this solved!

2 Likes