0

I'm trying to run some samtools commands from a qsub call (to run on a cluster). For some reason, the commands do not seem to be recognized. However, if I copy-paste the command and run it directly from the terminal cluster, it works fine. Has anybody experienced such issues or have an idea what I'm doing wrong? Thanks,

Patrick

My qsub (this doesn't work):

#!/bin/bash
#./etc/sysconfig/pssc
#PBS -S /bin/bash
#PBS JOB_NAME="QSH_$(whoami)"
#PBS NODE_NUM="1"
#PBS NODE_PPN="${NODE_NCPUS}"
#PBS HOURS="24"
#PBS MINUTES="00"
#PBS SECONDS="00"
#PBS WALLTIME=${HOURS}:${MINUTES}:${SECONDS}
#PBS RES_LIST="nodes=${NODE_NUM}:ppn=${NODE_PPN}"
#PBS DIR_WORK="${PBS_O_WORKDIR}"
#PBS QUEUE="high"
#PBS cd ${DIR_WORK}
samtools index /data/test.bam /data/test.bai

If I run the command directly from the terminal, it works:

samtools index /data/test.bam /data/test.bai

  • Have you ever try to use qsub any other command? Did you test samtools through interaction mode of a node? Where is your error output? – Jason Jun 20 '19 at 03:38

1 Answers1

0

Did you remember to cd into your working dir? I do not believe that qsub expands the $ variables in e.g. PBS cd ${DIR_WORK}.

Try with this script:

#!/bin/bash
#./etc/sysconfig/pssc
#PBS JOB_NAME=test
#PBS WALLTIME=24:00:00

cd ${PBS_O_WORKDIR}

echo `pwd`
dir
MrGumble
  • 5,631
  • 1
  • 18
  • 33
  • Do u mean cd into the directory where the files are or samtools? /data/test.bam is the absolute path to test.bam, so I don't think this should be an issue, but maybe I'm mistaken. Thanks for any additional help/ideas. – Patrick Schorderet Feb 16 '15 at 17:59