{"action":"opened","issue":{"url":"https://api.github.com/repos/biocore/qiime/issues/1935","labels_url":"https://api.github.com/repos/biocore/qiime/issues/1935/labels{/name}","comments_url":"https://api.github.com/repos/biocore/qiime/issues/1935/comments","events_url":"https://api.github.com/repos/biocore/qiime/issues/1935/events","html_url":"https://github.com/biocore/qiime/issues/1935","id":57851357,"number":1935,"title":"hardcoded /tmp directory using mothur taxonomic assigner","user":{"login":"ekopylova","id":6933444,"avatar_url":"https://avatars.githubusercontent.com/u/6933444?v=3","gravatar_id":"","url":"https://api.github.com/users/ekopylova","html_url":"https://github.com/ekopylova","followers_url":"https://api.github.com/users/ekopylova/followers","following_url":"https://api.github.com/users/ekopylova/following{/other_user}","gists_url":"https://api.github.com/users/ekopylova/gists{/gist_id}","starred_url":"https://api.github.com/users/ekopylova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ekopylova/subscriptions","organizations_url":"https://api.github.com/users/ekopylova/orgs","repos_url":"https://api.github.com/users/ekopylova/repos","events_url":"https://api.github.com/users/ekopylova/events{/privacy}","received_events_url":"https://api.github.com/users/ekopylova/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-16T21:07:01Z","updated_at":"2015-02-16T21:07:01Z","closed_at":null,"body":"There are a few threads like [this](https://groups.google.com/forum/#!searchin/qiime-forum/pick_open_reference_otus.py$20error$20deni/qiime-forum/p2iM02MCKi0/x1ewsB2oxh4J) one that fail to assign taxonomy using mothur because of no writing permissions to the temporary directory which appears to be hardcoded to '/tmp' in the burrito-fillings mothur API.\r\n\r\nMore specifically, the 'temp_dir' in QIIME config seems to be ignored and if the TMPDIR env variable is set, only 2/3 paths in the mothur command use that directory. For example, if I set temp_dir in the QIIME config and TMPDIR to /scratch/Users/evko1434/tmp/, the mothur call still uses '/tmp' for the \"fasta=\" input file).\r\n\r\n['mothur', '#classify.seqs(fasta=/tmp/tmplR7bIdnOnVsNxanKAW22.fasta, reference=/scratch/Users/evko1434/tmp/tmpAT0uS4.ref.fa, taxonomy=/scratch/Users/evko1434/tmp/tmpiWOkFe.tax.txt, cutoff=80)']\r\n\r\nIn /burrito-fillings/bfillings/mothur.py, the input fasta file path is determined using the command: \r\n\r\n        self._input_filename = self.getTmpFilename(suffix='.fasta')\r\n\r\nThe self.getTmpFilename() function can also accept a tmp_dir argument and by default it is set to '/tmp'. In the case of the command above, no alternative is given to set the temporary directory and it always defaults to '/tmp'.\r\n\r\nBoth files for \"reference=\" and \"taxonomy=\" use NamedTemporaryFile() from tempfile to create temporary files which uses the temporary directory set by $TMPDIR, so no issues there."}}