# align-to-tree-mafft-fasttree output-dir not working

**URL:** https://forum.qiime2.org/t/align-to-tree-mafft-fasttree-output-dir-not-working/16695
**Category:** User Support
**Created:** [September 24, 2020, 11:41pm UTC](https://forum.qiime2.org/t/align-to-tree-mafft-fasttree-output-dir-not-working/16695 "2020-09-24T23:41:04Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![rhizorick](https://forum.qiime2.org/user_avatar/forum.qiime2.org/rhizorick/32/9303_2.png) [@rhizorick](https://forum.qiime2.org/u/rhizorick)
#### Post date: [September 24, 2020, 11:41pm UTC](https://forum.qiime2.org/t/align-to-tree-mafft-fasttree-output-dir-not-working/16695/1 "2020-09-24T23:41:05Z")

</div>

Hi, I'm using 2020.8 and I've noticed when I run align-to-tree-mafft-fasttree, the trees are generated, but the output-dir command is not working properly. The directory gets created, but the tree files end up in the current working directory. I'm not sure if this is a bug or if it's something I'm doing, so I thought I'd ask here.

This is the code I'm running:

qiime phylogeny align-to-tree-mafft-fasttree   
--i-sequences rep-seqs-filtered2\_table-16S-only.qza   
--o-alignment aligned-rep-seqs-filtered2\_table-16S-only.qza   
--o-masked-alignment masked-aligned-rep-seqs-filtered2\_table-16S-only.qza   
--o-tree unrooted-tree-filtered2\_16S.qza   
--o-rooted-tree rooted-tree-filtered2-16S.qza   
--p-n-threads auto   
--output-dir phylo\_16S

Thanks!

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [September 24, 2020, 11:47pm UTC](https://forum.qiime2.org/t/align-to-tree-mafft-fasttree-output-dir-not-working/16695/2 "2020-09-24T23:47:05Z")

</div>

Hey there @rhizorick, let's take a closer look at the [help text](https://docs.qiime2.org/2020.8/plugins/available/phylogeny/align-to-tree-mafft-fasttree/) for the `--output-dir` flag:

```auto
--output-dir PATH Output unspecified results to a directory

```

So what that is saying, is any results that aren't explicitly specified should be saved into the directory specified here. You are specifying all 4 of the outputs here:

> [@rhizorick](#):
>
> –o-alignment aligned-rep-seqs-filtered2\_table-16S-only.qza  
> –o-masked-alignment masked-aligned-rep-seqs-filtered2\_table-16S-only.qza  
> –o-tree unrooted-tree-filtered2\_16S.qza  
> –o-rooted-tree rooted-tree-filtered2-16S.qza

so, there _are no unspecified outputs_ by the time we get to the `--output-dir` flag.

I see two potential solutions.

One, you can manually make the output dir yourself, and specify the output paths _into_ that dir:

```bash
mkdir phylo_16S

qiime phylogeny align-to-tree-mafft-fasttree \
  --i-sequences rep-seqs-filtered2_table-16S-only.qza \
  --o-alignment phylo_16S/aligned-rep-seqs-filtered2_table-16S-only.qza \
  --o-masked-alignment phylo_16S/masked-aligned-rep-seqs-filtered2_table-16S-only.qza \
  --o-tree phylo_16S/unrooted-tree-filtered2_16S.qza \
  --o-rooted-tree phylo_16S/rooted-tree-filtered2-16S.qza \
  --p-n-threads auto

```

Or two, you can allow the command to automatically name the files, and use the `--output-dir` flag:

```bash
qiime phylogeny align-to-tree-mafft-fasttree \
  --i-sequences rep-seqs-filtered2_table-16S-only.qza \
  --p-n-threads auto \
  --output-dir phylo_16S

```

Hope that helps! :qiime2:

---

<div class="post-metadata">

### Author: ![rhizorick](https://forum.qiime2.org/user_avatar/forum.qiime2.org/rhizorick/32/9303_2.png) [@rhizorick](https://forum.qiime2.org/u/rhizorick)
#### Post date: [September 25, 2020, 12:07am UTC](https://forum.qiime2.org/t/align-to-tree-mafft-fasttree-output-dir-not-working/16695/3 "2020-09-25T00:07:11Z")

</div>

Ah, I see! I was a little confused by the terminology in the help text. What you're saying makes perfect sense. I'll modify my code. Thank you!

---

<div class="post-metadata">

### Author: ![system](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/21af5fe23cb6f4579467c66a9ed94e55274ca7bd.svg) [@system](https://forum.qiime2.org/u/system)
#### Post date: [October 26, 2020, 6:07am UTC](https://forum.qiime2.org/t/align-to-tree-mafft-fasttree-output-dir-not-working/16695/4 "2020-10-26T06:07:12Z")

</div>

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
