Customized file naming convention for qiime tools export

We are able provide a custom name to --output-dir .

For instance:

qiime tools export \
--output-dir uw_unifrac

However, rather than have several directories for a single file, it may be beneficial to be able to give each exported file it's own name.

For instance:

qiime tools export \
--output-filename uw_unifrac.tsv
--output-dir for_R/

I might have missed something and this functionality may already exist. I also have no idea how difficult of a change this would be, or how useful it would be to anyone other than me.

Edit: Also, it is completely acceptable to just use either the cp or mv commands on the corresponding output file. Mainly I was just curious if this option was being developed, if not, no big deal.

Any input is appreciated. Thank you!

1 Like

Hey @kparke10!

This doesn’t exist yet, but it kind of ties in with something we are planning.

QIIME 2 uses directories inside of an artifact’s archive because there are plenty of situations where you need more than one file (and plenty where you don’t). This is why export dumps a directory, it’s not trying to think to hard about the data right now, it’s just looking in the /data/ directory of the artifact and copying whatever it finds there.

That’s why these single files all seem to have very specific names inside of a directory. That’s exactly how they are stored in the .qza.

What we’d really like to have happen, is to allow users to specify what format they would like their data to be in when they export. By default export can keep dumping the contents of the /data/ directory, but if you wanted that as a different file (or even different directory structure), you could indicate it just like when you import. This would allow you to write the single-file case to an arbitrary path, and otherwise, you must be writing a directory, and so you’d provide some arbitrary directory path (like right now).

The machinery for this already exists for the most part (this is actually how methods work in the framework, QIIME 2 translates formats and objects into whatever the method needs). What’s actually missing is just some more transformers to other formats and exposing a parameter from the CLI.

There’s an issue tracking this but we haven’t really gotten around to it yet.

1 Like

An off-topic reply has been split into a new topic: qiime tools export TEXT file format

Please keep replies on-topic in the future.