Running mothur batch job

Hi! I am a university student and new to using mothur. I need to run align.seqs(fasta=mergedtrim.fasta, reference=silva.bacteria.fasta)
However, this takes too long and ends up timing out.
So I tried to run this command in a batch file.
This is the file contents:
align.seqs(fasta=mergedtrim.fasta, reference=silva.bacteria.fasta)

When I run $ ./mothur mothurcommands.txt , I get:
bash: ./mothur: No such file or directory

I feel like everything looks wrong. Please help and thank you!

Are you in the right directory? Check your working directory. Also, try renaming your batch file to be “mothurcommands.batch” I think mothur looks for a .batch file. Hope this helps. I am also a beginner, so hope I am not steering you in the wrong direction.

@amichaud is on the right path with their suggestion - thanks! Can you run ls from the prompt you are attempting to run mothur from? I suspect you don’t have mothur in that directory. If it is, when you run ls, you’ll see mothur listed. It isn’t necessary that your batch file ends in batch, but it is helpful to use that extension to keep things organized in your directories. I’d also suggest maybe making sure that you can get align.seqs to run from within mothur before you try to run it as a batch script.


Thank you so much for everyones help!
I changed my code again @pschloss . I loaded mothur after moving into my directory. I have attached my batch job:
#Move to directory
cd /coronavhealthy

#Load the mothur module
module load mothur/1.41.3

#Use mothur
align.seqs(fasta=mergedtrim.fasta, reference=silva.bacteria.fasta)

Then, outside the batch file (in command line): i just type sbatch

The error is:
/var/spool/slurm/d/job03174/slurm_script: line 26: syntax error near unexpected token fasta=mergedtrim.fasta' /var/spool/slurm/d/job03174/slurm_script: line 26: align.seqs(fasta=mergedtrim.fasta, reference=silva.bacteria.fasta)’

Why does the align.seqs line give an error if I loaded mothur beforehand?


You need

mothur "#align.seqs(fasta=mergedtrim.fasta, reference=silva.bacteria.fasta)"

if you are going to run the command directly from the command line. Also, we are currently on 1.44.1 and I would encourage you to update your version of mothur since 1.41.3 is about 17 months old and 3 versions old.


1 Like

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