running HISAT2 with multiple samples
1
0
Entering edit mode
3.6 years ago

Hello all, I am running Hisat2 for my RNASeq alignment for many samples. My bash script is 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

echo 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

But i am getting error saying that [main_samview] fail to read the header.

please help me to get rid of this problem.

thanks and looking forward to hear from you.

RNA-Seq • 872 views
ADD COMMENT
0
Entering edit mode
3.6 years ago

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

ADD COMMENT

Login before adding your answer.

Traffic: 3148 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6