This is a test version of Biostars. For the public version, visit https://www.biostars.org.
amrfinder not working on loop?

Hi, i am trying to run amrfinder on multiple genome as in loop, and it gives following error, and whatever input file I am using in this program are also not shown after it run.

    #!/bin/bash

    **for k in /home/bvs/neelam/AMRFINDER_hypo/hyocool/*.fasta;do
            NAME=$(basename $k .fasta)
            echo $k
    amrfinder --protein $k --threads 30  -o $k 
    done**
    sh amrfinder.sh

    /home/bvs/neelam/AMRFINDER_hypo/hypothetical_analysis/P_aeruginosa_RP73.fasta
    Running: amrfinder --protein /home/bvs/neelam/AMRFINDER_hypo/hypothetical_analysis/P_aeruginosa_RP73.fasta --threads 30 -o /home/bvs/neelam/AMRFINDER_hypo/hypothetical_analysis/P_aeruginosa_RP73.fasta
    Software directory: '/home/bvs/neelam/AMRFINDER_hypo/amr/'
    Software version: 3.11.14
    Database directory: '/home/bvs/neelam/AMRFINDER_hypo/amr/data/2023-04-17.1'
    Database version: 2023-04-17.1
    AMRFinder protein-only search
      - include -n NUC_FASTA, --nucleotide NUC_FASTA and -g GFF_FILE, --gff GFF_FILE options to add translated searches
      - include -O ORGANISM, --organism ORGANISM option to add mutation searches and suppress common proteins

    *** ERROR ***
    Cannot open file '/home/bvs/neelam/AMRFINDER_hypo/hypothetical_analysis/P_aeruginosa_RP73.fasta' to get file size

    HOSTNAME: ?
    SHELL: /bin/bash
    PWD: /home/bvs/neelam/AMRFINDER_hypo
    PATH: /tmp/home/bvs/neelam/bin:/home/bvs/perl5/bin:/home/bvs/neelam/raxml-ng/build/bin:/home/bvs/neelam/PanFunPro_v1.0/my_interproscan/interproscan-5.61-93.0/interproscan.sh:/home/bvs/neelam/AMRFINDER_hypo/amr:/home/bvs/neelam/bedops/bin:/home/bvs/neelam/annotated/ISCompare:/home/bvs/neelam/snippy/bin/samtools-1.12/samtools:/home/bvs/ksnp/kSNP3:/home/bvs/neelam/annotated/anvio/bin:/home/bvs/hole2/exe:/home/bvs/neelam/rgi/bowtie2/bowtie2:/home/bvs/neelam/mlst/any2fasta:/home/bvs/neelam/mlst/bin:/home/bvs/neelam/staramr/bin:/home/bvs/neelam/mash:/home/bvs/neelam/quicktree:/home/bvs/neelam/gclust:/home/bvs/neelam/bedtools2/bin:/home/bvs/neelam/barrnap/bin:/home/bvs/neelam/mmseqs/bin:/home/bvs/neelam/Prodigal/prodigal:/home/bvs/neelam/ncbi-blast/bin:/tmp/home/bvs/neelam/bin:/home/bvs/perl5/bin:/home/bvs/neelam/raxml-ng/build/bin:/home/bvs/neelam/PanFunPro_v1.0/my_interproscan/interproscan-5.61-93.0/interproscan.sh:/home/bvs/neelam/AMRFINDER_hypo/amr/amrfinder:/home/bvs/neelam/bedops/bin:/home/bvs/neelam/annotated/ISCompare:/home/bvs/neelam/snippy/bin/samtools-1.12/samtools:/home/bvs/ksnp/kSNP3:/home/bvs/neelam/annotated/anvio/bin:/home/bvs/hole2/exe:/home/bvs/neelam/rgi/bowtie2/bowtie2:/home/bvs/neelam/mlst/any2fasta:/home/bvs/neelam/mlst/bin:/home/bvs/neelam/staramr/bin:/home/bvs/neelam/mash:/home/bvs/neelam/quicktree:/home/bvs/neelam/gclust:/home/bvs/neelam/bedtools2/bin:/home/bvs/neelam/barrnap/bin:/home/bvs/neelam/mmseqs/bin:/home/bvs/neelam/Prodigal/prodigal:/home/bvs/neelam/ncbi-blast/bin:/tmp/home/bvs/neelam/bin:/home/bvs/perl5/bin:/home/bvs/neelam/raxml-ng/build/bin:/home/bvs/neelam/PanFunPro_v1.0/my_interproscan/interproscan-5.61-93.0/interproscan.sh:/home/bvs/neelam/AMRFINDER_hypo/amr/amrfinder:/home/bvs/neelam/bedops/bin:/home/bvs/neelam/annotated/ISCompare:/home/bvs/neelam/snippy/bin/samtools-1.12/samtools:/home/bvs/ksnp/kSNP3:/home/bvs/neelam/annotated/anvio/bin:/home/bvs/hole2/exe:/home/bvs/neelam/rgi/bowtie2/bowtie2:/home/bvs/neelam/mlst/any2fasta:/home/bvs/neelam/mlst/bin:/home/bvs/neelam/staramr/bin:/home/bvs/neelam/mash:/home/bvs/neelam/quicktree:/home/bvs/neelam/gclust:/home/bvs/neelam/bedtools2/bin:/home/bvs/neelam/barrnap/bin:/home/bvs/neelam/mmseqs/bin:/home/bvs/neelam/Prodigal/prodigal:/home/bvs/neelam/ncbi-blast/bin:/home/bvs/.local/bin:/home/bvs/bin:/home/bvs/.rbenv/shims:/home/bvs/.rbenv/bin:/home/bvs/miniconda3/envs/crisprcasfinder/condabin:/home/bvs/perl5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/go/bin:/home/bvs/sratoolkit.3.0.0-ubuntu64/bin:/home/bvs/.rvm/bin:/home/bvs/.rvm/bin
    Progam name:  amrfinder
    Command line: amrfinder --protein /home/bvs/neelam/AMRFINDER_hypo/hypothetical_analysis/P_aeruginosa_RP73.fasta --threads 30 -o /home/bvs/neelam/AMRFINDER_hypo/hypothetical_analysis/P_aeruginosa_RP73.fasta
    /home/bvs/neelam/AMRFINDER_hypo/hypothetical_analysis/P_aeruginosa_RW109.fasta
    Running: amrfinder --protein /home/bvs/neelam/AMRFINDER_hypo/hypothetical_analysis/P_aeruginosa_RW109.fasta --threads 30 -o /home/bvs/neelam/AMRFINDER_hypo/hypothetical_analysis/P_aeruginosa_RW109.fasta
    Software directory: '/home/bvs/neelam/AMRFINDER_hypo/amr/'
    Software version: 3.11.14
    Database directory: '/home/bvs/neelam/AMRFINDER_hypo/amr/data/2023-04-17.1'
    Database version: 2023-04-17.1
    AMRFinder protein-only search
      - include -n NUC_FASTA, --nucleotide NUC_FASTA and -g GFF_FILE, --gff GFF_FILE options to add translated searches
      - include -O ORGANISM, --organism ORGANISM option to add mutation searches and suppress common proteins

    *** ERROR ***
    Cannot open file '/home/bvs/neelam/AMRFINDER_hypo/hypothetical_analysis/P_aeruginosa_RW109.fasta' to get file size

Thank you!

amrfinderplus

Cannot open file '/home/bvs/neelam/AMRFINDER_hypo/hypothetical_analysis/P_aeruginosa_RP73.fasta'

Looks like either the file path is incorrect or the account you are running this from is not able to read files in that location.

what is the output of the following commands:

ls -lah '/home/bvs/neelam/AMRFINDER_hypo/hypothetical_analysis/P_aeruginosa_RP73.fasta'
file '/home/bvs/neelam/AMRFINDER_hypo/hypothetical_analysis/P_aeruginosa_RP73.fasta'

0 answers

No answers yet.

Log in to answer this question.