gravatar for antonioggsousa

1 hour ago by

Hi,

I don't know if is because of that or if it was a formatting error when you copied the message, but I would provide a list in id, instead of a list separated by tab, I would use space (perhaps tab is allowed but usually I use space). Apart from that you can't use echo. echo print information, it doesn't execute it, unless that you provide special characters to inform echo that is a command. Try the following:

#!/bin/bash

id="4B1 4B2 4B3 4B4 4W1 4W2 4W3 4W4 7B1 7B2 7B3 7B4 7W1 7W2 7W3 7W4"
for sample in $id

do

hisat2 -p 8 -x ./insectgenome/rhod.index --un-conc ./${sample}_insect_unmapped.fastq -1 ./reads/${sample}_R1_001_paired.fq.gz -2 ./reads/${sample}_R2_001_paired.fq.gz | samtools view -Sb - > ./${sample}_insect_mapped.bam

done

Let me know if it worked.

António



Source link