@Philipp Bayer Thanks, this bash script is awesome as I tried it on my data. But, my paired-end files are named in the following pattern:
sample1_lane1_R1_001.pass_sample1.fq sample1_lane1_R2_001.pass_sample1.fq
sample2_lane1_R1_001.pass_sample2.fq sample2_lane1_R2_001.pass_sample2.fq
I am trying to edit the script to get the following pattern in the name of sam and bam output, but did not work:
sample1_lane1_pass_sample1.sam
sample2_lane1_pass_sample2.sam
However, the editing of :
SAM=${r1%%_R1_.fq}.sam
/home/yog/software/hisat2-2.0.4/hisat2 -p 8 -x /data/Analysis/Radish_index --fr -1 $r1 -2 $r2 -S $out
to
SAM=${r1%%_R1_.fq}.sam
BAM=${r1%%_R1_.fq}.bam
/home/yog/software/hisat2-2.0.4/hisat2 -p 8 -x /data/Analysis/Radish_index --fr -1 $r1 -2 $r2 -S $SAM | samtools view -bS > $BAM
worked. :)