I am trying to create an automatic chain of commands for analyzing biological data.
For this I am using Samtools in Slurm cluster. This line below is one of the commands I run for the analysis:
samtools view -h file.sam | awk '$6 ~ /N/ || $1 ~ /^@/' | samtools view -h > spliced.file.sam
Using this, I get my expected output (simple).
However, when I want to insert the command into a job with --wrap
I get a syntax error.
As presented:
sbatch --wrap "samtools view -h file.sam | awk '$6 ~ /N/ || $1 ~ /^@/' | samtools view -h > sp.file.sam"
awk: ~ /N/ || ~ /^@/
awk: ^ syntax error
Using srun
at the start of the command and &
at the end, are very helpful when submitting, but can I use it when I want to create a pipeline of commands? And can I add a dependency for this command? Is there a possible way to use the
--wrap
for this command?
I am aiming to create a automatic pipeline of commands, as the link below shows - https://gencore.bio.nyu.edu/building-an-analysis-pipeline-for-hpc-using-python/
Thanks in advance.