-1

I'm running Debian 9 as VM from serial console on Azure.

Link to sample input file: https://drive.google.com/open?id=1aIIjWO70clU8u4_gV2X_8c17HmEnqjr_

I was given some code from the help people at antiSMASH. It should iterate through genbank files in a folder and process them with the antiSMASH package:

for infile in inputs/*.gbk; do
    antismash $infile --taxon fungi --input-type nucl --knownclusterblast
done

I tried running it while at the directory containing the files, and I tried running it while at the directory containing the folder "inputs" which contains the .gb files:

(antismash) macpat@Debian9:~/inputs$ for infile in inputs/*.gb; do
> antismash $infile --taxon fungi --input-type nucl --knownclusterblast
> done
ERROR   25/05 21:53:00   No sequence file found at 'inputs/*.gb'

I ran this:

(antismash) macpat@Debian9:~$ for infile in ~/inputs/*.gb; do echo $infile; done
/home/macpat/inputs/DQ660910.gb
/home/macpat/inputs/EU872212.gb
/home/macpat/inputs/GU930713.gb
/home/macpat/inputs/GU930714.gb
/home/macpat/inputs/HM180407.gb
/home/macpat/inputs/HM180409.gb
/home/macpat/inputs/HQ823618.gb
/home/macpat/inputs/HQ823619.gb
/home/macpat/inputs/HQ823620.gb
/home/macpat/inputs/HQ823621.gb
/home/macpat/inputs/JN408682.gb
/home/macpat/inputs/JQ340775.gb
/home/macpat/inputs/JX067626.gb
/home/macpat/inputs/JX067627.gb
/home/macpat/inputs/JX232185.gb
/home/macpat/inputs/JX232186.gb
/home/macpat/inputs/JX232187.gb
/home/macpat/inputs/JX232188.gb
/home/macpat/inputs/KJ501919.gb
/home/macpat/inputs/MG777489.gb
/home/macpat/inputs/MG777490.gb
/home/macpat/inputs/MG777491.gb
/home/macpat/inputs/MG777492.gb
/home/macpat/inputs/MG777493.gb
/home/macpat/inputs/MG777494.gb
/home/macpat/inputs/MG777495.gb
/home/macpat/inputs/MG777496.gb
/home/macpat/inputs/MG777497.gb
/home/macpat/inputs/MG777498.gb
/home/macpat/inputs/MG777499.gb
/home/macpat/inputs/MG777500.gb
/home/macpat/inputs/MG777501.gb
/home/macpat/inputs/MG777502.gb

This is the email I was sent by the antiSMASH people:

Dear antiSMASH user,

For running antiSMASH on many input files, I usually write a loop in bash, like so:

for infile in inputs/*.gbk; do
    antismash $infile --your --other-options --here done

Assuming your input files are in GenBank format and located in a subdirectory of your current directory called "input", antiSMASH will run on all your input files sequentially. I'm aware you asked for "all at once", but as antiSMASH has pretty decent CPU and memory requirements, especially when running ClusterBlast, I would not recommend that.

Best regards, Kai

wjandrea
  • 28,235
  • 9
  • 60
  • 81
MacPat
  • 9
  • 4
  • 3
    It looks like you're already in directory `inputs`, so instead of `inputs/*.gbk`, you have to use the relative path `./*.gbk`. Also, you should quote `"$infile"` so blanks and glob characters in filenames have no effect. – Benjamin W. May 25 '19 at 22:02
  • 2
    You also seem to mix up `.gb` and `.gbk`, make sure to use the correct one. – Benjamin W. May 25 '19 at 22:06
  • You could reproduce the problem with `ls inputs/*.gb`, so antiSMASH and your os/platform are irrelevant. – wjandrea May 25 '19 at 22:12
  • I tried from one directory above inputs as well. And I tried with .gbk, then tried .gb.I haven't tried the quotes on "$infile", I'll give that a go. – MacPat May 25 '19 at 22:46
  • wjandrea, are you saying replacing for infile in with just ls would be synonymous? – MacPat May 25 '19 at 22:47
  • Just ran this: (antismash) macpat@Debian9:~$ for infile in inputs/*.gbk; do > antismash "$infile" --taxon fungi --input-type nucl --knownclusterblast > done ERROR 25/05 22:49:59 No sequence file found at 'inputs/*.gbk' – MacPat May 25 '19 at 22:51
  • Just edited post to add a link to files that I'm attempting to input. – MacPat May 25 '19 at 22:53

2 Answers2

1

In the failed case you wrote inputs/*.gb. In the working one with echo you wrote ~/inputs/*.gb.

John Kugelman
  • 349,597
  • 67
  • 533
  • 578
0

inputs/ is a relative path, which means you have to be in its parent directory, /home/macpat, for it to work. To move to /home/macpat, you could run cd.

cd
for infile in inputs/*.gb; do ...

On the other hand, ~/inputs/ is an absolute path, which means it will work from anywhere.

for infile in ~/inputs/*.gb; do ...

Or if you're want to run the script from within ~/inputs/, you can run this:

cd ~/inputs
for infile in *.gb; do ...
wjandrea
  • 28,235
  • 9
  • 60
  • 81