Entering edit mode
10 months ago
DareDevil
★
4.3k
I have run hisat2
on paired end samples to generate sorted bam
file. I used following command:
for r1 in *_1.fastq.gz; do sample=${r1/_1.fastq.gz/}; \
echo "Processing sample: "$sample; \
hisat2 -p 12 --rna-strandness RF -x /media/genome \
-1 $sample"_1.fastq.gz" -2 $sample"_2.fastq.gz" | samtools view -Sbo $sample.bam; \
done
Next. I tried to index the sorted bam file using samtools
:
samtools index Sample1.bam Sample1.bam.bai
But it thrown me an error as follows:
[E::hts_idx_push] NO_COOR reads not in a single block at the end 18 -1
samtools index: failed to create index for "Sample1.bam"
How to rectify this error? Any help appreciated