Hi thanks for the input!
I actually tried the following based on your code but this doesnt seem to work:
#!/bin/bash
#$ -N test
#$ -cwd
#$ -t 1-3
#$ -e $HOME/test.err
#$ -o $HOME/test.out
#$ -q all.q@bla
#Get n th bam file name / path
BAM=$( awk 'NR==$SGE_TASK_ID' /mnt/home1/project/bamFiles.list )
#run python code to count exons
python3.8 /mnt/DEXSeq/python_scripts/dexseq_count.py -p yes -r pos -s no -f bam \
/mnt/nochr_gencodev29.gff \
$BAM \
/mnt/xomics/osmana/dexseq/humandata/countData/RNA.$SGE_TASK_ID
Here it seems like dexseq doesnt get all the correct parameters and i guess it is because of $SGE_TASK_ID.
The error: .../python_scripts/dexseq_count.py: Error: Please provide three arguments
Is it because how I use the awk variable or $BAM ? Providing just a file name without $BAM or $SGE_TASK_ID seems to work just fine..
Gnu Parallel - Parallelize Serial Command Line Programs Without Changing Them
I did not realize you were on a cluster. SLURM offers arrays, probably the scheduler you use has something similar. That is probably preferred here.
Yes indeed but I have not being able to use SGE array job successfully yet
Looks like you are using SGE. So the trick here would be to use the for loop to submit independent SGE job for each BAM file. You should be able to create a
qsubcommand with the necessary parameters to do so. The jobs would start in parallel (to the extent of what is allowed for your account in terms of resources, rest would pend but then complete over time).