create index bam without having sam file
1
0
Entering edit mode
2.4 years ago
iamsmor • 0

hi everyone I need to create bam index for variant analysis.but I havenot sam files only bam files avaible.how I can create it? I 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 I get an error

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

Thank you for any little help

bam • 752 views
ADD COMMENT
1
Entering edit mode
2.4 years ago
ATpoint 83k

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.

ADD COMMENT
0
Entering edit mode

oh thank you. this answer gave me such relief .

ADD REPLY

Login before adding your answer.

Traffic: 1446 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6