Kneaddata in shell script

Hi,

I am a new user to kneaddata and bash scripting, and I was wondering if I could get help on running Kneaddata through a shell script. The purpose of the script is to go through a directory of pair read samples, trim everything, then dump it all into the output dir where I will sort it out later in the script. This script will later be attached to a large pipeline. I’m currently running into issues in bash when I run:

kneaddata “-t 32” “-i $r1” “-i r2” “-db $dbpath” “-o $out” “–run-trim-repetitive” “–bypass-trf” “–sequencer-source $ss” “–fastqc $fqc” “–trimmomatic $tpath”

After this the usage options appread following with:

kneaddata: error: unrecognized arguments: -db ~/.local/kneaddata_database/mouse --sequencer-source TruSeq3 --fastqc fastqc --trimmomatic ~/.local/Trimmomatic-0.39/

I know that this line should work because a successful run of kneaddata was performed when it was isolated on the terminal, with the variables replaced with static paths.

I figure I am missing some bash syntax to properly pass in the parameters, but from the error message, it looks like kneedata is accepting some of the parameters and throwing errors for others. Due to this I am rather stuck on how to proceed.

Any help is appreciated,
Alex

I solved this, the problem was the syntax. I need {} surrounding the variable name, eg ${var}.