0

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
Holger Just
  • 52,918
  • 14
  • 115
  • 123
  • Please include in your question the samtools commands that resulted in the error. – Cloudberry Apr 18 '23 at 19:24
  • Possibly related: [https://bioinformatics.stackexchange.com/questions/13997/samtools-index-chromosome-blocks-not-continuous](https://bioinformatics.stackexchange.com/questions/13997/samtools-index-chromosome-blocks-not-continuous) – Cloudberry Apr 18 '23 at 19:29

0 Answers0