create index bam without having sam file
1
0
Entering edit mode
4 months ago
iamsmor • 0

hi everyone ı need to create bam index for variant analysis.but ı havenot sam files only bam files avaible.how ı can create it? ı tried

for i in $(ls$RNA_HOME/alignments/hisat2/*.bam  | tr -s '/.' ' ' | awk '{print $(NF-1)}') do samtools sort$RNA_HOME/alignments/hisat2/$i.bam >$i.bam
samtools index $i.bam echo indexing of$i finished
done


and ı get an error

 [bam_sort_core] merging from 9 files and 1 in-memory blocks...


thank you for any little help

bam analysis variant index to • 203 views
1
Entering edit mode
4 months ago
ATpoint 60k

What you see is not an error but just a message telling you that many temporary files have been merged into one, that happens when there is less memory available than the sorting needs so it starts writing tmp files to disk and then merges them. No worries about that. Use ls to see if the bai files are present. In fact only bam files can be indexed with samtools, not sam files. It should be fine.

0
Entering edit mode

oh thank you. this answer gave me such relief .