Hi,
I'm trying to run BWA-MEM with an array of files rather than manually inputting each single one... but it seems BWA is not getting the files correctly. Does anyone have some experience with this, please?
This is my command,
bamlist=$(find $PWD -name "${id}*.fastq.gz" | sort)
bwa mem ${reference} "${bamlist[@]}"
I don't really understand it because echoing it seems to be right,
bwa mem genome/gr37.fasta Sample_23/23_E_2_S214_L006_R1_001.fastq.gz Sample_23/23_E_2_S214_L006_R2_001.fastq.gz Sample_23/23_E_2_S214_L007_R1_001.fastq.gz Sample_23/23_E_2_S214_L007_R2_001.fastq.gz Sample_23/23_E_2_S214_L008_R1_001.fastq.gz Sample_23/23_E_2_S214_L008_R2_001.fastq.gz
what is the (error) message you get, if any?
None in particular (that's why I didn't indicate it). It just gives back the BWA-MEM help.
aha, but bwa mem only takes at best 1 pair of fastq files as input, not a whole list.
So to achieve this efficiently do what Pierre Lindenbaum suggests below.