This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Using GNU Parallel to read arguments into a bash script

Hi,

Here's my command:

 parallel -j 1 -a parameters.txt --colsep '\s+' ./pipeline.bioinformatics.sh {}

parameters.txt is a tsv file with 21 lines. Each line has 4 entries.

sample   Reads1   Reads2   ID

I am passing these commands into the sh file and assigning them to variables like

#!/bin/bash
sample=$1
Reads1=$2
Reads2=$3
ID=$4

My pipeline file uses a bunch of commands to assemble genomes, like Trimmomatic, samtools etc... When I run the command it skips through all of the java/python/perl my bash script is calling, any ideas why this is and what I should change?

gnu parallel bash

1 answer

It would help if you paste the error messages / script output.

The shebang line is incorrect: you are missing #!, and the path to bash most likely is "/bin/bash" (check with which bash). So the shebang should be:

#!/bin/bash

edit: questions original shebang was /usr/bin/bash.

Sorry my shebang is correct in the script. There is no error message. It prints everything to stnd out that it would normally do when running it as ./pipeline.sh Except it doesnt actually do any calculation, all the echo commands print, but python and perl stuff doesn't run.

If you run the script directly, does it work? Does:

 ./pipeline.bioinformatics.sh Sample read_1.fq read_2.fq ID

produce the desired output?

Without seeing your script, we can only shoot in the dark.

Log in to answer this question.