Hello,
I'm trying to run hisat on loop and I've been trying to modify an existing loop I had set up but can't get it to work with my new file names.
My R1 is called WTCH_1_val_1.fastq and my R2 is called WTCH_2_val_2.fastq, where every time WTCH is actually a different value to distinguish the difference samples. This is the loop I was using so far when all of my samples were WTCH_1.fastq and WTCH_2.fastq
for f in `ls -1 *_1.fastq.gz | sed 's/_1.fastq.gz//' `
do
echo hisat2 -x mm10idx -1 ${f}_1.fastq.gz -2 ${f}_2.fastq.gz -S ${f}.bam
done
Could someone that is much better at this than I am please modify it for me? thanks
Just replace every instance of
.fastq.gz
with.fastq
and it should work.I've tried that but it doesnt work sadly, the echo returns:
The loop as is thinks that the R2 finishes in "_1_val_2.fq.gz" but it finishes in "_2_val_2.fq.gz" the issue is the first _2 I think.