I am trying to align reads to hg38 using bowtie2 and then samtools. After getting the bam files and trying to index them I got the error:
E::hts_idx_push\] Chromosome blocks not continuous \[E::sam_index\] Read 'SRR764959.25000002' with ref_name='NC_000001.11', ref_length=248956422, flags=0, pos=91387388 cannot be indexed samtools index: failed to create index for "HFFmerged.bam": No such process
I am a complete novice to the whole process of analysing such data. I am using a MacBook Air and tried using fastq-dump
to convert some sra
files to fastq
, then I split them using
split -l 4000000 input.fastq output_prefix
and trimmed them with trim-galore
. After indexing hg38
to bowtie2
, I used the first block of code below to align my reads and then converted my sam
files to bam
with samtools
. After merging all the bam
files together I tried to index the merged bam
file to samtools
but got the error:
E::hts_idx_push\] Chromosome blocks not continuous \[E::sam_index\] Read 'SRR764959.25000002' with ref_name='NC_000001.11', ref_length=248956422, flags=0, pos=91387388 cannot be indexed samtools index: failed to create index for "HFFmerged.bam
for file in /Volumes/Untitled/IPStrimmed/*.fq; do
output=$(basename "$file" .fq).sam
bowtie2 -x /Volumes/MACOS/Users/rafail/Downloads/HG38/hg38_index -U "$file" -S "/Volumes/Untitled/IPStrimmed/IPSsam/$output"
done