I am doing an RNA seq analysis with mouse samples. I had my reads in several lanes, so I concatenated those fastq reads. Then I've mapped my reads with Hisat2 against the new version of mouse "GCA_000001635.9_GRCm39_genomic.fna".
Apparently everything works well up to here. Now I'm using samtools 1.9 to convert sam to bam, to sort those bam and create the index, just like this:
samtools view -bS ${file} > ${file}.bam
samtools sort -n ${file} -o ${file}_sorted.bam
samtools index ${file}_sorted.bam
But when indexing I get this error:
[bam_sort_core] merging from 11 files and 1 in-memory blocks... [E::hts_idx_push] NO_COOR reads not in a single block at the end 0 -1 samtools index: failed to create index for "CD4_1A_concat.bam_sorted.bam": No such file or directory
[bam_sort_core] merging from 11 files and 1 in-memory blocks... [E::hts_idx_push] NO_COOR reads not in a single block at the end 23 -1 samtools index: failed to create index for "CD4_1B_concat.bam_sorted.bam": No such file or directory [bam_sort_core] merging from 11 files and 1 in-memory blocks...
And more...
Any help would be appreciated!