I am having problems trying to run singularity exec command passing it to sbatch. I can run the following command:
set -x;singularity exec simg.sif bwa 2>&1 | awk '{print $1}'
+ set -x
+ singularity exec simg.sif bwa
+ awk '{print $1}'
Program:
Version:
Contact:
Usage:
Command:
mem
fastmap
pemerge
aln
samse
sampe
bwasw
shm
fa2pac
pac2bwt
pac2bwtgen
bwtupdate
bwt2sa
Note:
There
`aln/samse/sampe'.
first.
However, if I ran it inside an
sbatch, the
$1 wasn't passed properly to awk:
$ sbatch --wrap "set -x && singularity exec $simg bwa 2>&1 | awk '{print $1}'"
Submitted batch job 1421870
$ cat slurm-1421870.out
+ awk '{print }'
+ singularity exec simg.sif bwa
Program: bwa (alignment via Burrows-Wheeler transformation)
Version: 0.7.17-r1188
Usage: bwa <command> [options]
Command: index index sequences in the FASTA format
mem BWA-MEM algorithm
fastmap identify super-maximal exact matches
pemerge merge overlapping paired ends (EXPERIMENTAL)
aln gapped/ungapped alignment
samse generate alignment (single ended)
sampe generate alignment (paired ended)
bwasw BWA-SW for long queries
shm manage indices in shared memory
fa2pac convert FASTA to PAC format
pac2bwt generate BWT from PAC
pac2bwtgen alternative algorithm for generating BWT
bwtupdate update .bwt to the new format
bwt2sa generate SA from BWT and Occ
Note: To use BWA, you need to first index the genome with `bwa index'.
There are three alignment algorithms in BWA: `mem', `bwasw', and
`aln/samse/sampe'. If you are not sure which to use, try `bwa mem'
first. Please `man ./bwa.1' for the manual.
Can anyone please help me with how I'm supposed to do this command inside the sbatch to get the proper output? Thank you.