Hi all,
I usually organized my analysis by make bash scripts files that import a general config.sh file like this:
project=../projects/test/
raw_dir=../projects/fastq/
script_dir=${project}scripts/
log_dir=${project}logs/
mkdir -p $log_dir
# ---fastqc check
fastqc_dir=${project}fastqc/
fastqc_untrimmed_dir=${fastqc_dir}/fastqc_untrimmed/
demux_dir=${project}fastq/demux/
demux_trim_dir=${project}fastq/demux_trim/
fastqc_demux_dir=${fastqc_dir}/demux/
but it look kind of ugly and not easily reading.
Is there any other way to set a global variabel bash or yaml file that can be looked better?
One thing that definitely could break here @OP is that you need to quote your variables.
e.g.
fastqc_demux_dir=${fastqc_dir}/demux/
should befastqc_demux_dir="${fastqc_dir}/demux/"
Stops weird things happening if there are special characters or whitespace in your filenames.